Hacker News new | ask | show | jobs
by sidkshatriya 1723 days ago
> Only thing that is holding it back more than that and the reason I have not done many projects with it, is it weirdly fragmented ecosystem.

Maybe you are referring to the Async/Lwt dichotomy? Hopefully with multicore (and basic support for "effects" that are going to be merged in OCaml 5.0) this will become less of an issue going forward. Since the runtime is becoming considerably more capable, I expect there to be less "real" fragmentation going forward as the libraries begin to use more of the primitives provided by the runtime rather than building their own from scratch.

But then again, fragmentation is a way of life in other ecosystems too. Haskell has an ever increasing number of effect systems and preludes, Rust has many async runtimes also (async-std, tokio etc.). Fragmentation can often mean a time of competition and vitality as different approaches duke it out.

Regarding syntax -- I feel too much time has been spent in the OCaml ecosystem on surface syntax. OCaml syntax has its flaws but syntax is really a small aspect of the overall art of programming. The OCaml format is here to stay -- even if it is a bit wonky. Once you commit to it you can begin to worry about more substantial things. The ReasonML community brought in the new syntax, but with the departure of Rescript (Bucklescript) from the OCaml community I expect the usage of the new javascript-y syntax to decrease.

(If I may be heretical, I actually prefer the traditional OCaml syntax! ReasonML tries to be like JavaScript with the braces and so forth. I prefer the Haskell/OCaml syntax to the JavaScript/Rust/C/Scala brace syntax. Interestingly, Scala 3 allows a braceless style in an effort to match Python perhaps. Fashion changes. Algorithms and programming patterns endure. We shouldn't worry about the syntax so much -- as long as it is not APL ;-) ! )

1 comments

> (...) with the departure of Rescript (Bucklescript) from the OCaml community (...)

I wasn't aware anything like that is happening, is it? Rescript departed from Reason, that's all, right? They want to focus solely on js target, because... that's what rescript is. New stuff they're doing looks really good.

The best source of information is probably this thread: https://discuss.ocaml.org/t/a-short-history-of-rescript-buck...
Yes, thank you, I don't see any OCalm depart there, just depart from ReasonML is mentioned.
I think the "depart" is not supporting newer OCaml feature. While Rescript/ReasonML at first was just an alternative syntax, it has now become a standalone programming language.
I'm sure they'll support new features that apply to rescript runtime context.

Things that don't make sense in javascript runtime context should not be supported.

Backward compatiblity on OCaml side is also something they don't need to care about as its ephemeral - it must typecheck and spit out valid javascript code, that's all.

What I meant is that Rescript is not really tied to OCaml as strongly as it was before. The connection before was: ReasonML frontend + Bucklescript compiler backend. Now you just have Rescript which is a rebranding of Bucklescript with a more focussed front-end language (which is a subset of ReasonML).

ReasonML aims to supports all of the OCaml syntax while Rescript's aim is to preserve only that syntax that is beneficial for a JS target.

ReasonML syntax can be used to do backend OCaml programming as well as front end programming. Rescript is focussed only on the (browser) frontend and drops some features from ReasonML. Its all quite complex and confusing but the TL;DR according to me is that ReasonML syntax is not going to be as important in the OCaml community as before...

I don't think ReScript is a subset of ReasonML. It's forked language that already has some substantial differences and will keep diverging.

ReScript is very active. ReasonML is dead for quite a while now. I'm pretty sure ReScript will drop ReasonML syntax soon?

> It's forked language that already has some substantial differences and will keep diverging.

This is really about opinion and individual assessment. It depends on how much emphasis one assigns to surface syntax vs deep language features.

Yes, the surface syntax of Rescript has been cleaned up a bit. There are some new language features but the language is still "close" to OCaml/ReasonML as of end 2021 according to me. If you're able to understand OCaml/ReasonML today you won't have much problem reading Rescript.

But, yes, it is diverging and it could look very different in the coming years.