F# |> BABEL

The compiler that emits JavaScript you can be proud of!

Functional-first programming

Fable brings together the power of the F# compiler and Babel to make JavaScript a true backend for F#. It works directly on F# source code, no compilation needed.

JavaScript you can be proud of

Fable optimizes F# code to generate as clean JavaScript as possible. It comes with a tiny core library (less than 10KB minified and gzipped) and no other runtime.

Tools for the 21st century

Fable uses Babel to generate source maps. It is compatible with Babel plugins and JavaScript tools, like Webpack, and organizes code using ES6 modules.

Easy integration

Fable supports most of the F# core library and a bit of .NET BCL. It interacts seamlessly with other JavaScript libraries. As a bonus, it compiles NUnit tests to Mocha!

Getting started with Fable

A beta version has been released to npm! You can install and run it just by typing:

npm install -g fable-compiler
fable path/to/your/file.fsx

Note the package name is fable-compiler while the command is just fable. You must have F# 4.4 and node 4.4 or bigger installed in your computer. You can find latest F# installation instructions on fsharp.org (mac, windows). To use the latest version, you can compile Fable from source on GitHub.

Do you have 10 minutes? See Fable in action!

Watch a brief introduction to Fable by the author of Fable. Learn how to configure Fable, run the Fable samples including Mario game and client-server React.js demo compiled using WebPack.

Fable samples

Fable comes with a growing list of samples ranging from browser games to server-side node applications. You can find the full list at samples page and you can add your own samples by sending a pull request.

Documentation

Go to the Fable documentation page for more details. Is anything unclear or missing? Help us make Fable docs better by contributing!

Recent blogs about Fable

Fork me on GitHub