Reason meets OCaml
- Reason is a syntax extension to OCaml that compiles to efficient JavaScript. It has a rock solid type system and access to the OCaml ecosystem.
- ReasonReact provides React bindings for Reason. Components are defined in a similar way to TypeScript but use Reason's type system and compiler.
- Examples show how stateless and stateful components are defined in ReasonReact compared to TypeScript. ReasonReact uses OCaml's type system and reducer pattern while TypeScript uses interfaces and state.
- Interoperability with JavaScript is supported through modules, raw JavaScript blocks, and using the platform. Reason aims to leverage the strengths of both OCaml and React.
2. Agenda
• What’s the Reason?
• How it becomes a JavaScript?
• Type system and other cool features
• ReasonReact vs TypeScript + React
• Interop with JavaScript
5. Why Reason is worth giving a try?
• Rock solid type system
• Access to OCaml ecosystem and standard library
• Possibility to compile to barebone assembly