A short history of ReScript (BuckleScript)

Hi there @bobzhang ! I have been following the Rescript/ReasonML discussion from a distance. I believe there is value to sticking with the OCaml ecosystem but also value in striking out in a new direction. There are benefits to both approaches – it only depends on how well they are executed.

Therefore, I respect the direction you outlined in your original post on this thread. You wanted to get rid of a lot of bloat. Getting rid of ReasonML means that you can have a performant front-end end without lots of legacy, also you can customize Rescript more to the needs of the Javascript ecosystem, have better error messages etc. All these reasons make sense to me.

So I’ll get to the point: Since Rescript decided to take a slightly separate direction, understandably the Rescript community lost out on a lot of OCaml ecosystem experts. I don’t know how high the likelihood would be to attract OCaml people to work on the aging 4.06 era Rescript backend. While there is a lot of work to be done in Rescript in the future, it feels that a lot of progress was made between 4.06 and 4.13 in OCaml (and more on the way). All that work seems to have been thrown away. If I understand correctly you’re still using the old 4.06 merlin backend in the Rescript LSP also. So while your frontend is sparkling and fresh your compiler backend is aging.

Some may argue that the current rescript OCaml 4.06 backend is “good enough” – it may be good enough for now but will it be good enough 5 years from now when the whole world would be on OCaml 5.x? Who knows what directions things will take with things like Webassembly etc on the horizon? Meanwhile Rescript would still be on the 4.06 island.

Suggestion
So may I suggest a slightly different approach. Please keep your backend upto date with OCaml! The melange project GitHub - melange-re/melange: A mixture of tooling combined to produce JavaScript from OCaml & Reason by @anmonteiro which is based on OCaml 4.12 shows you can keep your backend upto date with minimal effort.

I personally don’t care if rescript front end language kept diverging from the OCaml/ReasonML – as long as you are sticking to the OCaml backend then you will have people excited to work on the Rescript compiler. Right now, the prospect of working on a 4.06 era codebase may not be very exciting to a lot of people, I think.

I don’t know the compiler internals sufficiently to know if my suggestions make sense or not. The main point I’m indicating here is that you need some sort of a concrete link with the current OCaml ecosystem for people in that ecosystem to want to contribute to Rescript.

So the Rescript front-end language can continue to diverge but it needs to have some connection that is alive with OCaml. As an example, the mirage ecosystem does not have it own forked compiler – it pulls in the latest ocaml base compiler and works with it. Can’t the rescript compiler stay upto date with the OCaml backend automatically?

Once you have some link that is alive with (modern) OCaml you will find a lot people from the traditional OCaml ecosystem wanting to contribute.

9 Likes