ReasonML versus BuckleScript

Uh, it seems pretty easy?

Say you have a javascript function in module Bloop like:

function blah(int, float) { return "hi"; }

It’s just:

external blah : int -> float -> string = "" [@@bs.module "Bloop"]

Yeah this is my big thing about it. I do not like some of their design choices as they try to make the OCaml syntax more Javascript’y. OCaml’s syntax is very consistent and everything is obvious at any point what it does, unlike Javascript…

Most of OCaml’s ‘Advanced Idioms’ surround it’s Module system and Functions (think the power and syntax is similar to Erlang/Elixir Tuple Calls, which is why I really really do not want Elixir to get rid of tuple calls later, grrr). I doubt that can do ‘too’ much to that at least. ^.^;

This is precisely it. ReasonML is, quite literally, just a source<->source transformer, can take OCaml and output ReasonML or take ReasonML and output OCaml (which it then feeds to the compiler when it compiles), nothing more, nothing less. It knows nothing about the type system or anything else of the sort, it is basic source to source transformation, thus it is not even capable of doing anything special or more advanced and at best it can only equal OCaml and at worst it just degrades and loses capabilities.

Heck, just use Bucklescript then, it’s normal OCaml, you can even mix and match ocaml and reasonml source files if you want (and transform them).

5 Likes