Hello @Luc_ML,
Great to hear that you’re not giving up on OCaml. My two cents: choosing the right book to learn OCaml really depends on your goals and background. Since you’re experienced in programming but new to OCaml, here’s a tailored breakdown of your options:
-
For learning by example: The book discussed in this thread by @backtracking (I think author of the widely used
ocaml-graphlibrary) is a solid choice. It emphasizes practical examples along with insights into data structures, making it well suited for developers who want to jump in and start coding right away. -
For a deeper dive into OCaml:
- Real World OCaml (RWO) is a classic. I agree that it uses
Coreinstead of the standard library (there are GitHub repositories that re-implement the examples using the stdlib). As you said this can be a hurdle at first, but the book covers a wide range of OCaml topics and offers many valuable insights and best practices. - OCaml Programming: Correct + Efficient + Beautiful is another strong option, with a balanced mix of theory and practice. In my view, this book focuses on teaching both OCaml and functional programming concepts. You’ll likely enjoy it if you like learning underlying ideas, not just working through examples.
- For absolute beginners (to programming): If someone is completely new to programming, the two books above might not be the best starting point. In that case, I’d recommend beginning with more beginner-friendly tutorials.
Additional OCaml resources:
- ocaml.org/books: A list of books covering various levels and also specific topics.
- OCamlverse: Useful, though not updated very frequently.
- OCaml Videos: Mostly high-level, but some are fun and informative to watch.
Here are some resources to help you with Dune, but to be honest, I haven’t found a single “perfect” tutorial or learning path, but these are still quite helpful:
- Dune Official Guide: Practical tutorials to get you started (probably you know)
- Introduction to Dune by OCamlPro: A concise blog post.
- Quickstart with Dune: A quick guide to setting up projects.
- Bootstrapping a Dune Project: Please check at the end, you have additional tools on top of dune that may suits better for you (according to your comments in other threads).
If you prefer video content, you might also like:
- Introduction to Dune (YouTube)
- Next Steps with Dune (YouTube) (a bit more for discussion on future dune framework).
Some interesting links to have in mind:
- To look for functions across libraries
- Another view to the same
- OCaml operators lookup
- odig nice tool for documentation
Hoping this can be useful. All the best.