3 ms·
Show HN: ABC v0.1 – A teaching language grows up a little
I just tagged the first release of ABC, a small C-like language I originally developed for my Introduction to High Performance Computing course.
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 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 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. :-)
- theamk 1mo agoany relation to ABC[0], the programming language from 1980's which served as inspiration for Python? If not, I recommend renaming it to something else, to avoid confusion. LehnABC perhaps? [0] https://en.wikipedia.org/wiki/ABC_(programming_language) https://en.wikipedia.org/wiki/ABC_(programming_language)
- ModernMech 1mo agoVery much this. There are so many good names out there left for the taking, there's no reason to choose one that's already associated strongly with another language.
- michael-lehn 1mo agoYes, I know about the earlier ABC. :-) When I originally named mine, it was really just a small language for my own course, so I wasn't particularly worried about name collisions. And the wordplay was simply too tempting: students would use ABC ("A Better C") to write their own compiler, which I jokingly called ABC ("A Bloody Compiler"). The student compiler has since grown into a separate project and is now called "not-abc". Until recently I still thought the language itself was small and obscure enough that there wasn't much risk of confusion. But now that I'm starting to develop it beyond its original teaching purpose, I think the naming issue is a fair point. You're also not the first person to bring it up since I published v0.1. So yes, I may have to come up with a new name. :-) I'm not convinced by LehnABC yet, but suggestions are certainly welcome.
- deleted 1mo ago[deleted]
- ModernMech 1mo agoYes, I think when the language leaves the lab is the perfect time to start thinking about branding and I do like MCL that one is apparently also a language from 30 years ago but nothing like abc. It would be pronounced “muscle”. https://www.sciencedirect.com/science/article/abs/pii/0010465589900064 https://www.sciencedirect.com/science/article/abs/pii/001046...
- michael-lehn 1mo agoOK, you convinced me. :-) And 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. ;-)
- michael-lehn 29d agoA small update on the naming rabbit hole. A few candidates I currently like: emsiel — pronounced roughly like “M-C-L”. I like how it sounds; several people independently said it sounds vaguely biblical. :-) The downside is that it feels more like the name of a personal project than something inviting people to build a community around. 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 (“itchsy”) — short for “it’s just C”. It stays conceptually close to C, while using the syntax I wish C had. There's also an accidental “I just see” hiding in the spelling. At the moment I'm leaning towards ijc, but I'm still not quite ready to rename everything. :-)