How mature is the Reasonml tooling with preprocessors


I’m trying to come up with a “easy” way to introduce some colleagues to OCaml, and since they have prior knowledge of Javascript/Typescript, I thought a soft way to do so is to use Reasonml. I just have some questions on that front:

  1. Is Reasonml working with up-to-date Ocaml? AFAIK it’s just a new syntax.
  2. How does reasonml work with preprocessing tools? I currently have pps lwt_ppx ppx_yojson_conv that I use as preprocessing tools, and I’m curious if those continue to work if I have reasonML. I’d also like to have inline-tests in the future, hoping that will work as well.
  3. Are there any compilation penalties that come as a result of using Reason in terms of speed?
1 Like
  1. Reason is kept up-to-date with recent OCaml versions
  2. PPXs work
  3. No compilation penalty

Awesome, thanks for the rapid response.

One last question I forgot to ask, are the error messages from the LSP also equally understandable?

The LSP messages use ocamlmerlin-reason which prints the outcome tree in Reason syntax. The dune error messages will, however, be in OCaml syntax.

Another point: obviously there’s a compilation speed penalty since dune spawns an extra process for every ReasonML file (and none for OCaml files). This is noticeable in large codebases, though for some teams a more familiar syntax justifies the slowdown.


Great, that’s good to know!

OCaml is no stranger to revised syntaxes (cough camlp4 cough). How is ReasonML more than a revised syntax?
Edit: so, it is a revised syntax plus a syntax extension to define JavaScript objects e.g. let jsObj = {"x": 1, "y": "hello"};.

Today, it’s basically a revised syntax that has become more successful and widely adopted than any other revised syntax, and even gained some support on the OCaml Platform itself.