I ordered this book pretty much immediately after hearing about it – There have been a number of bad reviews of it, but I think they’re pretty unfair.
It’s definitely not an introductory book on functional programming or even an introduction to OCAML itself – it tries to do pretty much what the title says, which is attempt some down and dirty real-world programming in the language. As far as I know , there are only two books on OCAML ( the other being Objective CAML for Scientists – so credit where credit’s due.
People doing this are also doing these things:
Entries
http://www.cs.man.ac.uk/~david/categories/book/book.pdf
the pattern matching in ML and prolog are just lovely i think
I installed OCaml on my Mac and did the first two lessons in the online OCaml Tutorial which does not start with heavy theory. I have mixed feelings about that approach (since I really want to have a solid theoretical knowledge of the new language concepts), but so far it’s OK.
Though I’m focusing more on Ruby, Python, and Haskell, I’ve taken the time to find and queue up some reading for OCam. I found a good introduction to OCaml at http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf (which is used for a CS course at CalTech apparently). I’ve read through the first chapter which introduces OCaml as an ML variant and particularly the qualities of a pseudo-functional language. It’s not too foreign from what I’ve been learning about Haskell. I’m particularly interested in the object-oriented aspects of OCaml, as I’m definitely a fan of object orientation, though it may prove itself to be a far better experience with functions rather than objects. We’ll see.
Good stuff so far!
M.T.
While O’Caml is gret fun, it’s hard to use it as a real-world language. I know it can be done; I just have problems doing it. Since I know PHP, Java and Rails and have a huge workload I’m probably never going to get around to learning O’Caml—I give up!
It turns out that Ocaml is a fairly simple language to learn. Very few keywords (let, type, match and function being the main ones) and the standard assortment of data structures (list, array, tuple, record). I think the best quick introduction to the language is Ocaml For Scientist Chapter 1 combined with Ocaml for Experienced Programmers. Overall I was impressed with Ocaml. Although it sells itself as a functional programming language, the language does have imperative constructs (when you absolutely positively need a for loop). It also has a good number of libraries available online (Ocaml can also use CPAN, yes CPAN! as in perl. Perl4Caml. I haven’t tried it though YMMV). Between Haskell and Ocaml, Haskell definitely felt like the more challenging of the two languages to learn. I would still start with Haskell if I did it over again. But definitely learn both languages!
Tried to learn this back in 2000-2001 but didn’t get very far. Ocaml has a lot of similarities to Haskell. The learning resources available on the web are better now (http://www.ocaml-tutorial.org is excellent). I also spent time looking at the ocaml website and the OReilly Ocaml book (available on line, google for it!) Conceptually similar, both are strong statically typed functional programming languages. I actually prefer the Ocaml syntax after mucking with it for awhile. Haskell has this idea of a layout which makes the program sensitive to indentation ala Python. It’s not so bad once you get used to it but I got bit by it when I started out with Haskell. Ocaml appears to be a more pragmatic, working language (it has imperative features, better libraries) where Haskell tends to be more academic (though Pugs and Darcs are written in Haskell). It’s worthwhile to learn both languages as each bends and twists your mind in different ways.
Today I’ve worked through the first two chapters of http://www.ocaml-tutorial.org/
For now I’m really impressed esp. with the quality of this tutorial. It’s logically structured and also helps people who come from procedural and object oriented languages like C or Java with enough references to understand the (at least for me unusual) functional concepts behind Objective CAML.
Let’s see what tomorrow might bring :-)






