When we (darklang.com) were working with Rescript, I was not optimistic about Melange's approach, but in retrospect I think it has legs.
The challenge with ReScript is that the authors really were focusing on the JS ecosystem, and didn't care at all about OCaml. Their fusion with the ReasonML community didn't make a whole lot of sense. ReScript is a much better language now that it has split than it was then, if you look solely through the lens of a better JS.
But, as Elm and other compiled-to-JS languages have learned, Typescript has gotten good enough that other languages might not be sufficiently better than TS to attract enough interest to have a vibrant community. Doubly so since the JS-interop story isn't nearly as good in ReScript as it is in Typescript (though it's much much better than in Elm).
However, the aim of writing programs in OCaml which compile to nice JS and also native OCaml, and allowing both client and server to be written in OCaml, remains valid and interesting (and I would argue was held back by js_of_ocaml, the pre-existing way to do it). So I think there is something interesting here, though it isn't a ReScript competitor except tangentially.
Though I cannot really understand where ReasonML (a JS-like syntax for OCaml) fits into this - if the target is OCaml devs, than surely the ReasonML syntax stuff is not valuable anymore?
Your perspective on the project is exactly how we think about it: Melange provides the tooling for fullstack (@davesnx likes to call them Universal) Reason/OCaml applications.
I suspect my time in Clojure(Script) has heavily influenced how I look at a "Language of the System"[1], and that's effectively what we're trying to do here.
Re: ReasonML, I very much understand the sentiment. In my mind right now, ReasonML is only there to provide JSX and reason-react support. I suspect we'll eventually write a JSX PPX for OCaml and stop using ReasonML down the road (fairly longer term).
Thanks for Melange! I fully believe in the mission, backing, and philosophy of Melange over ReScript.
To add a counterpoint, though I'm in the minority, I think ReasonML is really really important to keep OCaml accessible to a larger amount of people. I work in a very cross-platform context and program in 5/6 different languages a month, and despite having a lot of experience with different syntaxes, OCaml is just weirdly unique enough that it's hard to immediately transfer my skills. I haven't written OCaml seriously in a while, and even looking back on my own code, for example the PPX I wrote https://github.com/AriaFallah/ppx_str 5 years ago, I can't really read it without zoning in and thinking quite hard vs. just flowing.
You also make a good point. I didn't go into too much detail about ReasonML in another comment, but I know Jordan (@jordwalke) has plans for a ReasonML v4 [1] with slight syntax improvements. I don't currently know the status of that work, however, but I think we'll want to make progress soon.
So the TL;DR is more that ReasonML is not going anywhere, especially since Ahrefs have a huge ReasonML frontend codebase [2].
I think it has value in that some people find OCaml syntax confusing, especially developers who have only had experience with C-style languages. For them, ReScript makes sense as an alternative syntax to a great language!
The main problems as I perceive it:
- unreadable generated code (aka, hard to debug in the browser)
- not very accessible (complex docs, unclear what it is or how to use it)
The challenge with ReScript is that the authors really were focusing on the JS ecosystem, and didn't care at all about OCaml. Their fusion with the ReasonML community didn't make a whole lot of sense. ReScript is a much better language now that it has split than it was then, if you look solely through the lens of a better JS.
But, as Elm and other compiled-to-JS languages have learned, Typescript has gotten good enough that other languages might not be sufficiently better than TS to attract enough interest to have a vibrant community. Doubly so since the JS-interop story isn't nearly as good in ReScript as it is in Typescript (though it's much much better than in Elm).
However, the aim of writing programs in OCaml which compile to nice JS and also native OCaml, and allowing both client and server to be written in OCaml, remains valid and interesting (and I would argue was held back by js_of_ocaml, the pre-existing way to do it). So I think there is something interesting here, though it isn't a ReScript competitor except tangentially.
Though I cannot really understand where ReasonML (a JS-like syntax for OCaml) fits into this - if the target is OCaml devs, than surely the ReasonML syntax stuff is not valuable anymore?