The Reason syntax is now available on OCaml 4.06!
Thanks to @let-def for nearly single-handedly implementing the latest iteration of Reason syntax changes which were intentionally designed to be more familiar to the largest developer audience (with ES6 style lambdas
arguments => returnValue). Whether or not we all personally like the syntax changes, it’s undeniable that the feedback we’ve received has been overwhelmingly positive. I hope this ends up being good for the growth of the OCaml ecosystem in the long term. Several people have approached me asking how they can “use Reason to build their app” now that the “syntax is improved”. The power that syntax has over perception of a language continues to be eye opening. Even as a fan of the ML style of syntax, I must say it feels great to have a larger number of people immediately recognize your code as familiar and embrace it.
It should be fairly straightforward to integrate the Reason syntax/printer into your application, and Reason shouldn’t prohibit you from accessing all of OCaml’s features (anything less is currently considered a bug - for which pull requests (or Issues) are graciously welcome). If you use
jbuilder, then your build system already supports Reason (thanks to @diml and @rgrinberg). Merlin already has built-in first-class support for using Reason or standard OCaml syntax. (It’s pretty cool how Merlin + Reason demonstrates that you can build IDE infrastructure for which concrete syntax is fully abstracted away without giving up recovered parsing and recovered type checking). For those curious, Reason uses
ocaml-migrate-parsetree in order to sustain support for all modern OCaml versions. (Reason was one of the first test cases for
There’s still some room for improvements with the workflow/packaging and your contributions to help improve it are always welcomed. For example,
utop top level for Reason) should be factored out into its own opam package (this is tough to orchestrate with
opam-publish). This will help reduce package manager conflicts.
Most of our work in the last six months has been focused around building and shipping Reason React which uses Reason, BuckleScript, and ReactJS to create a very nice UI development experience (okay, to say I’m biased would be putting it lightly). (Questions about Reason React or BuckleScript would be best asked in their own threads, thanks!)
Stay tuned for more syntax improvements/features. Again, your contributions are welcomed and appreciated.