Live data from Hacker News

Real World OCaml – 2nd Edition (2021)

dev.realworldocaml.org

11–20 of 82 posts

Re: Real World OCaml – 2nd Edition (2021)

#11
post #7
post #4

I'm not a huge fan of this book, if I get a book like this I'd expect it to focus on the standard library and not third party libraries. On the other hand it says "real world" OCaml and as far as I can tell that really is how OCaml used so It's hard to blame the author.

The standard library is quite small and not very usable for modern production applications. As an example a lot of the list manipulation functions are not tail-recursive because the tail-recursive implementation is less elegant.

For the pedagogical purposes of the book, you don't really need Jane Street Base/Core though. Plus it ignores some pretty widespread community libraries (like Lwt) and pushes its own Jane Street version, Async (which incidentally doesn't support Windows).

Anyway, this has all been hashed out before.

Re: Real World OCaml – 2nd Edition (2021)

#13
I don't know about everybody else, but I don't find the "list of language features" format that helpful. It's quite dry and it doesn't contextualize how people use these features or what patterns are common. The Guided Tour part at the beginning is the best part IMO. I wish that'd be the entire book. Just a long guided tour of OCaml through the lens of an in depth project, say an interpreter of an ML language.

Re: Real World OCaml – 2nd Edition (2021)

#14
I'm sure this book is an excellent resource (upon skimming the online version, it looks very thorough and well thought out). I think there is some confusion about who "the masses" are though. I don't think a subchapter titled "POLYMORPHIC VARIANT SUBTYPING" is necessarily for—what I consider—"the masses."

Re: Real World OCaml – 2nd Edition (2021)

#15
post #3

I'm a bit surprised to see this making it to the front page. It's been available for a long time and is one of the first resources anyone with an interest in OCaml is likely to encounter. It seems a little like posting a link to cppreference.com.

Even just "The lucky 10 000" can be already a reason good enough (https://xkcd.com/1053/)!

Re: Real World OCaml – 2nd Edition (2021)

#16

I don't know about everybody else, but I don't find the "list of language features" format that helpful. It's quite dry and it doesn't contextualize how people use these features or what patterns are common. The Guided Tour part at the beginning is the best part IMO. I wish that'd be the entire book. Just a long guided tour of OCaml through the lens of an in depth project, say an interpreter of an ML language.

https://ocaml.org/about

Re: Real World OCaml – 2nd Edition (2021)

#19
This is great live/github based book.

Other great resources are Michael R. Clarkson's (from Cornell) videos [0] and book-like format [1].

I took a lot of inspiration from it when playing with rb-trees [2] and functional, ocaml-looking typescript in general [3].

[0] https://www.youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b...

[1] https://cs3110.github.io/textbook/cover.html

[2] https://github.com/preludejs/rb-tree

[3] https://github.com/preludejs

Re: Real World OCaml – 2nd Edition (2021)

#20
post #14

I'm sure this book is an excellent resource (upon skimming the online version, it looks very thorough and well thought out). I think there is some confusion about who "the masses" are though. I don't think a subchapter titled "POLYMORPHIC VARIANT SUBTYPING" is necessarily for—what I consider—"the masses."

I don't necessarily begrudge the authors for including chapters on advanced topics, it's not like people have to read the whole book. But you raise a valid point. For languages like OCaml that are both large and also veer into PL research territory, some guidance about how many of the advanced topics one needs to understand to be a "real world" programmer could be a big help to the language's adoption.
Post reply on HN