Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nand2Tetris (part 1)


The second part is awesome too.

The first part shows how to design an unoptimized and simplistic, but complete and working 16-bit CPU and RAM from logic gates.

The second part builds a whole software stack on top of it using a virtual stack-based VM:

    - CPU assembler;
    - a (AOT) compiler from the VM opcodes 
      into the CPU assembly;
    - a compiler from the high-level language 
      called Jack (an educational mix of Java/C 
      with many complex parts removed) into the 
      VM opcodes;
    - a standard library for the Jack language 
      (Screen/Keyboard/Output/Math/String/Array/
      Sys/Memory classes), including writing your own
      memory allocator and drawing lines/circles 
      and bitmapping glyphs into video memory 
      for text rendering;
    - your own project (usually a simple game and 
      sometimes marvels like [0]) written in Jack 
      on top of all of that;
The courses are definitely very challenging and some previous exposure to the topics is desired.

[0] https://github.com/QuesterZen/hackenstein3D


Wow, someone made an FPS in Jack on the Hack computer? Crazy!

(Just completed parts 1 and 2 last week on Coursera btw, really opened my eyes!)


I'm sure part 2 is great as well, I've only had time to do the first part so only wanted to speak to that. The way it jumps up and down the hardware stack is a very good tool from a pedagogy standpoint - doing assembly language before the CPU really informs why we want the CPU to be set up in the way it is.


Seconded, with part 2. I didn’t major in compsci, so I had never learned how computers work in any deep sense, and this was really eye opening. It takes you through how to build a cpu and then how a succession of binary instructions produces interesting behavior, and then how you can layer abstractions on top, like assembly language and stack operations, and then how to compile code down to those binary instructions and what has to happen at the OS level for this code to run.

It’s also opened my eyes to how much more I still have to learn!

You can do parts 1 and 2 at the same time, btw.


Came here to post this, part 1 is an absolutely amazing overview of computer organization. Part 2 is decidedly more difficult, but very good as well.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: