Someone on Hacker News has been quietly turning PlayStation 2 games into WebAssembly. The Show HN post didn’t arrive with a marketing budget or a press release, just a technical demo and a thread full of people trying to understand how it works. That’s usually where the interesting stuff lives.
The approach is called static recompilation, and it’s worth understanding why it matters beyond one person’s weekend project. Traditional emulation, the kind you know from Dolphin or PCSX2, works by simulating a console’s hardware in software. The emulator reads the original game’s machine code at runtime, translates each instruction on the fly, and keeps a running model of the CPU, GPU, and memory buses. It’s flexible and remarkably accurate, but it carries overhead. Every instruction has to be interpreted or just-in-time compiled before it actually does anything.
Static recompilation flips that. Instead of translating instructions while the game runs, you translate the entire binary ahead of time into code your target machine can execute natively. The output here happens to be WebAssembly, which means the game can potentially run in a browser tab with no emulator layer sitting between the original code and the hardware. In principle that’s faster and leaner. In practice it’s a research problem that has occupied hobbyists and academics for years.
The reason it’s hard comes down to self-modifying code, indirect jumps, and the thousand small ways real games abuse the hardware in ways documentation never anticipated. A PS2 title isn’t a tidy compile target. It was written by people squeezing every cycle out of a famously idiosyncratic machine with two vector units and a graphics synthesizer that developers complained about for most of the console’s life. Games sometimes generate code at runtime. They sometimes jump to addresses calculated on the fly. A static recompiler has to either prove those cases can’t happen or find a way to handle them when they do.
WebAssembly adds its own wrinkles. It’s a sandboxed, memory-safe target designed for portability rather than for mimicking a 2000-era game console. Getting a recompiled binary to behave correctly inside that sandbox means solving memory layout, threading, and graphics translation problems that don’t have obvious answers. The fact that someone has a working demonstration at all is the headline.
It’s tempting to frame this as pure nostalgia, and there’s certainly an audience for that. But the more interesting angle is what it says about preservation and about where compute is heading. Console libraries from the sixth generation onward are increasingly stranded. Discs rot, drives fail, and the hardware that could read them is no longer manufactured. Emulation has done heroic work keeping that history alive, but emulators are complex software that itself needs maintaining, and they depend on people who understand hardware that hasn’t been documented well.
Recompilation offers a different kind of durability. A recompiled game is, in a sense, no longer a PlayStation 2 game. It’s a WebAssembly program that happens to produce the same behavior. That distinction matters legally and technically, and it’s already the subject of ongoing debate in preservation circles.
Running in a browser also changes the distribution question. No installers, no platform-specific builds, no dependency on an operating system that may not exist in ten years. WebAssembly has become a genuinely universal target, supported by every major browser and increasingly used on servers too. If a recompiled PS2 game runs in Chrome today, it will probably run in whatever replaces Chrome, because the format is standardized and the sandbox is stable.
None of this means emulators are going anywhere. Accuracy-focused emulation still wins for the long tail of weird titles, and JIT compilation has gotten good enough that the performance gap isn’t always dramatic. Static recompilation also requires per-game work, which doesn’t scale the way a general-purpose emulator does. You can’t just drop any disc in and expect it to work.
But the direction of travel is notable. Between browser-based recompilation, cloud streaming, and the slow creep of official retro re-releases, the assumption that old games need old hardware is eroding. That’s good news for anyone who cares about the medium’s history, and mildly uncomfortable news for companies whose business model depends on reselling the same titles every console generation.
The Hacker News thread, as these things go, is a mix of genuine technical curiosity and people asking whether it runs a specific game they remember from middle school. That’s roughly the right reaction. A demo like this isn’t a product. It’s a proof of concept pointing at something bigger, and the interesting question isn’t whether you can play a PS2 game in a browser tab. It’s what else becomes possible once the tooling matures.