ReasonML – React as first intended
Currently using Reason. Here&#x27;s what they don&#x27;t tell you:<p>Pros:<p>* Compile speed is mindblowing. As in, a big project compiles within a few seconds, and incremental compiles are instantaneous. The productivity gains of this cannot be overstated; you just don&#x27;t get those moments anymore when you&#x27;re waiting for webpack, your mind wanders off, lets just check HN real quick, ... no, you just stay in the flow. It&#x27;s great. Elm, on the other hand, is sloooow.<p>* Type inference works really well. 9&#x2F;10 times I don&#x27;t even need to annotate anything and the compiler just knows. The only runtime errors I&#x27;ve ever run into were related to JS externals; the peace of mind knowing &quot;if it compiles, it really works&quot; is a game-changer even compared to TS.<p>* Error messages are (for the most part) fantastic and really helpful.<p>* Editor integration is solid, if a bit painful to set up at times.<p>* The ability to drop in the occasional chunk of dirty `[%bs.raw {...}]` is nice, and a clear advantage over Elm.<p>Cons:<p>* JSX support is a joke. You have to wrap every string in `(ReasonReact.String(&quot;bla&quot;))`. You have to wrap arrays in `(ReasonReact.array(...))`. Passing children to components is supposed to be easy but will make you rip your hair out for sure. Etc., etc. But I&#x27;m sure it&#x27;ll get there eventually.<p>* Refmt (the autoformatter) works pretty well but has lots of rough edges still. For instance, it removes all empty lines.<p>* State management isn&#x27;t the greatest. Passing down props works alright but often it&#x27;s just easier to keep things in a central Redux-ish store, especially because every. little. thing. needs to be passed down explicitly for the type checker to work.<p>* shouldComponentUpdate is hard-coded to `true` right now; there is no shallow comparison by default so everything always re-renders. Will be fixed medium- to long-term, I&#x27;ve been told. Workarounds exist but are pretty gnarly. Elm is much better at this.<p>* The standard library is a mess. ReasonML has its own, but forget about it; you&#x27;ll fall back on Belt (the BuckleScript one), which 8&#x2F;10 times has what you need but then is split into &quot;Belt&quot; parts and &quot;Js&quot; parts for unknown reasons and isn&#x27;t always complete (e.g. I constantly need to convert from lists to arrays and back, because some utility functions only exist for one of the two, also for no real reason). There is piping syntax (|&gt; and |.) but it&#x27;s never clear which one to use; sometimes the data goes in first, sometimes it goes in last. You get used to it eventually, but Elm is a land of milk and honey in comparison.<p>* Lack of sugar: For instance, you&#x27;ll end up making heavy use of option types, which are great obviously. Unfortunately there&#x27;s no easy access syntax, so you end up with deeper and deeper levels of nested `Js.Option.getWithDefault()` and&#x2F;or pattern matching.<p>* Documentation is meh overall. ReasonML is well documented, but it&#x27;s only a <i>very</i> thin layer on top of BuckleScript. It took me hours of trial and error to figure out JS interop in practice, setting up &quot;comparators&quot; just to create a `set(int)` etc. You&#x27;re effectively required to grok all of JS, Reason, Bucklescript, and OCaml at once, and draw from all of them to piece together your code. I think this will take another year or two to iron out.<p>Overall, I haven&#x27;t found an option yet that truly works well. Elm is beautiful but slow and will drown you in boilerplate. ReasonML is fast and mighty but the UX isn&#x27;t there yet. React+Redux+Typescript+Babel+Webpack have everything you need but it&#x27;s a pain to set up and maintain, it&#x27;s slow, and you can never trust it 100%.<p>(Edit: I should note that both Elm and ReasonML have amazing communities with very active, friendly and responsive dev teams that really and truly want the best for their languages. I have huge respect for both and I would encourage anyone to give them a try, just don&#x27;t expect a perfectly polished experience yet.)