zth / reasonml-q-a

ReasonML Q & A - Questions and answers for everything ReasonML.
https://reasonml-q-a.netlify.com
44 stars 0 forks source link

Reason vs OCaml vs js_of_ocaml vs BuckleScript? #14

Open baransu opened 4 years ago

baransu commented 4 years ago

Question

Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.

But what this exactly means?

Is Reason compiled to native or JavaScript? What's Reason relation to OCaml? What's a difference between BuckleScript and js_of_ocaml? Can I write once and compile to both native and JavaScript? The official website says it's compiled to JavaScript but this requires second tool - BuckleScript. And there is "official and experimental" project like https://reason-native.com/ which is about native compilation and says nothing about JavaScript. And to make things worse official documentation about Reason mentions bsb-native so fork of BuckleScript which allows you compile to JavaScript. So Reason can only be compiled to native via a fork of JS compiler?

Answer

This question hasn't been answered yet.

Further reading

-

baransu commented 4 years ago

I found this great article by @jchavarri describing the difference between js_of_ocaml and BuckleScript