I have been trying ReasonML for some time, mostly because I wanted to have a look at OCAML.
As I have been reading Domain Modeling Made Functional which cover F#, it was easy to start with ReasonML.
And You can see benefits on the spot… no need for Redux, ReactRouter, Babel or Webpack. You can use functor to create your own router and state management. Bucklescript is blazing fast.
Like ELM, if it compiles it’s good to go.
Unlike ELM, You can use any libraries, but You will need to learn FFI, and that was really painful. For example, I had to write bindings for Phoenix.js. I am not sure it is even possible with latest version of ELM. Thankfully there was a previous work from @yawaramin for Phoenix.js 1.2 here
React 16.8 introduces hooks, it’s now possible to use only functional components. It’s not clear if the switch is worth for now. Maybe because I feel confident when writing plain JS.
One advantage I can see is it has the potential to compile to native code. That would be the killer advantage
- to be functional on the front end
- all, but You need to create bindings if they do not exists (that might be painful)
- well, it depends, for me it was a nice learning experiment. You might be switching a lot between docs of OCAML, Bucklescript, ReasonML. ReasonML is also trying too much to make Bucklescript looks like JS (as a marketing purpose I guess). I would prefer to have only one syntax.
- in the end, You just compile to JS in both case. But Bucklescript transpiler is really fast and You get type safety checking at compile time.
I have decided not to use it for the moment, and use React hooks, while still keeping an eye on it. But I might change opinion when ReasonML will compile to native code.