HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
The Elements of Computing Systems, second edition: Building a Modern Computer from First Principles

Noam Nisan, Shimon Schocken · 9 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "The Elements of Computing Systems, second edition: Building a Modern Computer from First Principles" by Noam Nisan, Shimon Schocken.
View on Amazon [↗]
HN Books may receive an affiliate commission when you make purchases on sites after clicking through links on this page.
Amazon Summary
A new and extensively revised edition of a popular textbook used in universities, coding boot camps, hacker clubs, and online courses. The best way to understand how computers work is to build one from scratch, and this textbook leads learners through twelve chapters and projects that gradually build the hardware platform and software hierarchy for a simple but powerful computer system. In the process, learners gain hands-on knowledge of hardware, architecture, operating systems, programming languages, compilers, data structures and algorithms, and software engineering. Using this constructive approach, the book introduces learners to a significant body of computer science knowledge and demonstrates how theoretical and applied techniques taught in other computer science courses fit into the overall picture. The outcome of these efforts is known as Nand to Tetris : a journey that starts with the most elementary logic gate, called Nand, and ends, twelve projects later, with a general-purpose computer system capable of running Tetris. The first edition of this popular textbook inspired Nand to Tetris classes in universities, coding boot camps, hacker clubs, and online course platforms. This second edition has been extensively revised. It has been restructured into two distinct parts—Part I, hardware, and Part II, software—with six projects in each part. All chapters and projects have been rewritten, with an emphasis on separating abstraction from implementation, and many new sections, figures, and examples have been added. Substantial new appendixes offer focused presentation on technical and theoretical topics.
HN Books Rankings
  • Ranked #2 this year (2024) · view

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
If you think this is cool and would like to follow these steps yourself, here are my recommendations:

* Turing Complete on Steam (if you're into video games): https://store.steampowered.com/app/1444480/Turing_Complete/ * The Elements of Computing Systems (if you'd rather follow along step by step in a book):https://www.amazon.com/Elements-Computing-Systems-second-Pri...

edg-l
Check this one out: https://store.steampowered.com/app/1885690/Virtual_Circuit_B...

It focuses on performance, and looks quite beautiful.

erwan577
Turing Complete is maybe more a tutorial in digital logic coming with its own simulator than a game.

It is designed to feel like a puzzle game and is distributed on Steam but that's only the surface...

Building your own CPU and programming it in your own assembly language is exactly what TC promises on the tin.

The "game" discord server may be worth checking also.

erwan577
I forgot to say that TC simulator aims to high performance. That makes it more fun to use than Logicsim even if the feature set is more limited for now.
CodeSgt
Turing Complete looks great! I've been looking for games that fit the "Edu-tainment" niche for a while and haven't found many good ones for adults.
NextHendrix
Also consider MHRD[0], which is similar to nandgame, except you write your designs out in a (primitive) HDL starting with just NAND gates and working up to a functional CPU. Like the zachtronics games, it blurs the line between "game" and "work" just the right amount.

[0](https://store.steampowered.com/app/576030/MHRD/)

krallja
Try Zachtronics games (Shenzhen I/O, Exapunks, TIS-100) and https://www.nandgame.com/ too!
culanuchachamim
Amazing!!
drivers99
The Elements of Computing Systems is the book behind nand2tetris. I’ve done the course a few times on Coursera. The astro-8 (the computer in the video from this post) uses microcode in the CPU but nand2tetris just uses instructions whose bits directly drive the cpu. Although I do like how nand2tetris shows how layers of abstractions can be arbitrary, and even simpler than they are usually done in the real world, and you can still build on top of them using additional layers of abstractions. Even in the first step, instead of using different gates you only use nand and then create the needed logic gates from that. And the machine language it uses is at a microcode level and you build a stack language on top of that. (And then build an Java like language on top of that.)
Jun 10, 2022 · localhost on “Code” 2nd Edition
Code is my favorite technical book of all time [1]. Charles does an amazing job of building a computer up from basic principles "two young boys who want to communicate after their parents tell them to go to bed at night" all the way to modern (for 1999) computers. He layers abstraction on top of abstraction all the way to a working computer. My only (slight) disappointment in the book is that he tries to cover operating systems -> object oriented programming in a couple of chapters at the end. That could have been a multi-volume series in its own right.

It goes really well with Elements of Computing Systems (2nd ed) [2] which I kind of think of as a "lab manual" where you get to build a computer from first principles.

[1] https://www.amazon.com/Code-Language-Computer-Hardware-Softw...

[2] https://www.amazon.com/Elements-Computing-Systems-second-Pri...

greymalik
When the book “builds” a computer, I’m assuming that’s a virtual computer? If so, what language does it use?
jagged-chisel
GP said “builds up to.” It’s more about the abstractions adding up so that the reader understands how electrons can be programmed. There is no implementation of any kind of virtual or hardware machine in the book.

He goes: electricity, relays, logic gates, circuits (like adders), CPU, RAM …

It’s been awhile so I might have missed a step or two. You’ll come away knowing how we used electricity to get from lightning bolts, to pocket computers. You will not come away with a programmable machine.

Closi
It’s more a book that actually shows you how a computer really works, from first principles.

It’s not a book about implementing a particular computer - it’s more about giving you the rough thought process about how it actually works at the level of electricity and wires, and how this gets built up into something that actually calculates stuff.

It’s the first book that took me from “computers are mystical magic” to “computers are understandable magic”.

cptnapalm
There is a much older text book called the Art of Digital Design. In it, if you buy and solder the necessary components, you get a fully working PDP-8.
Closi
It’s more a book that actually shows you how a computer really works, from first principles.

It’s not a book about implementing a particular computer - more about

Jtsummers
If you're actually looking for something that does build to a virtual computer, Nand2Tetris (second edition of the book The Elements of Computing Systems that goes with it is now out) is a great companion to Code: https://www.nand2tetris.org/.

Code is more high level, Nand2Tetris and Elements is project based but covers some similar territory.

nonima
Code is not more high level it starts from as low as you can get in terms of abstractions, it explains what electricity is and how it moves through wires and and moves on to creating simple logic gates using switches.
overgrownzygote
Highly recommend Nand2Tetris. I completed it a few months ago as a relatively non-technical person (I had only taken CS50 as my first CS class ever in 2020) and learned a ton.
greymalik
I was actually asking about The Elements of Computing Systems in my comment, not Code. What language does it use to build a virtual computer?
localhost
You program in HDL using the Nand2Tetris software suite [1]. Super fun - I went through the book on my vacation last year. Highly recommended.

[1] https://www.nand2tetris.org/software

BobLaw
Quoted from the 2021 edition:

"Project 4 is written in the computer’s assembly language, and projects 9 and 12 (a simple computer game and a basic operating system) are written in Jack—the Java-like high-level language for which we build a compiler in chapters 10 and 11."

ayushka
Nand2tetris uses its own version of Hardware Description Language (HDL). You will also write a compiler for it's own language called Hack.
virissimo
The hardware exercises expect you to use a simple HDL, you write an assembler in your language of choice (I used Ruby, but others have used Python or JavaScript), and you write programs for the computer you "built" in earlier chapters using Jack (a language with Java-like syntax).
cptnapalm
I wrote mine in awk :)
danielvaughn
I picked it up years ago, got through the first few chapters, but then never finished it. I loved the early buildup and still want to go back and keep reading.
unethical_ban
Same! Still one of my favorite books ever read, but other than the floating point chapter it started getting over my head.
* How to Code: Simple Data and How to Code: Complex Data on edX. Taught by Gregor Kiczales, of Common Lisp and CLOS fame. Uses Racket and graphical programs to teach.

https://www.edx.org/course/how-to-code-simple-data

https://www.edx.org/course/how-to-code-complex-data

* The From Nand to Teris project, The Elements of Computing Systems: Building a Modern Computer from First Principles book, and/or Coursera course. Builds a hardware stack for a CPU and then a software stack (assembler, VM, high-level language).

https://www.nand2tetris.org/

https://www.coursera.org/learn/build-a-computer

https://www.coursera.org/learn/nand2tetris2

https://www.amazon.com/Elements-Computing-Systems-second-Pri...

* The How to Design Programs book. What the edX course above is based upon.

https://htdp.org/

https://www.amazon.com/How-Design-Programs-Introduction-Prog...

* Structure and Interpretation of Computer Programs (SICP). Uses Scheme. One can use Racket with the `#lang sicp` language.

https://mitpress.mit.edu/sites/default/files/sicp/index.html

https://www.amazon.com/Structure-Interpretation-Computer-Pro...

YouTube playlist of the course by the authors: https://youtube.com/playlist?list=PLE18841CABEA24090

* Thinking as Computation: A First Course. Uses Prolog to solve problems of thinking.

https://www.amazon.com/Thinking-Computation-First-Course-Pre...

https://www.cs.toronto.edu/~hector/PublicTCSlides.pdf

* Turtle Geometry: The Computer as a Medium for Exploring Mathematics (shares an author with SICP). Uses Logo to explore turtle geometry/graphics. Can use any modern Logo implementation.

https://www.amazon.com/Turtle-Geometry-Mathematics-Artificia...

https://direct.mit.edu/books/book/4663/Turtle-GeometryThe-Co...

* Starting Forth. Uses Forth.

https://www.forth.com/starting-forth/

https://www.amazon.com/Starting-Forth-Leo-Brodie-ebook/dp/B0...

* Learning Processing: A Beginner's Guide to Programming Images, Animation, and Interaction and also The Nature of Code: Simulating Natural Systems with Processing. Uses Processing and p5.js (the JavaScript version of Processing).

http://learningprocessing.com/

https://natureofcode.com/

https://www.amazon.com/Learning-Processing-Beginners-Program...

https://www.amazon.com/Nature-Code-Simulating-Natural-Proces...

The author's YouTube channel: https://youtube.com/c/TheCodingTrain

https://processing.org/

The book that did this for me:

The Elements of Computing Systems: Building a Modern Computer from First Principles (Nisan and Schocken)

https://www.amazon.com/Elements-Computing-Systems-second-Pri...

lukas099
Me too.

I'm not sure, but I think that when I looked into it, I found out that Code started from a level or two lower, but doesn't go up as many layers of abstraction as TEOCS.

(Including Amazon links, but just for convenience, buy wherever you want)

Code by Petzold (https://www.amazon.com/Code-Language-Computer-Hardware-Softw...) - non-technical (in the sense it isn't something to "work through"), covers a lot of interesting topics. Especially approachable for that age.

Elements of Computing Systems by Nisan & Schoken (https://www.amazon.com/Elements-Computing-Systems-second-Pri...) - more technical (has content to work through). I've read the first edition, not the second. Has a companion site: https://www.nand2tetris.org. It's well-written, and a motivated high schooler could work through it.

The Code Book by Singh (https://www.amazon.com/Code-Book-Science-Secrecy-Cryptograph...)

The Codebreakers by Kahn (https://www.amazon.com/Codebreakers-Comprehensive-History-Co...)

I was always interested in ciphers and such as a kid so those two books got my attention when I found them in high school/college. I'm a bit fuzzy, now, about which one I was more interested in but both were good books. (I still have them, may give them a re-read next month.)

There are a few others I have in mind, but just can't recall the titles at the moment.

There’s a second edition coming out after all this time: https://www.amazon.com/dp/0262539802

Estimated July 6 next year

EoCS is a modern classic in computer science and engineering, I am very excited to see a second edition.

First edition on amazon: https://www.amazon.com/Elements-Computing-Systems-Building-P...

Second edition pre-order on amazon: https://www.amazon.com/Elements-Computing-Systems-second-Pri...

I have fond memories from reading this book and doing the exercises. I never got past building RAM memory though :-)

It's worth mentioning that the book is getting a extensively revised (sic) 2nd edition in July 2021.

* https://www.amazon.com/Elements-Computing-Systems-second-Pri...

HN Books is an independent project and is not operated by Y Combinator or Amazon.com.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.