[COFF] B compiler for Linux/macOS
Warren Toomey via COFF
coff at tuhs.org
Wed Oct 22 07:44:18 AEST 2025
Hi all, I got this e-mail from Serge. I asked and he was happy for me
to share the e-mail with you.
Cheers, Warren
----- Forwarded message from Serge Vakulenko <serge.vakulenko at gmail.com> -----
Dear Warren,
I hope this email finds you well. Although we've never met in person,
my name is Serge. I'm a software developer based in the San Francisco
Bay Area, with a deep passion for computer history.
A few years ago, I came across the source code for the B compiler,
which was reverse-engineered by Robert Swerczek. Intrigued by the
challenge of adapting it for contemporary systems, I developed a
full-featured B compiler that generates intermediate representation
(IR) code for LLVM. This allows it to produce native binaries for Linux
or macOS across x86_64, ARM64, and RISC-V architectures.
The compiler itself is implemented in Go (approximately 3,000 lines of
code), with a lightweight runtime library in C (under 400 lines). I've
kept the API as faithful as possible to the original PDP-7
implementation, enabling direct compilation of files like b.b without
modifications.
Here is the project: https://github.com/sergev/blang
Your insightful article on restoring the PDP-7 to run Unix has always
inspired me, so I wanted to share this project with you. It's exciting
to think that the B language— a foundational piece of computing
history— is now accessible to modern developers.
Best regards,
Serge Vakulenko
----- End forwarded message -----
More information about the COFF
mailing list