Hacker News new | comments | show | ask | jobs | submit login
ML for the Working Programmer, 2nd Edition (1996) (cam.ac.uk)
266 points by odammit 5 months ago | hide | past | web | favorite | 35 comments

ML for the Working Programmer is my favorite programming book! It's fantastic because it is serious and goes into great detail about practical matters in working with SML. Its treatment of SML's module system is without match. It contains generally useful chapters on the implementation of streams, persistent functional data structures, parsers, and proof systems. My favorite thing about the book is its emphasis on designing correct programs. And the cover's pretty cool.

Note that this is about the ML programming language, and not Machine Learning. It's been really annoying to tell the two apart in headlines lately, and I'm glad that "Machine Learning" is falling out of marketing favour so I have a higher chance of finding ML (the language) things.

Huh? If anything, the acronym for ML acronym for machine learning has become further entranched and ML the language gets virtually no coverage these days, even the FP people are more likely to talk about how to do ML in Haskell...

Search for ML in the monthly job postings. Guess how many mean machine learning and how many refer to the programming language :).

I assume the OP is saying that people are starting to use the term "deep learning" (or other terminology?) instead of "machine learning" in marketing.

Deep learning is still often abbreviated ML...just because DL hasn't really caught on.

Yeah I know. That's exactly what bothers me.

I want whatever boondaburrah's been smoking.

Me too, man. Me too.

Your commented reminded me of when a coworker asked me to rename an algebraic data types generator from "ADTgen" to something else, since "everybody knows ADT means 'abstract data types'" :-).

As someone of skill in both topics, I was similarly confused but my misapprehension remained for a few seconds more. As luck would have it, the first sentence my eyes alighted on was Trees and Concrete Data.

Has anyone wrote "ML in ML" yet?

I definitely parsed it as 'Machine Learning', only to be thrown off by the "1996".

Thanks for that. I thought I might actually need to click on the article :)

Yay! I love this book. I'm not sure it quite works as an introduction to functional programming, or even to SML, but it's full of thought-provoking material.

It had me hooked when I got to this part of the introduction:

"ML is not perfect. Certain pitfalls can allow a simple coding error to waste hours of a programmer’s time. The new standard library introduces incompatibilities between old and new compilers. Warnings of possible hazards appear throughout the book. They look like this:

"[skull and crossbones icon] Beware the Duke of Gloucester. O Buckingham! take heed of yonder dog. Look, when he fawns, he bites; and when he bites, his venom tooth will rankle to the death. Have not to do with him, beware of him; Sin, Death, and Hell have set their marks on him, and all their ministers attend on him.

"I hasten to add that nothing in ML can have consequences quite this dire. No fault in a program can corrupt the ML system itself. On the other hand, programmers must remember that even correct programs can do harm in the outside world."

Another fantastic resource for ML is Dan Grossman's Programming Languages course: https://courses.cs.washington.edu/courses/cse341/17sp/ Scroll down to the Course Materials and check out some of the Videos. I started watching them and couldn't stop.

Have a copy myself somewhere. Larry Paulson was a well liked lecturer. Famous for his terrible jumpers!

Standard ML always seemed like a great teaching language, but it was never clear to me how it would work for general programming. So the title 'for the working programmer' always seemed unintentionally ironic.

SML is a practical and realistic language for general programming - surprisingly so, coming to it again 20+ years after first encountering it as an incomprehensible academic oddity. The world has moved much closer to it in the meantime.

However, it doesn't have the kind of library support you expect for most practical tasks (unlike its sibling Ocaml).

Last time ML came up, PolyML was mentioned which has much more complete systems libraries (threads, sockets, etc). Looks really great, I haven't gotten around to trying it myself though.

18 years on, I remember the jumpers, and I'm still writing graph algorithms!

You'll be pleased to know he's still lecturing Foundations of Computer Science (aside from a sabbatical this year). It hasn't changed much at all, but the beauty of that course is that it doesn't have to.

A couple of years ago I picked up a used copy of Ullman's Elements of ML Programming for about $5US. I found it more accessible.

I also would recommend Ullman as a first book on SML, and this one when moving toward bigger projects. I still use Ullman as a reference because I know it covers every essential feature in the language in an elementary way.

The SML/NJ literature page has a great collection of books (and tutorials and other resources) on SML if you're interested to learn or read more about it [0].

[0] http://www.smlnj.org/doc/literature.html#books

If this looks interesting to you, you may enjoy OCaml or F#, both of which are ML variants with modern compilers and tooling available. OCaml compiles to standalone binaries, F# is a Microsoft language that compiles to .NET bytecode. I've found F# to be a joy to program in.

Also Rust and Swift and influenced by ML.

Can anyone post the first edition of this series? Would be very helpful to catch up. Thanks!

This is about the second edition of a book, i.e. an updated version, not a sequel or a second volume.

There is no particular reason to refer to the first edition now, since the second edition is the same book. The second edition brought the book (originally published in 1991) up to date for 1996, and it is in a sense still current now, because the language hasn't changed since then. The update added the SML Basis library which was just being standardised, plus better coverage of modules.

There is a small info page about the first edition here: https://www.cl.cam.ac.uk/~lp15/MLbook/first/

This book is over 20 years old, so what are some major developments since then?

This book still provides one of the best introductions to both basic ML programming, structuring big project with modules, and mechanical theorem proving.

I wish it was updated to OCaml, Scala, and maybe even Haskell.

I'd love to see a Rust and Erlang version.

Surprisingly little. Functional programming has become more mainstream, but most of the concepts have been well known and studied in academia for decades.

OCaml, F#, modern ML-based languages.

Great introduction to functional programming, and logical theorem proving.

For those getting into Rust, it was based heavily off of ML, so much of this book would aid in learning Rust concepts.

Skimmed through first 3 chapters, because who reads prefaces anyway, and kept searching for anything "Machine Learning" related. Guess we're running out of fancy acronyms.

Applications are open for YC Summer 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact