[Media] Bringing Rust to the 70s: I wrote a full LLVM backend for the Zilog Z80.
![[Media] Bringing Rust to the 70s: I wrote a full LLVM backend for the Zilog Z80.](https://i.redd.it/57eoiep6f2pg1.png)
Two years ago, I started a project called Rust-GB to compile Rust for the Game Boy. At the time, there was no stable LLVM backend that supported the Game Boy’s CPU. I had to use a complex workaround: transpiling Rust to C via LLVM-CBE, and then compiling that C code using SDCC. Back then, I dreamed of building a native LLVM backend, but I simply didn't have the time.
Fast forward two years, and things have changed. With the help of LLMs, I have successfully implemented a complete LLVM-Z80 backend (which includes subtarget support for the Game Boy's SM83). Even the performance is generally better than SDCC, though it results in a larger binary size.
I’m happy to report that I’ve successfully built the entire Rust core and alloc libraries for both the Z80 and SM83! :)
- LLVM-Z80 : https://github.com/llvm-z80/llvm-z80
- Rust-Z80 : https://github.com/llvm-z80/rust-z80
(If you find this project interesting, I'd appreciate a star on the repo lol)