bust is a compiler for B, the language that preceded C at Bell Labs. It targets x86-64 Linux and produces ELF binaries.
bust source.b -o output # compile & link → executable
bust -S source.b -o output.s # assembly only
bust -s 'printn(42);' # one-liner
| Option | Description |
|---|---|
-o <file> |
Output file (default: a.out) |
-S |
Emit assembly only, do not assemble/link |
-s <code> |
Compile string instead of file |
--libb-path <path> |
Path to liblibb.a |
cargo xtask install # → /usr/local/{bin,lib64}
cargo xtask install --prefix ~/.local # → ~/.local/{bin,lib64}
cargo xtask uninstall # remove from /usr/local
cargo xtask uninstall --prefix ~/.local # remove from ~/.local
liblibb.a is resolved at runtime in this order: --libb-path → LIBB_PATH env → well-known system paths → compile-time fallback.
| Path | Description |
|---|---|
bust/ |
Compiler: lexer, parser, codegen |
libb/ |
Runtime: syscall wrappers, I/O, no libc |
xtask/ |
Build & install automation |
Larger programs written in B using bust can be found here:
- Bad Bapple — Bad Apple!! rendered as ASCII art in B.
- bcube — Rotating ASCII cube in B.
cargo xtask test
- BCause — C implementation of the B language that inspired this project.
- blang — Go/LLVM implementation of the B language that inspired this project.
- Users' Reference to B by Ken Thompson (1972)
MIT