Live data from Hacker News

Melange 1.0: Compile OCaml / ReasonML to JavaScript

buttondown.email

21–30 of 55 posts

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#21
post #15

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…

Hi Paul, appreciate the kind words. 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…

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.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#23
post #21

Earlier quoted context omitted.

Hi Paul, appreciate the kind words. 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…

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 we…

Thank you :-)

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].

[1]: https://github.com/reasonml/reason/pull/2605 [2]: https://tech.ahrefs.com/ahrefs-is-now-built-with-melange-b14...

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#24

What is the status of ReasonML? My first experiences with ReasonML were very nice, because I found OCaml syntax confusing. I kinda left around the time ReScript got introduced. But OCaml syntax after a while isn't that bad, and in F# and Scala land I do miss the compile time speed of OCaml.

ReasonML purely as a syntax layer on top of OCaml is still being updated and released[1]. Incidentally, I'm one of the maintainers of that project too :-) With this Melange release, we're hoping to somewhat revive ReasonML and channel some folks back to the community from the perspective of a vertically integrated platform[2] that has seen major investment in the past few years. [1]: https://github.com/reasonml/reaso…

I'm glad to hear that! I had thought ReasonML was dead, because the blog hasn't been updated since 2018: https://reasonml.github.io/blog/

If you want to revitalize the project, please start updating the blog again :-)

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#25
Might as well ask this here, but any thoughts on how ReScript / ReasonML compare to Elm, PureScript, or ClojureScript? If someone were looking for a fp language that compiled to JS, how would they think about the pros and cons of the available options?

Last discussion I could find was from 2018 [1].

[1] https://news.ycombinator.com/item?id=17910069

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#27
post #15

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…

Out of curiosity, what do you think the issues with js_of_ocaml were?

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#28
A lot of the ecosystem is written in TypeScript (heavy on structural typing). Last I've checked OCaml still doesn't have substructural row polymorphism or set theoretic types, so this seems to be a futile endeavor until underlying fundamentals in its type system are addressed.

Elm & PureScript I believe solved this problem.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#29

A lot of the ecosystem is written in TypeScript (heavy on structural typing). Last I've checked OCaml still doesn't have substructural row polymorphism or set theoretic types, so this seems to be a futile endeavor until underlying fundamentals in its type system are addressed. Elm & PureScript I believe solved this problem.

OCaml's object types solve exactly this problem. And they have been around since Caml became OCaml.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#30
post #25

Might as well ask this here, but any thoughts on how ReScript / ReasonML compare to Elm, PureScript, or ClojureScript? If someone were looking for a fp language that compiled to JS, how would they think about the pros and cons of the available options? Last discussion I could find was from 2018 [1]. [1] https://news.ycombinator.com/item?id=17910069

Biased answer:

The biggest differences between Elm and ReScript/ReasonML as language features are bindings, JSX and purity. Bindings in Elm are cumbersome and limited (on purpose) while in ReScript/ReasonML are easy, more feature complete and a little more fragile. JSX is exactly as React, while Elm doesn't have it; some people prefer it, some people don't. I love it. Purity in general terms makes Elm more strict while ReasonML/ReScript allow impurity when needed, still most APIs enforce functional style, immutability and proper data structures.

Regarding community, there's drama everywhere not sure If I can do a good job here. Maybe community size Elm is much bigger than others, but they need to reinvent most of tooling that is done in JS and ReScript/Reason takes advantage.

I encourage to not rely on anyones opinion about what's better, because you listed 5 languages with opposite directions.

Try it out yourself and decide based on users/team needs. Cheers.

Post reply on HN