Thread View: comp.compilers
1 messages
1 total messages
Started by Michael Lehn
Tue, 20 Oct 2026 16:49
Re: A tiny self-hosting compiler used for teaching
Author: Michael Lehn
Date: Tue, 20 Oct 2026 16:49
Date: Tue, 20 Oct 2026 16:49
67 lines
3981 bytes
3981 bytes
Hi everyone, A quick update on the teaching material I mentioned back in August. At the time, I had just started translating the course worksheets into English. I'm now getting close to the finish line: 22 sessions are available, with only three left to complete: * Session 23: Pointers and Strings * Session 24: Logical OR and AND * Session 25: LLVM Backend and Self-Hosting The worksheets, explanations, and accompanying code are available here: <https://github.com/michael-lehn/not-abc> There was some interesting discussion here about whether compiler construction might be too ambitious for students with little or no prior programming experience, particularly when it comes to pointers, memory management, and data structures. With most of the material now available, it's hopefully easier to see how the course approaches these challenges. The students don't start by writing a compiler. They gradually develop the necessary concepts, from basic programming and control flow to data structures, memory management, parsing, and code generation. In parallel, they explore how a processor works, starting from logic gates. This also reflects a broader philosophy behind the course, which I believe is more important than ever in the age of AI: **Students should understand the problems before being presented with solutions.** Only then can they learn to ask the right questions, critically evaluate the answers they receive, and recognize when those answers are simply nonsense. That's really the common thread running through the entire course. We don't explore every topic down to the last detail, but that doesn't mean taking shortcuts when it comes to implementation. Students build the compiler themselves, from the lexer and parser to code generation, without relying on parser generators or similar tools. The goal isn't to cover every possible detail, but to make students aware of the layers of complexity beneath the abstractions they use. They should know that these deeper layers exist, why they matter, and where to start looking when something doesn't work as expected. There was also a discussion about the name ABC and its collision with the earlier ABC language developed at CWI. I briefly considered renaming mine, but eventually decided to embrace the confusion. I've added a little note to the repository: My ABC is unrelated to the ABC language developed at CWI, which was originally called B — also unrelated to Bell Labs' B, the predecessor of C. Apparently, we're running out of letters. With just three sessions remaining, I'd very much welcome feedback on the material, especially while there's still time to make improvements before wrapping things up. Best, Michael Michael Lehn University of Ulm, Institute for Numerical Mathematics Helmholtzstr. 20 D-89069 Ulm, Germany Phone: (+49) 731 50-23534, Fax: (+49) 731 50-23548
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads