The problem is its complete and unapologetic reliance on janestreet Base/Core/Async’s API, which requires additional setup by the user, and overrides the standard library in quite an opinionated manner. It’s adding lots of complication to a beginner’s learning journey I feel.
Don’t get me wrong, this is a phenomenal book with lots of valuable information, and being developed and written mainly thanks to janestreet means they have all the right to make it lean towards janestreet libraries. Just that this makes it less of an introduction to OCaml the language. They say just as much in the book, that this is not just an introduction to the language, but the language and specifically those libraries.
So many beginner questions about the language stem from confusion around what I like to call “Core-isms”; the book introduces its reader to relatively wider parts of the language right at the beginning than basic OCaml, of those I recall global open
, named and optional arguments, first-class modules before even functors, ppx, locally abstract types vs universal quantifiers vs unification type variables, … these all have their interesting semantics that often result in repeated beginner questions.
And of course, onlookers have to be exposed right away to… beaten horses… in the community, such as “Stdlib is not adequate for general-purpose programming”, “polymorphic comparison is evil”, “exceptions vs option/result” (which also ties to the M-word), “OCaml is bad at polymorphic code because of value restriction” (so you should use modules soon and often), …
Additionally, the book really dives deep into many things about OCaml that you don’t often see in introductory text, like the runtime representation of OCaml values, the compiler frontend and backend, the compilation strategy, the garbage collector, ffi and binding, serialization, …
I think its role is better fulfilled as an intermediate book, for someone who’s already learned how OCaml works and would like to grow with it. I’d rather we rely on simpler, more self-contained introductory material for beginners.
That all said, I’d like to hear your opinions… Do you disagree? Do you see RWO as the most suitable introduction book for beginners? Also, are you familiar with other languages which have introductory material that also ties this strongly into an external ecosystem (Or is this something unique to us)?