2 ms·
Two things: 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 Fac
by jderochervlk 3y ago
Two things:
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.