Where to start learning ReScript?

Would it be better to learn OCaml first then dive head first into ReScript? Or are there enough ReasonML resources to learn that first and then just see what’s different between ReScript and ReasonML?
I’ve got some FP under my belt with Scala(almost everything except implicits) and Elixir, but when I tried to learn ReasonML I kinda stumbled when I hit functors.

1 Like

For advanced concepts, at this point it is probably still sensible to learn with OCaml resources (manual, Real World OCaml. CS3110).

For ReasonML, @yawaramin’s book “Type-Driven Development” has a chapter about functors.
Also, there is a functor chapter in “Exploring ReasonML” by Axel Rauschmayer.

Last but not least, there is a very brief mention of functors in the docs.

1 Like

No because most advanced concepts shouldn’t be needed in ReScript to build your typical webapps.

Start with your common JS workflow as you are used to and add bs-platform as your dependency, or use a ReScript boilerplate like the rescript-nextjs-template.

Use the rescript-lang website to learn about the differences between JS and ReScript, and also how to use the interop layer properly… and I am pretty certain you’ll spare yourself some time (un-)learning advanced concepts for quite a long time.

Some Reason / React resources might still be valid to learn from, as long as they are BuckleScript / JS focused. Unfortunately our React docs are still in Reason syntax (this will hopefully be switched to ReScript syntax soon).

2 Likes

I agree.

To add to that, with functors just as an example for advanced concepts in general:

Functors are needed when we want to implement the same signature multiple times and use more than one of the implementations in the same run of a program (Benjamin Pierce).

This is out of an old presentation, which was mentioned in the OCaml forums.

Generally, you would only use Functors when writing libraries, and even then it is not really required to use them.

I write ReasonML/ReScript (React and React-Native) apps since 2018 and never needed to write a Functor (only used them, like Set.Make). Sometimes, I used first-class modules, though.

1 Like

Thanks a lot for the clear answers! I like that I can start with ReScript sooner than I thought.

1 Like

Have the situation changed in the last year or so

Is there a new book, a book in progress, was any changes made to the documentation to target new comers to ReScript

3 Likes