DEV Community

Sathish
Sathish

Posted on • Updated on

Explain reasonml Like I'm Five

Top comments (1)

Collapse
 
justgage profile image
Gage • Edited

ReasonML is a new JS inspired syntax for OCaml. OCaml is a 20 year old battle tested functional/imperative language that compiles to JavaScript and native binaries (like Go or C++). It's got the superpower of figuring out type mismatch errors without the need to write any type annotations.

In practice this means you can't pass a null value by accident to a function or a prop to a React component (which is a function). Also it protects you from passing props that don't exist. Also if they are the wrong type, like it's a string when it should be a number.

This is especially nice because it means less bugs, and far easier to change code, because you can just change the the API of anything then it will automatically show you all the places that break because of that change.

It's very ready for production, lots of people use it like Ubisoft and Facebook, many other companies. Most of the libraries you need are there if you're writing React, however if you need any help just ask in the Reason discord.