Hardcore Geek Project: A Rust Compiler Written Entirely in PHP

tom_doerr · x · 2026-08-14

A hardcore project named rustc-php has surfaced on GitHub: a Rust compiler written entirely in PHP.

Without relying on LLVM, assemblers, or linkers, it directly emits x86-64 Linux ELF binaries. Surprisingly, it implements not just basic code generation but also Rust's core features, including ownership checking, borrow checking, type checking, move semantics, generics, traits, closures, and iterators.

The developer jokingly notes that this is perfect for deploying on a 2008 shared hosting server—where PHP might be the only available runtime.

Original post →

More from Fun

Fun channel →