views:

483

answers:

8
+4  Q: 

OCaml resources?

Hello,

I need to learn this language for my thesis so I was wondering which good resources are available like books or free tutorials?

Is there any "bible" reference book that I should consider?

Ok, I can search over google but I think that having feedback about resources works better if it's directly from ocaml programmers..

+13  A: 

The manual (exhaustive reference) - http://caml.inria.fr/pub/docs/manual-ocaml/

A good tutorial site, very thorough - http://www.ocaml-tutorial.org/

A bunch of code examples - http://www.ffconsultancy.com/ocaml/

A good book that explains all the basics in detail (if you prefer books, which for OCaml I don't so much) - http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html

An indispensable tool for building OCaml projects (if you have more than one source file, or are making use of interfaces) - http://nicolaspouillard.fr/ocamlbuild/ocamlbuild-user-guide.html

danben
A: 

This is a book I have heard of : http://en.wikipedia.org/wiki/The_Art_of_the_Metaobject_Protocol

You could find some resources in this blog : http://lambda-the-ultimate.org/

blispr
The Art of the Metaobject Protocol uses Common Lisp's CLOS as it's language. It's not really related to OCaml.
chollida
+5  A: 

You can try http://ocaml-tutorial.org/, it's useful. Always keep a copy of the ocaml API reference open.

Choose one of the extension libraries, because OCaml needs more libraries. You probably want ocaml batteries included, though there is also extlib and Jane Street's ocaml-core. Keep the relevant API reference open at all times.

David Crawshaw
A: 

Chailloux's book is pretty nice: http://caml.inria.fr/pub/docs/oreilly-book/index.html

Of course, the manual is fine as well: http://caml.inria.fr/pub/docs/manual-ocaml/

If you have questions, there's an OCaml mailing list at the INRIA as well.

Victor Nicollet
A: 

If you have previous programming experience I can recommend Practical Ocaml.

Atleast for me it's easier learning a new language in a practical way and skip the usual "Hello World"-Stuff.

daddz
What's wrong with my answer?
daddz
Practical OCaml is the first book I ever threw away. I wish I had read the amazon reviews before buying it.
David Crawshaw
Unfortunately, Practical OCaml is well-known in the community as the worst existing book on OCaml. Incomplete, riddled with typos and general errors.
Yoric
If you wonder what s wrong with your suggestion, then I suggest you look at the review scores here: http://www.amazon.com/Practical-OCaml-Joshua-B-Smith/dp/159059620X/
chollida
+2  A: 

If you like to learn by studying examples, John Harisson's Handbook of Practical Logic and Automated Reasoning is nice, and surprising readable and fun at times.

If you speak French, Le Langage Caml is a good starting point.

If you just want a tutorial concentrating on language features, perhaps try Jason Hickey's book.

namin
+4  A: 

Depending on your field of interest, you may be interested by the following books:

  • OCaml For Scientists, by Jon Harrop (very good introduction, but mostly targeted for numeric analysis, 3d construction, etc. -- and quite expensive)
  • Real-World Haskell (not on OCaml, but the best introduction I've seen on functional programming)
  • the French language OCaml wikibook.

I also second the suggestion of installing OCaml Batteries Included. Caveat: I'm one of the authors.

In addition, of course, to the various mailing-lists laying around the net.

Yoric
+6  A: 

I learned the basics of OCaml using the excellent tutorial written by Jason Hickey. It expects you to know how to program.

It is succinct but provide a good coverage for a first contact.

JFT
Are you sure you should be providing that link? The pdf has "DRAFT. DO NOT REDISTRIBUTE." on every single page.
TwentyMiles
@TwentyMiles: The book author links to the same pdf (hosted elsewhere) from his site (http://main.metaprl.org/jyh/publications.html). It appears to be permitted from what I can tell.
Jonathan Sampson
@TwentyMiles I didn't provide a copy but a link to the "public" version of the document...
JFT