Live data from Hacker News

Melange 1.0: Compile OCaml / ReasonML to JavaScript

buttondown.email

31–40 of 55 posts

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#31

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.

Why would you need substructural typing to emulate Typescript? Is there a substructural type system feature in TS?

You can accomplish width subtyping with OCaml's "polymorphic variants", which could be used to emulate TS union types more flexibly than traditional sum types.

What are the features of Elm and Purescript that help model TS that OCaml doesn't have?

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#32

First multicore, now this? This makes me really happy. OCaml is the most fun I've ever had writing code; seeing this after the whole Re* rebranding death spiral makes me hopeful that fullstack OCaml is still a possibility. Thank you!

And Dream is being actively developed again: https://aantron.github.io/dream/

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

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

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)

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#34
As if the whole Reason/ReScript story wasn't complicated enough already :D

First, we had BuckleScript, that compiled OCaml to JavaScript to bring the OCaml type system to the Web.

Then we had Reason, that brought JS syntax to OCaml, so it's easier to grasp for JS devs.

Seemingly, some people didn't care about OCaml at all, and forked (I guess?) Reason to ReScript, that focused on JS compilation. They also added a few syntax changes in the process.

Now, the remaining (pre-fork) Reason people created a new(?) compiler that's an alternative to BuckleScript, and compiles OCaml and Reason to JS.

While I appreciate the effort, and think ReScript and Reason are superior to TypeScript, I totally understand why it didn't get as popular as this superiority implies.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#35

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…

Sorry if I am being pedantic but isn't it (confusingly) Reason (the new syntax) and not ReasonML (the organization) ?

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#36
post #32

First multicore, now this? This makes me really happy. OCaml is the most fun I've ever had writing code; seeing this after the whole Re* rebranding death spiral makes me hopeful that fullstack OCaml is still a possibility. Thank you!

And Dream is being actively developed again: https://aantron.github.io/dream/

Maybe will Onivim rise from the dead too ? Who knows

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#38
post #34

As if the whole Reason/ReScript story wasn't complicated enough already :D First, we had BuckleScript, that compiled OCaml to JavaScript to bring the OCaml type system to the Web. Then we had Reason, that brought JS syntax to OCaml, so it's easier to grasp for JS devs. Seemingly, some people didn't care about OCaml at all, and forked (I guess?) Reason to ReScript, that focused on JS compilation. They also added a few…

That’s the tragedy and part of the strength of open source.

Some people are just bent on doing their thing, the way they want it.

I prefer the current situation to the one where the ReScript people took over Reason and changed its focus and syntax.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

#39
Just a note, melange is also the name of a computer language workbench from INRIA (http://melange.inria.fr/) and an APK builder (https://edu.chainguard.dev/open-source/melange/overview/)

Both of those came up before melange.re when searching for a hello world example.

Re: Melange 1.0: Compile OCaml / ReasonML to JavaScript

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

What is your journey about F# and Fable?

I find Fable is good too and generated code is very readable.

Post reply on HN