It mimics Java, so your compiler compiles to a bytecode IR. The compiler as described by the book is a bare-bones recursive descent compiler that doesn't do any AST analysis. The compiler is for a toy language called Jack (fake Java) that was intentionally designed to be easy to write a compiler for. L(1) grammar I believe. They don't really talk about error handling or more complex compiler topics. No optimization methods are covered.
N2Tetris is like doing the 20% to get the 80% of every layer of abstraction. It really scopes down each project so you can cover every layer between logic gates and a high level language with built in OS APIs. I think it's a fantastic course but if you're looking to learn specifically about compilers I'm not sure if it'll meet your needs.
I've been hacking on an Apple ][ over the past few weeks. It runs on a 6502 processor. It's kind of mind-blowing to know that the thing used to run an entire PC was later used for pocket toys like the Tamagotchi a handful of years later. The speed at which technology has improved will never cease to amaze me.
> It's kind of mind-blowing to know that the thing used to run an entire PC was later used for pocket toys like the Tamagotchi a handful of years later.
Perhaps ironically, all of the microprocessors of the early and mid 1970s, the 6502 included, were intended as embedded controllers. Systems where you couldn't justify the expense of a "real" computer, and didn't want to design full custom electronics. Like for an engine control unit, or, indeed, a video game. (Although not for handheld battery-powered units originally, only the later CMOS revisions had low enough power draw for that to be practical.)
That hobbyists would make single-board computers with about the capability of an early 1960s minicomputer using chips like the 6502 or 8080 - and then find those machines useful enough to create a large market - was quite a surprise, and an upset, to both the semiconductor and computer manufacturing companies. MOS was one of the first to recognize that market, and sell direct via mail order. The easy availability of samples, and low cost in small quantities, was one of the reasons for the 6502's success against its bigger competitors. Motorola, Intel, TI, etc. at the time were marketing to the engineers at companies that made car engines, CNC machines, telephone exchanges, etc.
Some 'window-shopping' at a smart card retailer shows a mixture of Atmel, ARM and unspecified RISC processors in use. That would suggest to me that they not only have different instruction sets, but are much more capable than the 6502. I certainly wouldn't choose a 6502 on which to run my Java applets!
N2Tetris is like doing the 20% to get the 80% of every layer of abstraction. It really scopes down each project so you can cover every layer between logic gates and a high level language with built in OS APIs. I think it's a fantastic course but if you're looking to learn specifically about compilers I'm not sure if it'll meet your needs.