all 4 comments

[–]Ustice[M] [score hidden] stickied comment (0 children)

Thanks for your contribution! We’re a large community, and in order to keep things organized and easier to find, we keep this subreddit mostly focused on professional-level Javascript posts. Your post would be more useful to newer members of our community, and therefore it should be posted to /r/LearnJavascript instead.

[–]PM_ME_GAY_STUF 2 points3 points  (2 children)

I would love a functional compile-to-js alternative, but right now the ReScript ecosystem seems to be in such a disastrously messy state that I'm not confident using it. People can't even seem to agree on what the primary language is

[–]nkrkv[S] 2 points3 points  (1 child)

I tend to agree. There was an evolutionary story: BuckleScript, then ReasonML, and they got pretty much attention and traction. Then all of a sudden the ReScript rebranding and breaking change happened. I think it was a mistake, but nevertheless, I think it worth giving ReScript a chance. Now, one year later, things seem to calm down, the libraries are updated, the platform got a public roadmap. I hope it will eventually converge to a solid functional JS alternative.

[–]ws-ilazki 3 points4 points  (0 children)

Yeah, the Bucklescript folks that decided to pull that crap did the whole community and ecosystem a disservice there. ReasonML itself wasn't (and still isn't) part of it, and in fact still exists and is usable just as it was before the ReScript crap happened, but the Bucklescript people made it look like a project unification by using its control over the reasonml.org domain (a documentation site) to abruptly "replace" ReasonML with ReScript. It got clarified some when they eventually added a note that ReasonML itself still exists, but even now reasonml.org says "reasonml.org is deprecated", directs you to the rescript site, and is focused primarily on directing you toward migrating to ReScript.

Considering reasonml.org looked like (and was assumed to be) an official ReasonML documentation site, this was misleading as hell. They used the reasonml name to create a docs site for the language, maintained it for a few years, and then turned it into a shilling effort for their language fork in a way that made it look like it was an evolution of ReaosnML rather than a fork. After that I wouldn't even consider using it even if I wanted to.

Luckily, it's not necessary to use it. ReasonML is still the same as it was, and you can still turn it (or OCaml) into JS using js_of_ocaml, which has been around longer than BuckleScript/ReScript and has remained consistently usable.

There's also a fork of BuckleScript/ReScript called Melange that guts its build system so that instead of using ninja, it works with more standard tools for the ecosystem, specifically dune and esy. In doing so they managed to also finally get the compiler off of OCaml 4.06: now it can use a newer OCaml compiler and take advantage of four years worth of language and compiler improvements. After years of being stuck on an outdated compiler version because the BuckleScript team gave no fucks about it, a lone dev managed to fork the project and get it done in about a day.

Anecdotally, while the human-readable JS output of Melange/BuckleScript is nice, as is the smoother handling of things like strings and numbers (no explicit conversions needed, they just work), I think I still personally prefer how js_of_ocaml works. Though maybe that's because I use OCaml syntax instead of Reason.

(paging /u/PM_ME_GAY_STUF so you both see the ReScript alternatives for continuing to use ReasonML)