Skip to content

Commit

Permalink
Merge pull request #183 from bhlieberman/master
Browse files Browse the repository at this point in the history
Fix the dead link in the How Fable Works section
  • Loading branch information
Zaid-Ajaj authored Jun 28, 2024
2 parents d9cd4ab + ec3e4ce commit 653b17e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapters/fable/how-fable-works.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Understanding how Fable works

The compiler operates on F# source code directly, using the [F# Compiler Services](https://fsharp.github.io/FSharp.Compiler.Service/) for parsing and type-checking the code. Once the code is parsed, a representation of the F# code's structure is obtained, also known as an abstract syntax tree (AST). This structure is then transformed into a specialized simpler Fable AST that is easier to work with. Afterwards, the actual translation begins by transforming the Fable AST into [Babel](https://babeljs.io/) AST representing the structure of the JavaScript code that will be generated.
The compiler operates on F# source code directly, using the [F# Compiler Services](https://fsharp.github.io/fsharp-compiler-docs/fcs/) for parsing and type-checking the code. Once the code is parsed, a representation of the F# code's structure is obtained, also known as an abstract syntax tree (AST). This structure is then transformed into a specialized simpler Fable AST that is easier to work with. Afterwards, the actual translation begins by transforming the Fable AST into [Babel](https://babeljs.io/) AST representing the structure of the JavaScript code that will be generated.

The `Fable -> Babel` transformation is implemented as a set of what is called *replacements*. Parts of the F# code are replaced with parts of JavaScript code. These parts could be different kinds of declarations, function calls, loop constructs etc. These are translated to their counterpart in JavaScript. The resulting Babel AST is then handed off to the Babel compiler that will actually generate the final output.

Expand Down

0 comments on commit 653b17e

Please sign in to comment.