BuckleScript: An OCaml to JavaScript compiler
There is a specific niche that BuckleScript and Reason can fill, and that is the sort of front-end projects that use React+Redux+ImmutableJS+TypeScript&#x2F;Flow.<p>Instead of bolting on typing into Javascript (Flow and TS both do a good job of it btw), you could simply use a language that was designed with it. There is a huge difference in native adoption of such a core language feature vs using a transpiler that ultimately leak Javascript semantics.<p>If you&#x27;re using immutable values through ImmutableJS-like libraries, or by just being careful to not mutate stuff - then you should try working in a language that has immutability baked in. Having confidence that you&#x27;ve been careful to not mutate anything in your code vs using a language that simply disallows it in the normal course of programming brings a tangible difference.<p>You can call BuckleScript&#x2F;Reason as just a better version of Javascript with all the good things baked in. But it definitely is much more - you get to use Variants (Sum&#x2F;Union types in other parlance), and more importantly, writing value-based immutable code (instead of reference based mutation) lets you rely on equational reasoning to understand your code. Your functions are pure and can be seen as though they are equations, and your whole program is a composition of these equations.<p>A good thing about BuckleScript&#x2F;Reason vs transpiled languages like CoffeeScript is that we&#x27;re fully free from Javascript&#x27;s semantics. You are solidly inside OCaml, and Javascript simply doesn&#x27;t leak through. You don&#x27;t have to worry about JS scoping rules or how `this` works, or how ES6 classes are ultimately prototype-based. Except for a well-defined foreign-function interface that lets you use all of npm libraries or your existing JS code, once you are in the typed immutable world of OCaml, then that&#x27;s all you need to think about.<p>All of this applies not just to BuckleScript, but any Typed FP that runs on the browser - Elm, PureScript, and I believe Scala.js as well.<p>But one big advantage (or disadvantage, depending upon how you look at it) of OCaml&#x2F;Reason&#x2F;BuckleScript is that it allows mutation if you need it. You can start out writing purely imperative code just as you would in Javascript, and slowly adopt immutable programming as you get comfortable with it. You can also rely on mutation when you need to optimize specific parts of your code.