Products/Developer Tools / Compilers / Programming Languages/Rust compiler in PHP emitting x86-64 executables

Rust compiler in PHP emitting x86-64 executables

A Rust compiler written in PHP emitting x86-64 executables

Developer Tools / Compilers / Programming Languages
Rust compiler in PHP emitting x86-64 executables

Our Take

Someone asked "what if PHP could compile Rust?" and instead of laughing, mrconter1 just... built it. This is a full Rust compiler written in PHP that emits x86-64 Linux ELF binaries directly. No LLVM. No assembler. No linker. Just PHP generating machine code from one of the most complex type systems in existence—ownership, borrow checking, generics, traits, closures, iterators, the whole nine yards.

Let that sink in. The same language that powers WordPress is now compiling one of the most demanding systems programming languages on the planet. The Rust compiler is notoriously brutal to implement—it has lifetimes, ownership semantics, zero-cost abstractions that need to vanish at compile time, and a borrow checker that makes grown developers cry. mrconter1 built all of that in PHP, a language that was never supposed to touch the metal.

This isn't a toy. It generates actual executables. For anyone who's ever written a compiler, you know how insane this is—the semantic analysis alone for Rust is a multi-year project for teams at Mozilla. This is either the most useless thing ever made or the most impressive hack of the year. Probably both.

Key Facts

Category
Developer Tools / Compilers / Programming Languages
Discovered via
hacker-news

The people behind Rust compiler in PHP emitting x86-64 executables

m

mrconter1

profile

Links

Want products like this in your inbox every morning?

Five products. Every morning. Written by someone who actually cares whether they're good or not. Free forever, unsubscribe whenever.