Live data from Hacker News

Melange 1.0: Compile OCaml / ReasonML to JavaScript

buttondown.email

11–20 of 55 posts

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#11

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.

With Melange ReasonML has a small comeback, since Melange and dune supports it out-of-the-box.

There has been a bit of activity on fixing bugs on refmt and polish the experience, no plans for big features so far but we will keep working on it.

We will update documentation from either reason-react and reason to highlight the integration with Melange soon.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#12

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/reason [2]: https://ocaml.org/docs/platform

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#13
post #8

In the unlikely event you are confused on the difference between ReScript, Reason, and ReasonML, I recommend this post: https://ersin-akinci.medium.com/confused-about-rescript-resc...

It's a good idea to read "A bit of history" under Melange docs: https://melange.re/v1.0.0/rationale/#a-bit-of-history

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#14
post #10

I have nothing to say other than thank you! I might not use OCaml often myself, but I appreciate the effort to improve the ML ecosystem in any way :) I was a bit disappointed with the ReScript fork abandoning the compatibility with OCaml so this project was welcome news

I'm also pleased to see this, as somebody who likes functional programming and ML dialects. I don't need braces just because C has them.

BuckleScript, when it was called that, was incredibly compelling for me. This was in part thanks to being blazing fast, unlike TypeScript. So I am pleased to see a spiritual successor.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#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 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?

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#16
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…

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!

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#17
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. 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).

[1]: https://www.youtube.com/watch?v=ROor6_NGIWU

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#18
post #10

I have nothing to say other than thank you! I might not use OCaml often myself, but I appreciate the effort to improve the ML ecosystem in any way :) I was a bit disappointed with the ReScript fork abandoning the compatibility with OCaml so this project was welcome news

Me too. I think the ReScript people were well within their rights to fork off - they realized that what they wanted was a better JS and compatibility with OCaml held them back, but it also split an already small community and made it hard for me to convince even myself to pick OCaml for hobby projects. I'm glad melange is picking up and becoming viable, and once the situation with multicore and web frameworks built on multicore stabilizes I'd love to make a full-stack OCaml web app.
Post reply on HN