Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why ReasonReact is the best way to write React (freecodecamp.org)
2 points by longqzh on Oct 5, 2018 | hide | past | favorite | 1 comment


> One of Reason’s powerful features is BuckleScript compiler, which takes your Reason code, and compiles it to readable and performant JavaScript with great dead code elimination.

> If you take a closer look at React, you’ll see that some of its main principles are foreign to JavaScript.

> In Reason, we get immutability out of the box. Since it’s based on OCaml, the functional programming language, we have such features built into the language itself as well. Reason also provides us with a strong type system on its own.

So what your saying is - React, even though it "compiles" to JS, wasn't designed for JS - so lets add another layer called Reason, which is based on / needs another layer called oCaml, which needs Bucklescript to compile to JS.

I will forever be confused by all the layers of React. I want to write in 1 language for any given part of an application; not half a dozen.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: