reasonml-q-a icon indicating copy to clipboard operation
reasonml-q-a copied to clipboard

Reason vs OCaml vs js_of_ocaml vs BuckleScript?

Open baransu opened this issue 5 years ago • 1 comments

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 avatar Feb 15 '20 22:02 baransu

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

baransu avatar Feb 18 '20 23:02 baransu