Skip to content

Elements of Computing Systems Chapter 12

Tom Stuart edited this page Jul 22, 2015 · 5 revisions

Preamble

We began by reading through some of Murray’s commits, paying particular attention to those which highlighted discrepancies between the book’s advice and the actual behaviour of the reference compiler. (For example: the book says push constant 1; neg but the compiler does push constant 0; not; the book says add address and index, but the compiler adds index and address; the book says to set up that before calculating the value in an array assignment, but the compiler calculates the value first and stores it temporarily.) The general feeling was that it would’ve taken less work to write a “correct” compiler if we’d been given tests for the behaviour of its emitted code (cf. the vm-translator tests) instead of having to make it match the output of the reference compiler.

Suitably overawed by the magnitude of Murray’s achievement, we agreed to merge his commits into the compilation-engine branch and then land the whole compilation engine onto master.

Exercises

Asides

  • We noticed that some of our copies of the book say “Nand to Tetris Companion” on their cover, while others don’t. Perhaps a measure to placate angry readers who expected the book to ever mention Tetris?

  • Kevin mentioned that the link on page 278, http://www.idc.ac.il/tecs, is out of date; the book’s web site is at http://www.nand2tetris.org/ now.

  • Kevin also noticed that the book’s downloadable source code does not appear to include the source of their Jack compiler.

  • Leo has started using a nice new colour scheme.

Thanks

Thanks to Leo and Geckoboard for hosting, and thanks to Murray’s heroic efforts for finally propelling us beyond Chapter 11.

Clone this wiki locally