TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Melange 1.0: Compile OCaml / ReasonML to JavaScript

195 点作者 anmonteiro90将近 2 年前

17 条评论

pbiggar将近 2 年前
When we (darklang.com) were working with Rescript, I was not optimistic about Melange&#x27;s approach, but in retrospect I think it has legs.<p>The challenge with ReScript is that the authors really were focusing on the JS ecosystem, and didn&#x27;t care at all about OCaml. Their fusion with the ReasonML community didn&#x27;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.<p>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&#x27;t nearly as good in ReScript as it is in Typescript (though it&#x27;s much much better than in Elm).<p>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&#x27;t a ReScript competitor except tangentially.<p>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?
评论 #36298151 未加载
评论 #36298133 未加载
评论 #36300278 未加载
评论 #36303452 未加载
tylerag将近 2 年前
In the unlikely event you are confused on the difference between ReScript, Reason, and ReasonML, I recommend this post:<p><a href="https:&#x2F;&#x2F;ersin-akinci.medium.com&#x2F;confused-about-rescript-rescript-reason-reasonml-and-bucklescript-explained-ab4230555230" rel="nofollow noreferrer">https:&#x2F;&#x2F;ersin-akinci.medium.com&#x2F;confused-about-rescript-resc...</a>
评论 #36297698 未加载
Weebs将近 2 年前
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
评论 #36298326 未加载
评论 #36297933 未加载
评论 #36303766 未加载
k__将近 2 年前
As if the whole Reason&#x2F;ReScript story wasn&#x27;t complicated enough already :D<p>First, we had BuckleScript, that compiled OCaml to JavaScript to bring the OCaml type system to the Web.<p>Then we had Reason, that brought JS syntax to OCaml, so it&#x27;s easier to grasp for JS devs.<p>Seemingly, some people didn&#x27;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.<p>Now, the remaining (pre-fork) Reason people created a new(?) compiler that&#x27;s an alternative to BuckleScript, and compiles OCaml and Reason to JS.<p>While I appreciate the effort, and think ReScript and Reason are superior to TypeScript, I totally understand why it didn&#x27;t get as popular as this superiority implies.
评论 #36303157 未加载
评论 #36306266 未加载
评论 #36303904 未加载
Mimmy将近 2 年前
Might as well ask this here, but any thoughts on how ReScript &#x2F; 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?<p>Last discussion I could find was from 2018 [1].<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17910069">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17910069</a>
评论 #36300682 未加载
评论 #36306131 未加载
评论 #36307104 未加载
sp33der89将近 2 年前
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&#x27;t that bad, and in F# and Scala land I do miss the compile time speed of OCaml.
评论 #36297697 未加载
评论 #36297675 未加载
fredrikholm将近 2 年前
First multicore, now this? This makes me really happy.<p>OCaml is the most fun I&#x27;ve ever had writing code; seeing this after the whole Re* rebranding death spiral makes me hopeful that fullstack OCaml is still a possibility.<p>Thank you!
评论 #36301228 未加载
asycocaml将近 2 年前
Can someone please expain the state of doing async with Melange? ReasonML never had an answer in that important area to my knowledge.
评论 #36304622 未加载
idkjs将近 2 年前
Great new. Congratulations to the Melange team. Keep on keeping on.
emmelaich将近 2 年前
Just a note, melange is also the name of a computer language workbench from INRIA (<a href="http:&#x2F;&#x2F;melange.inria.fr&#x2F;" rel="nofollow noreferrer">http:&#x2F;&#x2F;melange.inria.fr&#x2F;</a>) and an APK builder (<a href="https:&#x2F;&#x2F;edu.chainguard.dev&#x2F;open-source&#x2F;melange&#x2F;overview&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;edu.chainguard.dev&#x2F;open-source&#x2F;melange&#x2F;overview&#x2F;</a>)<p>Both of those came up before melange.re when searching for a hello world example.
评论 #36304197 未加载
ekosz将近 2 年前
Interesting to see oh this will affect (or not) the Rescript project.
评论 #36297416 未加载
评论 #36297514 未加载
danieloro515将近 2 年前
Thanks for putting the time and effort into this. I was very sad to see the departure of rescript, so I am happy to see this wonderful toolchain back to the Ocaml ecosystem.
cassepipe将近 2 年前
Congrats on the releases ! I have been waiting for this make it to 1.0 for some time now. That&#x27;s a pleasant suprise.
js_of_ocaml_3将近 2 年前
A lot of the ecosystem is written in TypeScript (heavy on structural typing). Last I&#x27;ve checked OCaml still doesn&#x27;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.<p>Elm &amp; PureScript I believe solved this problem.
评论 #36300384 未加载
评论 #36300718 未加载
thangngoc89将近 2 年前
Congratulations on the project @anmonteiro90. Reading the thread makes me understand more about the situation of Rescript and ReasonML after the split. It’s totally makes sense now. I hope to pick up some OCaml project soon
gdsdfe将近 2 年前
this is all very confusing
colesantiago将近 2 年前
Do I need OCaml installed to use this, why not a single binary?
评论 #36297574 未加载