DEV Community

Sathish
Sathish

Posted on • Edited on

4 1

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.

Feature flag article image

Create a feature flag in your IDE in 5 minutes with LaunchDarkly’s MCP server ⏰

How to create, evaluate, and modify flags from within your IDE or AI client using natural language with LaunchDarkly's new MCP server. Follow along with this tutorial for step by step instructions.

Read full post

Announcing the First DEV Education Track: "Build Apps with Google AI Studio"

The moment is here! We recently announced DEV Education Tracks, our new initiative to bring you structured learning paths directly from industry experts.

Dive in and Learn

DEV is bringing Education Tracks to the community. Dismiss if you're not interested. ❤️