Remix.run Logo
nine_k 7 months ago

Fortunately, the OCaml compiler is very modular, and there have been efforts to make things more... reasonable.

- Reason, a different syntactic frontend for regular OCaml: https://reasonml.github.io/

- ReScript, a language with OCaml semantics that compiles into: JS https://rescript-lang.org/ (I suppose it's a reincarnation of js-of-ocaml).

jey 7 months ago | parent | next [-]

ReScript is better described as a descendant (and fork) of ReasonML aimed to fit into the JS ecosystem. In contrast to js_of_ocaml, ReScript prioritizes interoperability with existing JS code and APIs over interop with existing OCaml code, whereas js_of_ocaml takes the opposite approach. So people looking for an improved version of JavaScript or TypeScript should probably choose ReScript, but people who are porting an existing OCaml program might prefer js_of_ocaml.

davesnx 7 months ago | parent [-]

There are a few missleadings in your message:

ReScript isnt a fork of Reason, jsoo focuses only on compiling all OCaml and allows JS interop

Reason with Melange is a viable option for JS/TS devs.

obeavs 7 months ago | parent | prev | next [-]

Worth nothing that the former lead dev of ReScript left to create a WASM-first language call Moonbit (https://www.moonbitlang.com/). The language design is awesome and corrects a lot of the corners that they just couldn't get around in OCAML. A touch early, but really well done.

tharmas 7 months ago | parent | next [-]

Thanks, I didnt know about Moonbitlang.

yawaramin 7 months ago | parent | prev [-]

Worth noting*

Not nothing ;-)

JoelJacobson 7 months ago | parent | prev | next [-]

I love the idea of Reason/ReScript. I hope they can figure out a way to work together and join forces somehow, the contributions to both repos seems to have faded over the last years, but maybe that's because the projects have stabilized, I don't know.

I've had lots of fun playing with Reason a few years ago. I created an interactive real-time visualization tool, to see a Regexp transform into a NFA to DFA to minimal DFA graph: http://compiler.org/reason-re-nfa/src/index.html It only works for basic regexes though.

danielstocks 7 months ago | parent | next [-]

I can’t speak for Reason but the ReScript project and community is very alive and vibrant. There’s been some major improvements over the past year and overall it’s much more appealing and mature now compared with only a few years ago. We’ve been using it in a fairly large React app for a while and the experience has been very good.

chrischen 7 months ago | parent | prev [-]

The ReasonML workflow continued on as Melange.

https://melange.re

BrawnyBadger53 7 months ago | parent | prev | next [-]

I feel like ReasonML should have the capacity to help bridge the gap for people learning ocaml if it weren't so hidden.

Taikonerd 7 months ago | parent [-]

I wish they would update their blog![0] The last post is from Aug. 2018, which definitely gives the impression that the project is dead.

But it's not dead, if you look at their GitHub.[1]

[0] https://reasonml.github.io/blog/

[1] https://github.com/reasonml/reason

davesnx 7 months ago | parent [-]

Shame on me; I have a few draft posts that never got the chance to publish. My non-native english doesn't fully help ^^

Expect some of them to be published at the end of the year or early january!

Taikonerd 7 months ago | parent [-]

Glad to hear it!

RandomThoughts3 7 months ago | parent | prev [-]

It's not more reasonable. It explicitely designed to look like JS which is, well, bad. Some of the choices are extremely annoying and overall useless like reintroducing parentheses for function arguments.

There is a reason - pun intended - it didn't take off at all with the community.

nsonha 7 months ago | parent [-]

I recommend Fabble and F#, a language that went the correct course of programming evolution, from braces to indent, instead of the other way around :)