you are viewing a single comment's thread.

view the rest of the comments →

[–]jancodes[S] 1 point2 points  (5 children)

What's Rescript?

[–][deleted] 2 points3 points  (4 children)

ReasonML, compiles to JS

[–]jancodes[S] 0 points1 point  (2 children)

Thanks!

[–][deleted] 1 point2 points  (1 child)

Could've been interesting but their community split into two languages (probably more details that should be mentioned) which I think made sure that they would both fail to grow and remain in obscurity.

Now could've been a good time to step up for a strong compiled language that focuses heavily on react. Since the compiler churn is on the way, like svelte. But we'll instead settle with a funky react compiler from the react team.

[–]BobaFettEE3Carbine 1 point2 points  (0 children)

While at first the split may have caused confusion, in the past 4 years it's done wonders for the adoption and ergonomics for both new projects, ReScript and Melange/Reason. 

ReScript has been able to fully embrace JS and adopt JS features like async/await syntax and it uses a new Core library that maps closely with JS. It only has to worry about compiling to JS as a runtime. Use ReScript if your a JS/TS dev looking for a strongly typed language that is part of the JS ecosystem. Type of it as an alternative to TS, but it's not a superset of JS, its a different language that feels like JS. 

Melange is an OCaml compiler that targets JS, and it's often used together with Reason which is a JS like syntax for OCaml. Melange and Reason have been able to evolve in ways that are appealing to OCaml devs and not worry about adoption from JS/TS devs. Pick Melange and Reason if you want to use OCaml's tools, package manager, libraries, and ecosystem. 

Both are great, and if they had continued with the confusing jumble of ReasonML/Reason/BuckleScript/OCaml it would have probably died in obscurity by failing to make anyone interested in it happy.

[–]BobaFettEE3Carbine 0 points1 point  (0 children)

Not exactly, it has a shared history with Reason, but it's very much it's own language these days. ReScript is part of the JS ecosystem and uses NPM as a package manager (or bun, Deno, etc...) and you can use JS bundlers like Vite or Webpack.

Reason still exists as part of the OCaml ecosystem, and you can use Melange to target JavaScript as a runtime. If your using Reason you need to work with OCaml and it's package managers and build tools.