Description #
ReScript is a fast, typed functional language that compiles to high-performance JavaScript with a smooth developer experience.
History #
ReScript evolved from ReasonML and BuckleScript. It was renamed and repositioned as a standalone language in 2020 with its own syntax and tooling, while still rooted in OCaml.
Hello World Code #
Js.log("Hello, World!")
How to Run #
Option 1: Online
ReScript Playground
Option 2: Local
- Install:
npm install -g rescript
rescript init my-project
Compile and run:
npm run res:build
Key Concepts #
- Statically typed with type inference
- Functional-first but JavaScript-friendly
- Immutable by default
- Pattern matching
- Pipe operators
- React integration via ReScriptReact
- Fast compile times
- Clean JS output
- No null/undefined pitfalls
- Strong tooling and editor support
Try It Online #
Fun Facts #
- ReScript aims to be “the type-safe TypeScript alternative” for modern JS developers.
- Though based on OCaml, ReScript has a distinct syntax optimized for JavaScript interop.
- It’s used in Meta (Facebook) and Vercel projects.