When I first wrote this post, I had remembered that BuckleScript was briefly renamed “ReasonScript” before becoming “ReScript”. My memory appears to have been in error on this point, and I have marked the mistakes with strikethrough text.
It is possible that the OCaml community is not the right place to ask about what is going on with these prodigal-child languages, but I figure maybe someone who knows about still hangs out here.
Here’s what I know:
Bloomberg makes a JS backend for the OCaml compiler called BuckleScript.
Facebook, wants to add curly brackets to OCaml, so they write a new compiler frontend. They call this “Reason”, which I can only imagine is an ironic name, given that there is absolutely no reason to do it.
These two things get joined together somehow, but it is also possible to use them independently.
The ReasonML (formerly Reason) people allegedly stop caring about browser usecase (according to the BuckleScript people).—I very much have my doubts about this point in retrospect, and I wonder if the issue wasn’t more that the Reason people were not interested in bastardizing OCaml any further in the name of JS compat. Seems like they are still interested in supporting the browser usecase.
as a result, the BuckleScript people fork the frontend, taking the name ReasonScriptReScript and has the “vision” of making further changes to OCaml semantics to be more friendly to the browser.
At this point ReasonScriptReScript more or less abandons OCaml compatibility as a goal and BuckleScript is pretty much dead.
In a great stroke of madness, ReasonScript changes it’s name to “ReScript”, and I can only think about old Pepe memes when I see the name.
So that’s great.
ReScript is now completely separate from OCaml, but it seems to be thriving, more or less.
I had the impression ReasonML was dying, that the ReScript schism was sort of the final nail in its coffin, because the community appears to be so inactive, but they are still doing releases and I see now that they have a different JS backend for OCaml, Melange, which seems positive.
Not sure if meant to be tongue-in-cheek or AI-generated or what. ReScript and Reason are both doing fine. There are different tools with different names in both those ecosystems, same as you have both opam and dune in OCaml and outsiders can make fun of it and say ‘lul they need two build tools just to run a project’. Obviously we know that’s not true and that the tools are specialized to do certain tasks. Same thing with Reason/Melange/etc.
I think the most productive way to go forward is to ask what are your requirements. If you are looking for something that you can introduce to a dev team as a plausible alternative to TypeScript, then try ReScript. If you are looking for very mature OCaml ecosystem compatibility when compiling to JS, try JSOO (optionally with Reason syntax). If you are looking for something in the middle, try Melange (again optionally with Reason syntax).
It’s definitely not AI generated! (just what the AI would say, right?)
I guess it’s mostly tongue in cheek, but the tone is probably also a result of two things:
My frustration over trying to understand the different parts of the different projects, especially through multiple name changes in each—which I believe I finally have done.
Reason syntax became ReasonML when it started using the BuckleScript backend
ReasonScript became ReScript, just 'cause. I find this an incredibly strange name.
ReasonML continues to exist under that name, but now it’s Reason syntax + Melange JS backend
You have to admit that understanding what happened with these projects is confusing through all the name changes.
I just want a way to use OCaml with React, and I’m trying to figure out if there is a sensible way to do that. I’m glad to hear that ReasonML is still going strong and the existence of Melange is great news for me. I’m definitely not upset about combining different frontends and backends. I find this part very cool.
The same team developing melange also picked up the maintenance of the reason syntax. It is not moving very fast, I don’t expect the syntax to evolve much, but it’s being updated to work with recent ocaml versions. And some bugs are being fixed.
I greatly prefer the F# approach to fixing let/in, but I suppose that’s subjective. Moreover let/in could reasonably be called a wart on OCaml syntax, but this alone is not a reason to fork the syntax, in my opinion.
JSX is a good reason to use Reason, but it’s not an argument for Reason’s departure from OCaml syntax.
I guess my overall issue is that I just want to write OCaml with some of the benefits that BuckleScript had over Jsoo, and I was given the impression that this option “went away” when BuckleScript became ReScript, but it appears Melange is filling that gap now.
I think this is key here, do you want to understand the current state of the world or the messy history that led to it…
The way I see things:
Melange aims to be the best compile to JS tool of the OCaml ecosystem, spiritually it picks up where bucklescript stopped (even if technically it was forked from rescript I think). It shines if your goal is to write OCaml front to back, and the competitor in that category is eliom.
Presented that way, you have 3 very different projects with different aims.
It explains why ReasonML is not push changes aggressively (how often do you want your syntax to change?).
And we don’t need to scare people with all that messy history.
I can def. understand the confusion as the last blog post about ReasonML is from 5 years ago which makes it seem dead. However, if you look at the git history you can see that there is still very much action happening!
Personally I also prefer the ocaml syntax but I can imagine that introducing ReasonML would be more palatable to a team that has only used js/ts.
The reason why I had speculated that it might be AI-generated was that there were just some incorrect claims in the OP. And in fact the incorrect claims are being repeated. For example, there was never anything called ‘ReasonScript’. The ReScript team announced the name and project change in a clean break from the Reason project, and people parted ways to work on the things they found interesting.
Reason people wanted to keep full compatibility with the OCaml ecosystem and ReScript people wanted to focus on building a really great AltJS language with first-class React support, based on OCaml. And I think both the teams have done what they aimed to.
Another adjacent option I often find myself mentioning is to use tyxml’s JSX ppx, which allows you to use JSX in .re files (and IME pretty minimal actual reason code, if you’re judicious with how you organize things) to describe frontend stuffs separate from everything else that can continue to live in regular OCaml.
I think you must be right about “ReasonScript” never exiting. I have a very distinct memory of this name, but I can’t find any evidence of it, and it wouldn’t be the first time my memory has made stuff up. I’ll edit my original post to reflect this error.
Reason people wanted to keep full compatibility with the OCaml ecosystem
Also “full compatibility” might be in quotation marks here, since a lot of the OCaml ecosystem doesn’t work with Reason’s JS backend (Malenge) but does work with Jsoo. What Reason does do is keep semantic compatibility with OCaml so at least Reason’s native backed is indeed fully compatible with OCaml, making it possible to write a backend and frontend components which share a common set of compatible type definitions and utility functions, which is already a big win.
ReScript can’t do this with native compilation, but of course it will happily run on Node if you want to use it on the backend.