4 ms·
> Currently it's a syntax on top of OCaml. Does this just mean it compiles to OCaml?
by jonahx 10y ago
> Currently it's a syntax on top of OCaml.
Does this just mean it compiles to OCaml?
- chenglou 10y agoThere's a crucial distinction! OCaml's compilation command takes in a `-pp` flag (preprocessor), which accepts a command that takes in a file and outputs an OCaml AST tree. We're basically using that. In that sense, the official OCaml syntax is really just that: another syntax like Reason, but official, and goes back two decades. Because of the clean mapping from one syntax to another, you can toggle between the two fairly easily: https://github.com/facebook/reason/wiki/Newcomer-Tips-&-Tricks#ocaml---reason-conversion-tricks https://github.com/facebook/reason/wiki/Newcomer-Tips-&-Tric...
- jonahx 10y agoInteresting. Thanks for explaining that.