ML for the Working Programmer - L. C. Paulson

Ah. That joke never gets old! Despite buying this book in my first year of undergrad, to accompany Paulson's introductory ML course, I never actually read it properly until this year, a full decade later! While it does introduce you to ML, it also covers a whole other bunch of stuff which I wouldn't really have appreciated in the first year. The early part of the book introduces ML, and also covers simple data structures and complexity issues, but the tail of the book is where it really shines, implementing both a lambda calculus interpreter, and a simple theorem prover. As a side effect of this, it provides a basic introduction to these subjects which we ended up stuyding in the second year. So, it always had some depth beyond what I realised!

As you might expect, it is quite academic in style, but it's also wide-ranging and provides some decent hints on programming style, which are quite useful in the real world. I feel the weak point of the book is the discussion of ML's signature and functor system. This isn't really so much a weakness of the book as it is of the language. If it's so difficult to explain, it's normally a sign that the feature is misdesigned! Give me Haskell's modules and type classes any day.

Another strange and poorly-explained aspect is ML's treatment of polymorphic references and syntactic values. Again, it feels artificial. The restriction on typing reference values feels like it should be some co-variant/contra-variant typing thing instead, but perhaps this just doesn't work for type inference? I should probably go re-read Pierce!

Finally, reading this book is quite an interesting flash-back. There is one fairly contrived example of emitting HTML, and that's about as far as the internet goes. It gives references to a few interesting-looking papers on unification, which made me vaguely nostalgic when I found they're not on the web (*). Oh, research is so much easier and more pleasant nowadays!

(*) Ok, some were available behind the ACM's pay-wall, but that doesn't count. I'll save the rant for another day.

Posted 2008-08-09.