Awesome resources!
On a side note have you tried the Rescript [0] or Reason [1] programming languages? They both are based on OCaml and compile to JavaScript.
The design of OCaml/Reason is the sweet spot of functional programming for me but every time I must deal with Dune after working with the tooling of Go or Rust I want to stab myself in the face repeatedly and I think that maybe that might just be related to the general concept of "masses" + OCaml.
I haven't spent enough time with dune to form an opinion (go and cargo are absolutely marvelous though) but a quick search[0] reveals that dune is not the only option.
Dune is a great "window" in my experience with OCaml, it forces you to do more than with every other language but you end up with a better understanding of everything.
Totally unrelated to the link/book, but sparked a question that I've had for a while (curious to hear any answers) --> when you take an initial look at a programming language that you're completely unfamiliar with, and you glance through the syntax of all the basic constructs, do you ever have a particularly strong reaction (be it negative or positive), and if so have you tried to identify why that might be the case?
1 - At a high level, I ask myself if the language is pushing me towards the pit of success or the put of failure. More concretely I ask myself "given the class of problems appropriate for this language, are good abstractions easier to create than bad abstractions?". If so, I have a positive reaction. If the reverse is true, and it's easier to make bad abstractions (think early Java where functions were not first class), then I have a negative reaction.
2 - If the language is trying to sell you on a certain paradigm? If so, is there a good escape hatch? This at least means a good FFI like that found in Erlang, but also within the language, OCaml's refs which allow you to write imperative code are a great example. Elm is a language that does this badly, 0.19 removed FFIs and the language is much reduced for it.
3. Is packaging a first class consideration of the language? This is one of the places where say, Rust shines and Python really suffers. I'm going to need packages and if managing them is hard I'm going to get mad.
4. Does the language free me from some class of problems? Big positive.
Some languages I've liked: Common Lisp, C, OCaml, Haskell, Python2, Javascript ES5, Racket, Erlang
Some languages I've disliked: Java5 and earlier, C++, Go, Python3, PHP circa 1999
such a good question! I don't think I've ever had a particularly strong guttural reaction to a language, but I'm definitively biased and either see things that I quite like or dislike in a new language I see.
As I think about why those are I think one of the biggest reasons is familiarity, it's easy to get comfortable doing one thing and it truly sucks to feel like you don't know anything again (I think somebody called this the curse of knowledge? Idk).
Lately I've been intentionally the unknown, or, those languages that I'd look at and be like, "but why!?", for example, why would I want to learn or only use recursion when a for/while has worked for pretty much my whole career? or, following the same functional languages traits, why immutable data? seems like a step backwards?
But the thing is that people, quite likely smarter than me, or at least, a lot more familiar with challenges that I'm not familiar with, came up with solutions that diverge from what I know... and I want to know why! Why they came with immutable data or recursion or a language that pretty much everything is a list (LISP)... and the answers are quite surprising and at the same time I feel that joy of discovery that has almost been erased by years in the industry.
So when you come across a language that you have strong feelings/opinions about, wearing the shoes of the people using it might be quite enlightening and enjoyable.
While I say this, I'm a complete hypocrite because I won't give such courtesy to OOP... but hey, none of us are perfect ;-)
Easy to answer for me personally. I don't specifically care about the syntax family of the language, but I found Haskell (and functional Scala) to be pretty much unreadable. I have no problems with Lisp dialects or ML, or C-family or a lot of others... but Haskell with its heavy use of symbols instead of words... nope. I seem to need a certain 'instant hook' from which I can learn. If there are only symbols it won't work. Maybe that's also why I always found reading and writing math much harder than grasping the concepts. (I studied Computer Science, not real Math ;))
I had this very experience today! I was looking at some code for markdown parsers (I'm trying to build one in Hare), and I stumbled upon a Nim example. I don't know what it was, but just seeing how complex the author made what seemed like a simple struct to me filled me with dread. I'm sure if I took the time to understand the language it would make sense, but Nim is just one of those languages you need a second glance to understand if you're not already familiar with it.
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.
i learned out of the unpublished french ora book "developing applications with ocaml". (incidentally it was so useful i had a copy shop bind me a custom "book")
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.
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.
I, for one, have the attention span and knowledge organization skills of a Phineas-Gaged goldfish, so it's good to be externally reminded of the existence of good things from time to time.
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.
One of the early programming classes I took in grad school (taught at Harvard) was focused on OCaml. It was a wild jump but gave me a newfound respect for functional languages.
Come to think of it though, I’m convinced the class was sponsored by Jane Street or something.
[+] [-] mirekrusin|3 years ago|reply
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
[+] [-] seanstrom|3 years ago|reply
[0] https://rescript-lang.org/ [1] https://reasonml.github.io/
[+] [-] pkilgore|3 years ago|reply
[+] [-] _benj|3 years ago|reply
[0] <https://github.com/ocaml-community/awesome-ocaml#package-man...>
[+] [-] rashkov|3 years ago|reply
[+] [-] LAC-Tech|3 years ago|reply
[+] [-] Zababa|3 years ago|reply
[+] [-] clpm4j|3 years ago|reply
[+] [-] Hermitian909|3 years ago|reply
2 - If the language is trying to sell you on a certain paradigm? If so, is there a good escape hatch? This at least means a good FFI like that found in Erlang, but also within the language, OCaml's refs which allow you to write imperative code are a great example. Elm is a language that does this badly, 0.19 removed FFIs and the language is much reduced for it.
3. Is packaging a first class consideration of the language? This is one of the places where say, Rust shines and Python really suffers. I'm going to need packages and if managing them is hard I'm going to get mad.
4. Does the language free me from some class of problems? Big positive.
Some languages I've liked: Common Lisp, C, OCaml, Haskell, Python2, Javascript ES5, Racket, Erlang
Some languages I've disliked: Java5 and earlier, C++, Go, Python3, PHP circa 1999
[+] [-] _benj|3 years ago|reply
As I think about why those are I think one of the biggest reasons is familiarity, it's easy to get comfortable doing one thing and it truly sucks to feel like you don't know anything again (I think somebody called this the curse of knowledge? Idk).
Lately I've been intentionally the unknown, or, those languages that I'd look at and be like, "but why!?", for example, why would I want to learn or only use recursion when a for/while has worked for pretty much my whole career? or, following the same functional languages traits, why immutable data? seems like a step backwards?
But the thing is that people, quite likely smarter than me, or at least, a lot more familiar with challenges that I'm not familiar with, came up with solutions that diverge from what I know... and I want to know why! Why they came with immutable data or recursion or a language that pretty much everything is a list (LISP)... and the answers are quite surprising and at the same time I feel that joy of discovery that has almost been erased by years in the industry.
So when you come across a language that you have strong feelings/opinions about, wearing the shoes of the people using it might be quite enlightening and enjoyable.
While I say this, I'm a complete hypocrite because I won't give such courtesy to OOP... but hey, none of us are perfect ;-)
[+] [-] wink|3 years ago|reply
[+] [-] Atalocke|3 years ago|reply
[+] [-] usrn|3 years ago|reply
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.
[+] [-] jolux|3 years ago|reply
[+] [-] anthk|3 years ago|reply
https://ocaml-book.com/
[+] [-] olah_1|3 years ago|reply
[+] [-] a-dub|3 years ago|reply
i learned out of the unpublished french ora book "developing applications with ocaml". (incidentally it was so useful i had a copy shop bind me a custom "book")
[+] [-] jasperry|3 years ago|reply
It's available free online as well: https://caml.inria.fr/pub/docs/oreilly-book/html/index.html
[+] [-] daenz|3 years ago|reply
[+] [-] jasperry|3 years ago|reply
[+] [-] tgflynn|3 years ago|reply
[+] [-] AceJohnny2|3 years ago|reply
This is a fantastic resource that anyone with a passing interest in the OCaml programming language needs to be aware of.
[+] [-] pjmlp|3 years ago|reply
[+] [-] throwamon|3 years ago|reply
[+] [-] akavel|3 years ago|reply
[+] [-] rashkov|3 years ago|reply
[+] [-] ufo|3 years ago|reply
[+] [-] hardwaregeek|3 years ago|reply
[+] [-] anthk|3 years ago|reply
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] iLoveOncall|3 years ago|reply
[+] [-] etaioinshrdlu|3 years ago|reply
[+] [-] colesantiago|3 years ago|reply
[+] [-] synaesthesisx|3 years ago|reply
Come to think of it though, I’m convinced the class was sponsored by Jane Street or something.
[+] [-] percent|3 years ago|reply
[+] [-] midoBB|3 years ago|reply