3 ms·
Reason is just a dialect of OCaml and actually uses the BuckleScript[1] compiler, which before ReasonML, just took OCaml code and transpiling it to JavaScript.
by donut2d 8y ago
Reason is just a dialect of OCaml and actually uses the BuckleScript[1] compiler, which before ReasonML, just took OCaml code and transpiling it to JavaScript. It's known for being super fast and generating fast and small JavaScript. But you can compile ReasonML to native binaries as well, not just JavaScript, using the BuckleScript compiler or others like jbuilder[2].
The advantage of having OCaml as the foundation is its excellent type system. It's very mature.
I'm relatively new to OCaml, just getting into it this year, but I've found that it forces me to write correct code first. I've been really impressed by it having come from the world of PHP/JavaScript/Swift and others.
Personally, I greatly prefer OCaml's syntax to Reason's. I find it much simpler, and less busy. But I know a lot of people are more comfortable with Reason's syntax. I definitely wouldn't call it "cleaner", though.
[1]: https://bucklescript.github.io https://bucklescript.github.io
[2]: https://jbuilder.readthedocs.io https://jbuilder.readthedocs.io