Is there a detailed description or manual for this repository and its code architecture?
I am very interested in this compiler and am currently using this platform in a production project (with the goal of cross-language compilation). Is there a manual or detailed documentation for this code repository that would allow me to quickly get involved in the development of this compiler?
Hello @gmono,
We don't have a manual for this repository however, I made a F# Amplifying session about it.
I encourage you to watch it as I am giving a tour of Fable and show how to contribute to it.
A quick summary of the repo is:
Below the src folder you will find:
-
Fable.Build: this is a build orchestrator you can invoke it using./build.shand see all the different option available. You can see it like aMakeFIle. -
fable-library-X: contains the native representation of F# / Fable function used by the X target, for example it contains the API to work with Date, Reflection, List, etc. -
Fable.Core: offers Fable specific API forimport,emitof code, standard target API likeJS.console.logfor JS -
Fable.Cli: entry point of the Fable CLI -
Fable.Compiler: contains the logic to crack a F#/Fable project (retrieves dependencies, cache info, etc.) -
Fable.Transforms: contains the actual Fable logic which does:- F# AST to Fable AST
- Transform Fable AST to target AST (JavaScript, Python, etc.) it does both a direct replacement for example to transform a variable in F# to a variable in Python, JavaScript when possible or use what we call
replacementwhich map API to call API fromfable-library-Xor native API
-
Fable.AST: describe the AST that Fable use to transform the code, it is used by bothFable.Transformand also by Fable plugins so people can modify Fable output if needed. Feliz does it to offers an alternative React syntax. -
quicktest(-X): contains a small F# project used to quickly test out something. This is useful when working on a feature because we can isolate a tests instead of having to debug a 1000-2000+ tests project. This make is possible also to minimise the AST we are working with when trying to debug something
Below the tests folder, you will find the global test suite we have for Fable and the different target.
In general, if you want to work on the project you either use the build.sh or using VSCode we have a lot of debugger configuration already setup so you can debug Fable while it is running locally.
If you have anything you want to work on specifically, please feel free to open an issue or PR and we will do our best to guide you.