Enterprising developer somehow writes an x86 CPU emulator in plain CSS — no Javascript, no WASM, just stylesheet computing

hashes
(Image credit: Getty)

Yes, you did read the headline correctly, and you'd be wise to fetch a cross, garlic, and a stake. Lyra Rebane, a madlady who dabbles in CSS and infosec, figured out she could leverage the power of contemporary implementations of the stylesheet language to emulate an x86 processor, all without even a single line of JavaScript, WASM, or any other such tomfoolery.

As the first question out of everyone's mouths will be "Can it run Doom?", the answer is that no, it cannot, or at least not yet. While the x86css emulator implements most of the x86 assembly, it's missing key functionality like interrupt handling, port input/output, and block-operation instructions, all key to making most any game as we know them. Perhaps more poignantly, Doom is a 32-bit program and requires a 32-bit CPU (80386 or above), 4 MB of RAM, and the ability to enter protected mode.

Cold-hearted developers like myself will also find some warmth in the fact that Rebane did not use any vibe-coding or AI bot assistance for writing this emulator. And as she points out, a bot could have hardly done this, as the necessary leaps in logic to force CSS to be a full-fledged state machine require some serious out-of-the-box thinking. Rebane points to Jane Ori's CSS CPU Hack as instrumental to her own ideas.

As to the reason or utility of such an enterprise, she simply stated that it was a fun project. Many developers (me included) have long made jokes when people mention HTML and CSS as "programming languages," and this is definitely a moment of harsh acceptance. Some commenters wonder if this implies that contemporary CSS might become a serious attack vector, but that seems unlikely given that Rebane had to create the machine to run the code with.

Google Preferred Source

Follow 3DTested on Google News, or add us as a preferred source, to get our latest news, analysis, & reviews in your feeds.

Bruno Ferreira
Contributor