Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a detailed description or manual for this repository and its code architecture? #3988

Open
gmono opened this issue Dec 29, 2024 · 1 comment

Comments

@gmono
Copy link

gmono commented Dec 29, 2024

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?

@gmono gmono changed the title is there any description 偶然 is there any description or handbook Dec 29, 2024
@gmono gmono changed the title is there any description or handbook Is there a detailed description or manual for this repository and its code architecture? Dec 29, 2024
@MangelMaxime
Copy link
Member

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.sh and see all the different option available. You can see it like a MakeFIle.
  • 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 for import, emit of code, standard target API like JS.console.log for 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 replacement which map API to call API from fable-library-X or native API
  • Fable.AST: describe the AST that Fable use to transform the code, it is used by both Fable.Transform and 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants