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

So, here the question I want to ask someone who dealt with this course:

How much of the topic of compilers is covered in this course? Have you built an optimizing compiler that creates binaries from a [relatively] high-level language such as C? Or you have just created an assembly for a specific architecture?



Without too much experience in writing compilers beyond this course, I'd say that the course focuses on grounding your conceptual/intuitive knowledge of how compilers work rather than any serious exposition into modern-day production-grade compilers.

You write the assembler for the course's own hardware architecture called Hack, then a compiler backend that converts a stack-based VM intermediate representation (IR) to assembly, and finally a compiler frontend that does syntax analysis and code generation to translate the book's high-level language Jack to the IR.


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.




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

Search: