BuckleScript is an optimizing compiler which compiles OCaml to readable JS. It is open sourced by Bloomberg since 2016.
BuckleScript is also the official JS bakcend for Facebook ReasonML, it has first class support for both vanilla OCaml and Reason syntax. It is also used by companies like Facebook in https://messenger.com and Google in cross-compiling WebAssembly interpreter into JS.
BuckleScript compiles one OCaml module into one JS module without name mangling, users can try it in the playground, the manual is available.
BuckleScript is focused on JS developer experience and NPM ecosystem, it is supported on all major platforms including Windows, Linux and Mac, users can install it in one line npm i -g bs-platform, it comes with its dedicated blazing fast build system working on all platforms.
I’m sure this is a faq, but I haven’t found an answer yet:
Does Reason work with the OCaml bytecode and native code compilers, or with js_of_ocaml? Since it’s just an alternative syntax, it should be possible to use it with any compiler, at least eventually, right? I only see Reason mentioned as an alternative syntax with Bucklescript, though.
You can already use Reason with all your existing tools. The only catch is you have to use refmt (a tool Reason provides) to convert your Reason files to OCaml files. Recently jbuilder and bsb started supporting Reason out of the box so you don’t even have to run refmt.
May be your argument was it’s detrimental for the community since there are two competing solutions which will divide the community. I don’t percieve it that way, I feel that opposite in fact. Both Bucklescript & Reason paves a way for more people (mainly JS developers) to try out and discover OCaml in an approachable way and increase the exisiting OCaml community.
Hi, it is not your issue, just I am really tired of such questions. Since day one we announced bucklescript, almost all responses we got from some OCaml programmers is “How is it different from js_of_ocaml” or “Why not contribute to jsoo directly”
I am a fan of js_of_ocaml, and I believe both are great tools, there is a place for both tools, I think the difference is quite obvious, pick the one you like or actually you can use both in the same time.
I’m writing a chess-themed tutorial on creating an SPA with Bucklescript-TEA. So far, 8 out of 12 parts are online, and I will post the remaining parts in the next few days (and probably refine what I wrote so far).
Would you like to edit the original post here to direct users to the bucklescript tag? Alternatively, we can also turn this topic into a wiki page that makes it editable by other users to make it easier to maintain the list of resources above.