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 (around 20KB 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.0 and node 4.4 or newer installed in your computer. You can find latest F# installation instructions on fsharp.org (mac, windows, linux). To use the latest version, you can compile Fable from source on GitHub.

If you have problems on Windows see this.

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.

Fork me on GitHub