Show HN: ABC v0.1 – A teaching language grows up a little
With v0.1, ABC is starting to grow a little beyond its original teaching purpose. It now has multiple backends, including LLVM, and initial x86-64 System V ABI support. As a first practical application, ABC can use raylib to build small graphical programs.
The original idea behind ABC was to give students something simpler than C/C++ while keeping the parts that matter for understanding how programs actually map to a machine.
During the course, students develop a simple RISC-like architecture and write their own compiler for it in ABC. This way they get to see the complete chain at least once: hardware → instruction set → assembly → compiler → programming language
That compiler eventually became self-hosting and is now called not-abc: https://github.com/michael-lehn/not-abc
ABC itself has gradually grown beyond what was strictly necessary for the course. The LLVM backend makes it possible to generate native code, and the new ABI layer is a first step toward using existing C libraries and writing small real applications rather than just teaching examples.
Currently, a subset of the x86-64 System V ABI is implemented. The ABI layer is designed so that other targets can be added; ARM is the obvious next one. ABC v0.1 supports and has been tested with LLVM 17 through 22.
Project: https://github.com/michael-lehn/abc-llvm
Feedback on the language, the teaching approach, the ABI implementation — or ideas for small applications that would be fun to build with ABC — is very welcome. :-)
5 comments
[ 0.31 ms ] story [ 15.3 ms ] threadAnd the timing is probably good. I'm just about to leave my basement and head to LA for a few days to enjoy some actual sunshine. So I'll either turn to ashes or come back with a creative new name. ;-)
uhu — “under the hood”. This fits the teaching philosophy quite well: the language/compiler is deliberately small and, more importantly, doesn't try to hide what's going on under the hood.
ijc — pronounced “eye-jay-see”: “it's just C”, with the accidental “I just see” pun. The idea is that it stays very close to C conceptually, but presents it in a syntax that I find easier to read and teach. At the moment I'm leaning towards ijc, but I'm still not quite ready to rename everything. :-)