5 ms·
So what's the deal with BuckleScript? The docs are really unclear on their relation and just call it a "partner project". But it's the actual compiler? Then wha
by kbd 8y ago
So what's the deal with BuckleScript? The docs are really unclear on their relation and just call it a "partner project". But it's the actual compiler? Then what is Reason?
- fspeech 8y agoReason = syntax for OCaml. Bucklescript is a transpiler to js. You can use other transpilers if you want but Bucklescript is great and has tightly integrated support. The best way to experience it is to just follow the "npm install" instructions. It may be a little confusing since you install Bucklescript, instead of Reason, as Reason is a syntax that Bucklescript supports. The online playground works great as well if you just want to get a feeling about the language.
- crimsonalucard 8y agoCan bucklescript compile OCaml into js?
- fspeech 8y agoYes that is what it was designed to do. Of course if your code calls out to some library implemented in native you will need to substitute with the js equivalent. Bucklescript has special syntax for you to describe the FFI to js, like Typescript. Otherwise it is OCaml in classical syntax or in Reason.