So You Want to Be a (Compiler) Wizard

A month or so ago, @__biancat (whose username I can’t help but read as “Bian-cat” even though it’s probably “Bianca T.”) suggested I write up some ideas for getting into compilers and programming languages.

It turns out I’m happy to expound on this, and it doesn’t need a formal CS education either.1 Unfortunately, pretty much all of them require some amount of free time. I’ll come back to that at the end of the post.

Recommendations

A few weeks ago I asked people a question on Twitter:

I got many interesting responses, but one of them asked if I had any recommendations for books on compilers.

Oh gosh. Books? Books about computer science? I’m actually not very well-read: while I’ve been programming since I was a kid, I “only” have an undergraduate formal education. That means the set of books I’ve read about CS is rather haphazard. But I suppose I do have a few things that come to mind.

Nibblesort: Adventures in Optimization

A few months ago compiler researcher John Regehr held a low-level optimization contest for a silly problem: sort the nibbles in an arbitrary 64-bit number:

The problem is to sort the 4-bit pieces of a 64-bit word with (unsigned) smaller values towards the small end of the word. The nibble sort of 0xbadbeef is 0xfeedbba000000000. The function you implement will perform this sorting operation on a buffer of 1024 64-bit integers.