Wednesday, January 23, 2013

Compilers Self-Study

Learning about Compilers

This is a self-study curriculum I intend to follow to teach myself about compilers in my spare time. It is the union of a few different curricula I have been find through various sources online, such as MIT's OpenCourseWare.


I am basing my introductory studies on the classic so-called "Dragon" and "Tiger" books, respectively:
Subsequent advanced studies may include:


Once oriented to the course material I plan to start a compiler project, written in C++. I would like to write a C compiler for the ARM1176JZFS architecture, which is part  of the Broadcom BCM2835 SoC, the chip inside of the awesome Raspberry Pi pocket computer. The point of this compiler is not to compete with the gcc or clang/llvm but rather to learn the way a compiler works by building one.


On a high level compilers are divided into two halves, one called the front end and the other the back end. The front end is responsible for parsing the input program, building a syntax tree, and generating an intermediate representation output. The back end takes the intermediate representation, applies machine-independent and then machine-dependent optimizations, and generates the output binary. I will work front to back.

Front End, January to April 2013

  • Study Dragon book (Aho et al) chapters 1-6
  • Study Tiger book (Appel) chapters 1-7
  • Study EACV2 (Cooper, Torczon) chapters 1-5
  • Write high-level design document for project compiler
  • Write detailed design document for project compiler front end
  • Implement compiler front end to translate input C to output intermediate bytecode

Back End and Intro to Optimization, April to October 2013

  • Study Dragon book chapters 7-12
  • Study Tiger book chapters 8-12
  • Study EACV2 chapters 6-12
  • Write detailed design document for project compiler back end
  • Implement compiler back end to translate input intermediate bytecode to output ARM assembler
  • Add some basic/simple optimizations to project compiler

Advanced Compiler Topics, October 2013 Onward

  • Study remaining bibliography
  • Further work on optimization in project compiler back end
  • Possibly contribute to LLVM or V8 projects
  • Other work, details TBD

Tuesday, January 22, 2013

Anonymous Pro

A friend at work, +Joey Parrish, recommended a font specifically for programmers. It's called Anonymous Pro, it lives here, it's licensed under the SIL Open Font License, and it renders beautifully and legibly at teeny tiny point sizes. I'd never thought of the idea of a programmer-specific font before, to me it's one of those "obvious once it's explained to you" ideas. Neato!

Statement of Purpose

I think for a long time I've had a kind of magical thinking surrounding the engineers that I admire, like +Linus Torvalds or +Guido van Rossum. I attributed their success and general awesomeness to some sort of difference in their character or genetic makeup from me. Only recently have I started to realize that perhaps they were not born the great engineers that they have become, but rather they became great over a long time of working very hard on topics of interest to them within our field. They earned their credentials, admiration, and expertise. I would like to do the same.

I'm out of school and really have no interest in returning. My education is my responsibility now, in fact it always was, even when I was in school, I just didn't realize it then. I am making new educational goals for myself which have little bearing on advancement in academy and are entirely for the purpose of bettering myself as an engineer and as a person in general.

I would like to use this blog to help hold myself accountable to these goals, to share what I have learned, and to start a dialogue with like-minded professionals in my various areas of interest for the betterment of all. I hope to have a lot of fun doing this work, and I put myself into everything I do, so you may see the occasional off-topic post on matters related to my personal life or outside interests such as blacksmithing, motorcycles, life in the San Francisco Bay Area, etc.

Feel free to drop by anytime and say hello. Thanks for reading.