Is it important to learn oCaml before I start learning ReasonML?


#1

Can anybody guide, can I skip learning oCaml and start writing reason code? Will learning oCaml first offer me any advantage?


#2

Hey. I think the situation here is pretty confusing for new comers. ReasonML and OCaml are ONE language with different syntax. Everything else is the same.

You can learn more about how is that possible by reading the overview about ReasonML toolchain

Now back to your question: It doesn’t matter which syntax you want to learn, once you get the semantic, you can write in both syntax very easily.

Learning resources here: https://reasonml.github.io/docs/en/articles-and-videos.html#ocaml-concepts

And make sure to check the homepage of the language , it has basic syntax and tutorial


#3

Does it mean I can choose between both the syntaxes? Or in other words:
Will the build/compile system for reasonML consume both oCaml and reasonML without complaining?


#4

Yep. You can mix OCaml and ReasonML in the same project without problem. You can also convert ReasonML <—> OCaml automatically without losing any semantics meanings (except for comment sometimes)


#5

In addition to the good points from @thangngoc89, you can use OCaml/Bucklescript APIs in Reason. Good examples are functions for converting between types like int_of_float and string_of_float. They are OCaml functions that follow the OCaml syntax conventions but are available in Reason. So checking the docs for Bucklescript and OCaml can be helpful sometimes.