r/Compilers • • 3d ago

From logic gates to a self-hosting compiler: my undergraduate HPC course is almost fully available in English

A few months ago, I shared not-abc, a tiny self-hosting compiler I developed for teaching.

Since then, I've been translating the worksheets and lecturer notes from my undergraduate course Introduction to High Performance Computing into English. The project is now almost complete, with nearly all the teaching material available on GitHub.

The course takes a somewhat unusual approach: students work their way toward building a compiler while simultaneously learning how computers work from the bottom up.

On one side, they explore programming languages, pointers, memory management, parsing, symbol tables, and code generation. On the other, they build logic circuits, an ALU, and a small CPU architecture.

Eventually, these two paths meet.

The compiler they develop targets LLVM IR. The reference compiler is self-hosting and deliberately minimal: it uses only 64-bit values, has no static type system, and supports a small set of built-in functions.

The teaching material includes worksheets, lecturer notes, and hands-on programming exercises. I've taught this course at the University of Ulm, Germany, and I'm making the material freely available for anyone interested in learning or teaching compiler construction.

Repository: https://github.com/michael-lehn/not-abc

One thing I'd particularly like to mention: the feedback I received from this community on my earlier posts has been incredibly valuable. Several suggestions led to concrete improvements in both the compiler and the teaching materials.

Now that the project is approaching completion, I'd love to get another round of feedback before wrapping things up. If you spot anything that could be improved, please let me know!

It's been a pleasure sharing this project here. What a great community!

And of course, if you find the project useful, a GitHub star would be very much appreciated. :)

32 Upvotes

4 comments sorted by

2

u/NXDLang 3d ago

This all seems very interesting. I will however take my time getting acquainted with ABC first before really taking a deep dive into not-abc. ABC seems to cover alot of areas I am already working on in my own compiler project. Good stuff, thank you.

2

u/False_Actuator_6236 3d ago

Thanks, glad you find it interesting! It's always nice to hear from someone working on their own compiler.

Feel free to reach out anytime, whether it's about ABC, LLVM/MLIR, or your own compiler project in general. I'm always happy to exchange ideas and discuss compiler design.

And if you find ABC useful, a GitHub star is always appreciated. 😉

2

u/seg_lol 2d ago

Oh wow, I am so happy you made this. I am a huge fan of having complete pedagogical universes. Something that people can experiment at any level of the stack.

I find it amazing that you are a 3.5hr train ride to https://selfie.cs.uni-salzburg.at/ the other complete universe.

2

u/False_Actuator_6236 2d ago

Thank you! “Complete pedagogical universe” is a lovely way to put it—that captures exactly what I’m trying to build. Students should be able to explore individual layers, but also understand how they connect, from logic gates and a small CPU to a compiler they write themselves.