The Reason community officially provides ReasonReact as a solution for React-based web applications.[6]
BuckleScript and ReScript
Reason was originally compiled to JavaScript using the BuckleScript compiler,[7] which was created at Bloomberg L.P.
In 2020, the BuckleScript and Reason toolchain was rebranded to ReScript, essentially creating a separate language that had different syntax from Reason and only compiled to JavaScript.[8]
BuckleScript was forked to Melange[9] to continue to support compiling OCaml to JavaScript.
Example
typeschoolPerson=Teacher|Director|Student(string);letgreeting=person=>switch(person){|Teacher=>"Hey Professor!"|Director=>"Hello Director."|Student("Richard")=>"Still here Ricky?"|Student(anyOtherName)=>"Hey, "++anyOtherName++"."};