Status and maturity of ReasonML


#1

I currently teach our univ 3rd year students FP using an F#/FABLE/elmish/electron toolchain. The idea is show them the merits of declarative programming plus strong typing, but with this allow fun web UI style project work. So they learn a pure subset of the FP language and then work with nearly pure web code. I’d love to do this using OCamL / reasonML (or whatever it is called) / some MVU skeleton / electron. OCaml is a better fit for what I want to teach than is F#, and is better tech. But, for teaching, I need stuff to be working quite well without too many rough edges. Where is the “ocaml on the web” project vs the “F# on the web project” now do people think?

F#/FABLE seems incredibly complex, and is very slow to compile, but it does all work and has lots of infrastructure.

From my POV OCaML is the best of the sweet spot Hindley-Milner mostly FP languages, and perfectly suited for teaching, just it does not quite have all that is needed now…

Best wishes, Tom


#2

So to be clear, which syntax do you want your students to use?
ReScript (the OCaml/ReasonML/ReScript-to-JS-compiler) has three now, as we are currently in a transition phase to make ReScript (previously called BuckleScript) own the whole toolchain.

In the future, the ReScript-Syntax will be the best supported one, but for now, only OCaml and ReasonML syntax are really mature.

And by mature I mean there are hundreds of industrial users using it in production already (and most of them being very satisfied with it). ReasonML will soonish have a version 4 too, but ReScript probably won’t officially support that anymore. ReasonML V4 will be mainly used for native development.

Other than that, I agree that you will possibly get a very nice plug-and-play environment. Users only need to have npm installed to be able to init a web or node project and the compiler is fast to enable short feedback loops.

btw: I meant you should post a new thread not here on reason.chat but in the new rescript forum on https://forum.rescript-lang.org/, because there the compiler team themselves can answer your question. This forum is intended for syntactical ReasonML questions, as well as native development since the BuckleScript-to-ReScript rebranding.


#3

Sorry for the thread issue. I will repost there. I’d rather they learn OCamL syntax, personally, given that they do not have previous JS expertise, however I don’t think syntax is a big deal, whereas semantics and interop obviously are. For my use case I’d not having them doing any JS coding, but they would need JS interop to do anything with web-based infrastructure.


#4

I really recommend you OCaml. Reason is in a uncertain state and rescript is not mature yet. Also ocaml is a much better syntax IMO and it’s the only one supported by all the compilers : rescript, js-of-ocaml and the ocaml compiler itself


#5

That’s a bit opinionated :slight_smile: I happen to like OCaml syntax, but I’ve met people who think Reason is a big improvement.

Also, tomcl is teaching MVU, and OCaml doesn’t support JSX. Sure, not a showstopper, but I’d argue JSX is more readable than the Elm views and totally more readable than Elmish.

But speaking of JSX, you’re right, it does look like Reason is in an uncertain state even though the Revery development seems active enough. (Keeping my fingers crossed.)


#6

Have to disagree with some points here.

  • Reason is not in an uncertain state. ReScript is not mature yet but that does not reflect on Reason, which is mature.
  • All three mentioned compilers support Reason syntax either through ReScript or through Dune. Since these are the two de facto dominant build tools today in the OCaml ecosystem, Reason is supported everywhere.

#7

I wanted to say the same thing. We are using ReasonML in three bigger projects in production now and it works quite well for us. (and the projects are 100 % Reason, no TS).

And the ReScript team does not want to break anyone, so I am sure it will stay that way for a long time.


#8

I recommend Elm.

It is designed with beginners and learning in mind:

  • clean syntax
  • friendly compiler error messages
  • one way to do most things
  • thoughtful APIs with gradual learning (check out elm/browser sandbox, element, document, and application)

MVU originates naturally from The Elm Architecture.


#9

I have used ReasonML for teaching purpose at University of Lille (France) for 3 years.
It was really pleasant cause half of training were in Javascript and half in ReasonML. And I can gradualy introduce strong typing and ML.
Sadly the situation caused by rescript lang creation make ReasonML future too uncertain (in a teaching point of view).

I switched back my courses in OCaml with jsoo this year.
I agree that elm architecture is a good way to introduce front end dev and i use ocaml-vdom for training.
You can still use ReasonReact with OCaml compiled with rescript if you want to train react.
You can use JSX with tyxml jsx ppx https://github.com/ocaml/ocaml/pull/8820