#96 overall
Compilers
Stanford Lagunita
4 recommenders · 5 threads · recommended in 3 years, 2017–2020 · score 4.8
A Stanford course on compiler construction taught by Alex Aiken, offered self-paced on Lagunita. It covers lexical analysis, parsing, semantic analysis and code generation, and students build a working compiler (for the COOL language, with assembly output run in an emulator).
Commenters call it free, self-paced and one of the best educational experiences, since you actually write a compiler.
Programming Languagesintermediatefreeself-paced text#compilers#parsing#code generation#semantic analysis#aiken#cool
Recommendations by year
20062026
At uni I went through a module on compilers which basically covered all the Dragon book.
I then followed this on-line course where you actually write a compiler for the COOL language. It has been one of the best educative things I've ever done in my life and I can't help recommending it.
https://lagunita.stanford.edu/courses/Engineering/Compilers/...
I'd love to do something like that in my professional career but unfortunately 90% of the time I ended up carrying out way less interesting work (writing application for end users).
I recommend compilers course by Alex Aiken from Stanford open
You can get started on the compiler/interpreter specific learning as long as you already know a programming language and basic data structures. You do not need any math skills.
1) Lexical Analysis (Tokeniser)
The first step of your compiler takes in free form text and turns it into a set of tokens that make the rest of the process much easier. To understand this you should learn about Regular Expressions and Finite State Machines.
2) Syntax Analysis (Parsing)
Processing the above tokens and ensuring the input has the valid syntax of a program is your next step. You need to learn about Context Free Grammers, Backus Naur Form and Abstract Syntax Trees.
3) Semantic Analysis
Just because the input has valid syntax does not mean it makes actual sense. Here you need to learn about Symbol Tables and Type Checking. The specifics are very dependant on the actual language you are dealing with.
4) Code Generation
A compiler will be generating code but an interpreter will perform actual execution of the Abstract Syntax Tree operations. Again, the specifics are very dependant on the actual language you are dealing with and the target. Start by looking into Code Generation, Code Optimizations and Assembly Code.
I recommend an online, free course, like the following from Stanford that is self-paced and results in a compiler that generates assembly level instructions for test running in an emulator.
https://lagunita.stanford.edu/courses/Engineering/Compilers/...
You can take Stanford's Compilers course from Lagunita: https://lagunita.stanford.edu/courses/Engineering/Compilers/...
You can take Stanford's Compilers course for free as an online course from Stanford's Lagunita.
I'm currently auditing the Stanford compilers course online. I understand the inertia in introductory courses, and the simplicity of MIPS, but hopefully the course is eventually ported to Aarch64 or RISC-V. Presumably a spim-like simulator for Aarch64 or RISC-V is the biggest missing component.
6.004 was one of my favorite classes at MIT, and the DEC Alpha AXP was a fine architecture to simplify for the pedagogical Beta architecture. However, I'm glad to hear they've moved to RISC-V. I presume they'd been avoiding porting the course to Aarch64 (or a simplified version thereof) due to intellectual property issues.
Interestingly enough, a lot of universities do have the course material available on their websites. Eg, I learned most of my compiler module from Stanford course notes because they were better than my own lecturers ones.
But I get what you're saying and imagine this is why not all universities do this. If everything were free, they may not get so many people paying for it.