Transpilation translates source code from one programming language into another while keeping the result at a comparable level of abstraction. JavaScript often serves as the target runtime for languages designed to run in web browsers, including TypeScript and CoffeeScript. This approach separates the language developers prefer from the JavaScript platform that executes the result. section 11.4.1
Fable applies the pattern to F#: it converts F# scripts into readable JavaScript and rewrites F# and .NET library functions into JavaScript equivalents. The generated code can then run through browser tooling, the Fable REPL, or NodeJS. section 11.4.2
A practical Fable workflow is:
- Create a local .NET tool manifest with dotnet new tool-manifest. section 11.4.2
- Install Fable with dotnet tool install Fable --version 3.7.22. section 11.4.2
- Compile a script such as sample.fsx with dotnet fable sample.fsx to produce sample.fs.js. section 11.4.2
- Use the Fable REPL for quick experiments, or combine generated JavaScript with WebPack or Parcel for an application build. section 11.4.2
A small F# program becomes JavaScript
The F# source defines two values, adds them, and prints the answer. Fable emits JavaScript that preserves the variable names and replaces printf with a library-backed console operation, producing the result 3. section 11.4.2
Figure 11.6 The Fable REPL in action. F# entered on the upper-left pane is converted into JS and then run. The output in the bottom-right pane shows any console output.
Run F# in the Fable REPL, inspect the emitted JavaScript, and observe console output in the same interface. section 11.4.2



