Quake in Safe Rust

October 9, 2026

Someone ported Quake to safe Rust and made it playable in the browser. It showed up on Hacker News yesterday and it is exactly what it sounds like: the 1996 id Software shooter, rewritten in a memory-safe language, running in WebAssembly.[1]

Why This Matters

Quake's original engine is C. The source code was released by id Software in 1999 under the GPL. Since then it has been ported to everything: Java, JavaScript, various C++ forks, and now Rust. The game is 30 years old and still serves as a reference implementation for 3D engine architecture.

The interesting part is "safe Rust." Rust has two modes: safe and unsafe. Safe Rust enforces ownership and borrowing rules at compile time, which means the compiler catches memory bugs before the code runs. Unsafe Rust drops those checks for cases where you need raw pointer access, like calling C libraries or doing low-level memory manipulation.[2]

Most Rust game engines and ports use a fair amount of unsafe code because graphics APIs, system calls, and FFI bindings require it. Getting Quake to run in purely safe Rust, without any unsafe blocks, is a meaningful constraint. It means the port had to find safe abstractions for everything the original C code did with raw pointers, manual memory management, and pointer arithmetic.

The Memory Safety Problem

The timing is good. Another HN post from the same day is about reducing undefined behavior in the C language.[3] C has a long-standing problem with undefined behavior: the standard leaves many things unspecified, and compilers are free to do surprising things with code that triggers UB. Buffer overflows, use-after-free, null pointer dereferences, and signed integer overflow are all undefined behavior in C.

The C community has been working on this. The C23 standard added some improvements, and there are ongoing efforts to make more C behavior defined. But the fundamental issue remains: C trusts the programmer, and programmers make mistakes.

Rust takes the opposite approach. The compiler enforces memory safety rules, and you have to explicitly opt out with unsafe. The tradeoff is that Rust has a steeper learning curve and slower compile times. But the payoff is that entire classes of bugs, the ones that cause about 70% of serious security vulnerabilities in large codebases according to Microsoft and Google, simply cannot happen in safe Rust.[4]

Browser Quake

Running Quake in the browser is not new. The first JavaScript port was in 2011. But doing it in safe Rust compiled to WebAssembly is a different proposition. WebAssembly itself provides a sandboxed execution environment, and combining it with Rust's safety guarantees means the attack surface is extremely small.

The original Quake had multiplayer over IPX and TCP. A browser version could potentially use WebRTC for networking, though the HN post does not mention whether the port supports multiplayer.

What It Says About Rust

Rust has been around since 2010 and stable since 2015. It has been adopted by Linux (kernel modules), Microsoft (Windows components), Google (Android and Chromium), Amazon (firecracker), and Cloudflare (pingora). The language is no longer experimental.[5]

Game development has been slower to adopt Rust, partly because the existing C++ ecosystem is enormous and partly because Rust's borrow checker can make iterative game development awkward. But engines like Bevy and Fyrox are proving that Rust game development is viable, and ports like this Quake one show that even legacy C game code can be translated to safe Rust without losing functionality.

Footnotes

[1] Hacker News: Show HN, Quake ported to safe Rust
[2] Rust Documentation: Unsafe Rust
[3] Hacker News: Reducing undefined behavior in C
[4] Microsoft Security Response Center: Why Rust
[5] Wikipedia: Rust (programming language)