4 ms·
If your question is about why one would use Reason, Reason is an interesting alternative to Javascript for building web front ends (though it also can compile t
by mambodog 9y ago
If your question is about why one would use Reason, Reason is an interesting alternative to Javascript for building web front ends (though it also can compile to very fast native code for backend/systems use too).
Some things I feel are an improvement over Javascript + Flow or Typescript are:
- immutable data structures built into the language (and more conventionally used)
- real pattern matching on types, 'variant' types (like enums in Rust)
- better dead code elimination (helps to keep browser payload size down)
- you can use expressions everywhere (allowing more flexible code style than Javascript)
- currying/partial evaluation
- under the hood it's really just OCaml, which has benefitted from many years of development and improvement