March 4, 2026
Cursed or genius?
Show HN: Rust compiler in PHP emitting x86-64 executables
Yes, a Rust compiler in PHP — hackers cheer, purists panic, and everyone asks: why
TLDR: A Rust compiler built in PHP can output real Linux programs without the usual tools, shocking and amusing devs. Security folks love the practicality in weird environments, while purists roll their eyes and meme it—proof that clever hacks thrive where old servers and PHP still rule.
A developer just dropped a Rust compiler written in PHP that spits out actual Linux machine code—no fancy toolchain, no external helpers, just raw bits. The community is split between awe and “what on earth?” One commenter shrugged that in weird, locked-down environments, PHP is everywhere and just works, making this cursed concoction oddly practical. Another asked if all PHP devs are named Rasmus, turning the thread into a meme factory. Meanwhile, someone wondered if it could run inside kphp, a tool that turns PHP into C++—cue inception jokes.
For the non-nerds: Rust is a safety-first coding language; compilers usually rely on big frameworks like LLVM (a code toolbelt). This project skips all that and writes the final “1s and 0s” itself. It handles ownership checks (keeping track of who controls data) and core features, but lacks big-ticket items like enums, generics, traits, and floating point numbers. Fans call it a wild proof-of-concept for ancient shared hosting where you’ve only got PHP. Skeptics roll their eyes at the missing features and call it “beautifully unnecessary.” And then there’s the mystery-meets-comedy: “you never know what’s going on in someone else’s claude max plan,” implying AI-fueled chaos behind the scenes. It’s half serious tool, half internet performance art, and fully irresistible.
Key Points
- •rustc-php is a Rust compiler implemented in PHP that directly emits x86-64 Linux executables.
- •It avoids traditional toolchains, using no LLVM, assembler, or linker.
- •Supported features include ownership/borrow checking, type checking, structs, functions, control flow, and move semantics.
- •Installation guidance targets Windows 11 using winget for PHP and WSL with Ubuntu to run Linux binaries.
- •A test suite is provided, and significant Rust features are currently not implemented, including enums, generics, traits, and floating-point types.