books

Programming
Reference
Software

Books like The Elements of Computing Systems: Building a Modern Computer from First Principles

The Elements of Computing Systems: Building a Modern Computer from First Principles

2005, Noam Nisan

5/5

A good experience overall. This isn't a book you read, but one that you do. Worth looking into especially if you teach computing, or if you feel you need some refreshing as a practitioner. Basically, you build a simple computer practically from scratch, going from Nand to Tetris so to speak.The most important thing to know about the book is how approachable it is, in other words, that you can do it!. You can start working on this with no background knowledge beyond programming (use whatever your favourite language is). The authors place an emphasis, I think on (1) simplicity, (2) hands-on experience (learn by doing projects, not reading texts), and (3) incrementality [bite-sized projects you can build up on one weekend at a time]. This book would have been great for me at Uni, something much more compatible with my learning style.OK, so a bit more about the book. You get NAND gates (and DFFs which in principle can be derived from them) and build your way up up up: first some simple logic gates, and there adders and a simple ALU, then memory, and a proper CPU (all of this using a simple hardware description language and a Java simulator). Having built yourself a computer, you then write an assembler for your hard-earned machine language, and top of that a simple stack based virtual machine; and up up, a compiler for a higher level language targeting your VM and finally an “operating system”/standard library (providing simple services like drawing circles on screen).Why would you do something like this? Why, especially, if you've already been there and done that with chips, compilers, operating systems? Think a minute about your experience as university computer science student. You've done the bits and pieces. You've taken the hardware design course (CSE 371) and stared confused at the latches on the board. You've written crashy bits and pieces of an operating systems (CSE 380); and you've put together many of the parts that make a compiler (CSE 340). These were great (if sometimes frustrating), but isolated and individual experiences. You got many parts of a good CS education, but you spent so much energy trying to wrap your head around individual concepts and ideas that you failed to make it all gell, get a sense of how it all fits together.I'm very grateful for the education I got, but I always felt like I needed a bit more help understanding things. I feel now that having this Nand to Tetris course as a precursor would have helped me a lot because it would have provided a skeletal framework, and very concrete hard-won big picture, upon which I could build deeper understandings of the individual topics. This book won't replace your compilers or operating systems course — it's not the point — but will complement it either by giving you a map before your begin your CS journey, or a good chance to reflect on what you've learned, if by rights you're supposed to have learned the stuff already.I haven't figured out all the secrets to this book (the things it gets right). Some of the ingredients, are, in my opinion:* integration: mental image of fitting jigsaw puzzle pieces together * hands-on: very much chop-wood and carry water* simplicity: your ALU only does addition, negation, some simple booleans; your compiler only has to parse an LL(0) language -- depth is not the point; we just do the bare minimum of everything that could be useful* modularity: you build up one layer of abstraction and can throw it away and use the reference implementation instead* small pieces - each chapter can be done in one weekend each. That's 3 months if you're willing to dedicate a weekend a month to the book. It may take you a lot less than that (I was particularly slow)* scaffolding - the book provides all the infrastructure you need to get going: all the emulators, compilers, automated unit tests. One key thing: you even get skeleton files for each module you're supposed to write (fill in the functions). This is important. You don't want minor obstacles. You want to be able to make progress quickly.* rigidity - all the assignments have a clear success condition; you know exactly what you're aiming for* linearity - there's a constant sense of moving up, up, up the ladder of abstraction. The sense of “progress” is important* solo friendliness - group projects are great, but this is a book that works best when done as a solo activity (you need to see the whole picture; it's not enough to write pieces of systems). Good thing it emphasises the bite-sized!Some frustrations or things that could be better:* the VM emulator is a bit flaky (null pointer exceptions, sigh) {at the time of this writing; 2012-04]; this made testing a bit harder than it needed to be* chapter 9 (learning the Jack language), in contrast with the rest of the chapters, was too open-ended for me (eh, find something you want to write and write it). Frankly, not interested in writing programs in that silly little language.* chapter 12 (the OS/stdlib) was a bit of a slog (by the end of the book you just want to be done and get that damned Pong game working already). I wonder if this can be addressed by replacing the overly-open ch9 assignment with some standard library functions. This way ch9 feels like working towards something, and ch12 is not as long. It doesn't even to be presented as part of the operating system in ch9. Just sort of randomly “let's implement multiplication!”* [this is me being way excessively demanding]: the test suite supplied for the later chapter could have been more extensive, used more incremental stages. I dunno. Making the suites would have a high cost, so I'm really just being demanding here, and on the other hand, the important part of this book was making very concrete mistakes and confronting details the hard way. So maybe the sparsity of suites was not so bad, forces you to re-evaluate things.Overall the book gives you a solid framework, a safe place to make lots of mistakes, and a way to find out you made them. It forces you to confront nitty gritty details in a very structured and simple way. If you tend to understand things in abstract, but be a little shaky when it comes down to it, well this book may be for you. All the off-by-one errors you make have got to teach you some appreciation for your craft.
Picture of a book: The Elements of Computing Systems: Building a Modern Computer from First Principles

Filter by:

Cross-category suggestions

Filter by:

Filter by:

Filter by:

Filter by:

Filter by:

Filter by:

Filter by:

Filter by: