Almost a year after the last release, ReScript is available in version 11! It marks the second major community-driven release and we are very thankful that there are so many willing contributors who invested their spare time into improving the compiler and its ecosystem.
- the type system is strong and sound. Unlike TS it's not adding a layer of types over an untyped language. There's no any or unknown types. This is a huge improvement to productivity and confidence in code.
- The compiler is blazing fast and type inference is instant, even on large code bases. TS can bog down VSCode and even crash when you have 150k loc and libraries like zod that are using type of to generate types.
- It has modern language features like variant types (like enums in Rust), pattern matching (like match in Rust), and no null or undefined issues since it uses Option (like Rust).
I've been working with it for a couple years now and I am able to move way faster in ReScript than I am in TypeScript. I've never once had a fight to figure out how to write a type for something or fought with a config file to get types to work correctly. It just works out of the box and everyone has the same type system.
The biggest unique feature it has over TypeScript is that it doesn't have the baggage of JavaScript. It's a totally different language (with a JS like syntax that's easy for JS devs to learn). You don't have to use something like eslint to control the "correct" way of using the language. The compiler does that for you.
1. It's history and naming haven't been consistent and has probably caused a loss in momentum for adoption. It started off with ReasonML out of Facebook back in 2016 driven by the creator of React (messenger.com is written in Reason). Reason has a JS like syntax on top of OCaml which compiles to JS or OCaml. It was connected to a project called BuckleScript which was an OCaml to JS compiler. BuckleScript wanted to adopt more JS only features (like async/await) and drop OCaml's standard library to make it easier to interop with JS. In 2020 the projects split and Reason continues to compile to OCaml and JS and is part of the OCaml ecosystem using OCaml's package manager. ReScript is a rebranding of BuckleScript that has dropped it's interop with OCaml and only compiles to JS. It uses NPM (or yarn, etc...) for a package manager and it was able to adopt syntax and features that are only feasible if you target just JS.
If it came out day 1 back in 2016 as ReScript from the creator of React and backed by Facebook I think we would see much higher adoption. As it stands now it appears to new comers that ReScript has only existed since 2020, when in reality it's as old as 2016, or 1996 if you consider that it's OCaml under the hood.
2. The vast majority of the JS community like JS and don't care about strong sound types, or features like pattern matching. There are other great compile to JS languages like Elm, PureScript, ClojureScript, and F# Fable. These other languages are fringe and probably always will be. While ReScript is (imho) a more practical language that is the closet to JS out of these languages, it will still suffer from being lumped in as "yet another attempt to replace JS".
Not having widespread adoption means that people are less likely to have heard about it or to consider using it. Most JS devs are happy with TypeScript's loosey-goosey type system and aren't bothered by seeing any or unknown types. Without major backing from a company like Microsoft, Google, Facebook, or Mozilla it will take a long time for it to gain adoption to the point of it not being considered fringe or experimental. I feel like anyone who truly uses it in a project and spends a couple months with it would have a hard time going back to TypeScript, but people aren't willing to put in that effort or time into something that isn't already mainstream. It will be years before the language shows up on something like The State of JS, or Stackoverflow's developer survey.