📄️ Conditional Compilation
This doesn't work with the Reason syntax right now, only the OCaml syntax.
📄️ Extended Compiler Options
Note: this section is only for people who want roll their own build system instead of using the recommended build system, bsb. This also provides some tips for contributors who debug the compiler.
📄️ Use Existing OCaml Libraries
This section is reserved for advanced usages. Usually, you'd pick an OCaml/Reason library that's already configured to work with our higher-level build system bsb (aka has a bsconfig.json). If not, you'd usually add a bsconfig.json to it. But if you want to directly use an OCaml package that's not part of the npm workflow, or are building some quirky infra with BuckleScript, keep reading!
📄️ Difference from Native OCaml
This is particularly important when porting an existing OCaml application to JavaScript.
📄️ Compiler Architecture & Principles
BuckleScript's high level architecture:
📄️ Comparison to Js_of_ocaml
Jsofocaml is a popular compiler which compiles OCaml’s bytecode into JavaScript. It is the inspiration for this project, and has already been under development for several years and is ready for production. BuckleScript’s motivation, like jsofocaml, is to unify the ubiquity of the JavaScript platform and the truly sophisticated type system of OCaml.