Getting started with F# : read a book!

November 11th, 2008

Recently, a colleague here at Lab49 asked whether there were any good books available to help getting developers unfamiliar with F# and functional programming started in the world of functional .NET. I had some ideas and thought I’d post them here.

(In his post below, Sergey mentioned that Luke Hoban, the F# product manager, gave a talk at the Lab on F#. We recorded that presentation and I’ll be posting it soon, so stay tuned.)

The question was if there was a good book for “a typical Java developer to learn F#”. The short answer is that there isn’t. F# is a pretty flying leap for a typical Java developer to make; you can approach F# from the .NET world (e.g. C#) or from other functional languages (e.g. its parent, OCaml), but it’s hard to see how one could do it from neither. That said, I know of three F#-focused books in print now that can serve as a guide:

-”Expert F#“, by F#’s creator Don Syme. This is the book I recommend. It’s not perfect but it’s a good introduction to F#, mostly suited for people coming from a .NET background. It’s very dense. It’s not for novice programmers, and assumes a good deal of expert general programming knowledge on the part of the reader. But it’s definitely the best out there. (It’s also a bit out of date since the release of the September 1.9.6.2 CTP, but still mostly relevant. I expect it will eventually get updated.)

-”Foundations of F#” by Robert Pickering. This one is simpler and more basic than the above, and might be useful for just getting started. It isn’t as illuminating as the above and won’t serve as a full guide on its own. If you’re ready to deep dive, go straight to Don Syme and pass this one by.

-”F# for Scientists.” This one is for scientists.

“Expert F#” is the best bet for really tackling this language.

Keep in mind that if you really want to get serious with F# as a platform you’ll eventually need to understand the .NET Framework and the CLR (for which the best book remains “CLR via C#” by Jeffrey Richter).

There are a couple of other books coming out that I’m looking forward to seeing. One, by Chris Smith, promises to be great and is slated for release next year (and has a truly bizarre image occupying its placeholder cover). Also check out Chris’s series on his blog solving Project Euler problems with F#, which show off some of F#’s core functionality and can be a nice intro to approaching problems in a functional way. Another, “Real-world Functional Programming in .NET” by Tomas Petricek, who used to work on the F# team, will deal with FP approaches in both .NET and C# (using LINQ).

Some other F# resources are:
Hubfs.com, where the minds behind F# monitor the boards and answer tough questions, and
Flying Frog Consultancy, who have done a lot of cool work with F#.

My advice: download the CTP, buy the Don Syme book, and have some functional fun.

One Response to “Getting started with F# : read a book!”

  1. Joe Morrison Says:

    The colleague in question was me, so many thanks for posting this summary.