Loading video...

Video Failed to Load

Go Home

i built an entire x86 CPU emulator in CSS (no javascript) you can write programs in C, compile them to x86 machine code with GCC, and run them inside CSS

1,077,051 views • 7 months ago •via X (Twitter)

53 Comments

Rebane's profile picture
Rebane7 months ago

check it out here: :3c

Z's profile picture
Z7 months ago

but can it center a div?

Rebane's profile picture
Rebane7 months ago

everyone who makes this joke should be forced to read my blog post

Sylvester Hesp's profile picture
Sylvester Hesp7 months ago

I don't know how long you've been around, but since you're not addressing it in your blog: there was a time before flex boxes were at thing. Centering a div was exceptionally hard, unless you resorted to using tables. Which everyone did before the semantic web.

Rebane's profile picture
Rebane7 months ago

@zelimir__ yes - and i think the history of html/css/browser hacks is really cool! but joking about centering a div these days is just admitting you don't know anything

Sylvester Hesp's profile picture
Sylvester Hesp7 months ago

@zelimir__ No, it's just a meme. Like "can it run Crysis".

Rebane's profile picture
Rebane7 months ago

@zelimir__ maybe its just because i do so much css stuff, but hearing it over and over again kinda feels like this

Sylvester Hesp's profile picture
Sylvester Hesp7 months ago

@zelimir__ Well I can get that someone in your position hears it a lot and can get tired of it 🙂. Back in early 00s I made a raycaster in html4 using vertical <img> slices (canvas didn't exist at the time). Now I wonder if this is doable without javascript 😄

Rebane's profile picture
Rebane7 months ago

@zelimir__ that's pretty sick! and i think it is :)

ルナ・サラ (Lunar Schala)'s profile picture
ルナ・サラ (Lunar Schala)7 months ago

Your bio says "CSS noob", but I think you're at least a CSS sophomore.

Rebane's profile picture
Rebane7 months ago

hmm yeah i think i've earned that title by now

Ben's profile picture
Ben7 months ago

So at this point, should security-paranoid people who disable Javascript also be switching off CSS?

Rebane's profile picture
Rebane7 months ago

@humng392546 depends on your threat model, i use noscript and disable js by default, but don't see css as a threat i need to worry too much about (despite having a css-only chrome cve)

Uncle Ji's profile picture
Uncle Ji7 months ago

@humng392546 You reported it. Right?

Rebane's profile picture
Rebane7 months ago

@humng392546 yes, that's why i have a cve

Rijnard van Tonder's profile picture
Rijnard van Tonder7 months ago

you deserve to know you only need `mov` to be Turing complete. In CSS. Pls report back if you do this

Rebane's profile picture
Rebane7 months ago

i am aware of that (and the movfuscator), but like, an entire cpu with the same architecture as your computer is just way cooler

Rijnard van Tonder's profile picture
Rijnard van Tonder7 months ago

grant.ed.

Rijnard van Tonder's profile picture
Rijnard van Tonder7 months ago

anyway it's just an instruction pass :p css computer will run it

Sylvie's profile picture
Sylvie7 months ago

whoa, it's like... assembly... but for the web... imagine if that was an actual thing that would be crazy

ludwig's profile picture
ludwig7 months ago

neat

NSG650's profile picture
NSG6507 months ago

Oh my god 😭

Yet Another Tech Poster's profile picture
Yet Another Tech Poster7 months ago

Truly unhinged code to read from memory I love it @function --readMem(--at <integer>) returns <integer> { result: if( style(--at:-1): var(--__1AX); style(--at:-2): var(--__1CX); style(--at:-3): var(--__1DX); style(--at:-4): var(--__1BX); style(--at:-5): var(--__1SP); style(--at:-6): var(--__1BP); style(--at:-7): var(--__1SI); style(--at:-8): var(--__1DI);

Rebane's profile picture
Rebane7 months ago

@function you should post the rests of it

Yet Another Tech Poster's profile picture
Yet Another Tech Poster7 months ago

@function Haha i opened the file in vim and i thought it was bugging out

Filip Jerzy Pizło's profile picture
Filip Jerzy Pizło7 months ago

That’s fucking awesome

PiX's profile picture
PiX7 months ago

you deserve this:

Miguel Piedrafita ✨'s profile picture
Miguel Piedrafita ✨7 months ago

you WHAT

CraftyMasterman 🇨🇦's profile picture
CraftyMasterman 🇨🇦7 months ago

this is the most redstoner coded coding project of all time

Alula's profile picture
Alula7 months ago

jesus fucking christ

William Candillon's profile picture
William Candillon7 months ago

can it run Doom?

vik's profile picture
vik7 months ago

incredible

♡ mari/cohe ♡'s profile picture
♡ mari/cohe ♡7 months ago

fuckin what

Kanbaru 🌟 (one hikari of too many)'s profile picture
Kanbaru 🌟 (one hikari of too many)7 months ago

fascinated to learn this doesn't rely on JS to advance time, will have to stare at the code later

Asté's profile picture
Asté7 months ago

I know you're going to write a blog about this but can you name the most abused trick in this contraption?

Rebane's profile picture
Rebane7 months ago

the if() statement combined with a style query combined with collapsing calcs

Josh Hand's profile picture
Josh Hand7 months ago

Ok but does it play Doom.

cts🌸's profile picture
cts🌸7 months ago

this is awesome!

Kyrylo Silin's profile picture
Kyrylo Silin7 months ago

Neat! It makes me wonder is this a new attack vector? It’s kind of like unhinged WASM, but without the guardrails.

Rijnard van Tonder's profile picture
Rijnard van Tonder7 months ago

link to implement just `mov` for Turing completeness

webXOS's profile picture
webXOS7 months ago

You Gave me some Ideas!

Rebane's profile picture
Rebane7 months ago

do these actually work without js? they look very vibe coded

webXOS's profile picture
webXOS7 months ago

The pong game probably will never work real time. (due to the logic of the pong ball) but I can get the paddles to move. The emoji quest was based off an already existing JS reliant game ( that i tried to xfer to CSS sort of works but i'm still building.

webXOS's profile picture
webXOS7 months ago

Interesting approach though, I have made html/css template document type pages which are nice and clean for the UI. But turning them into full functional PWA is a new realm I am learning.

webXOS's profile picture
webXOS7 months ago

Getting some Cool Zine style pages for CSS ideas doing this. Avoiding the JS seems to give the LLM more CSS editing in it's replies (using deepseek browser client for this)

webXOS's profile picture
webXOS7 months ago

I am going to try to build a collection of html/css webzine pages with these themes

d-_-b's profile picture
d-_-b7 months ago

thats nice

solarite 🍉's profile picture
solarite 🍉7 months ago

Bro i swear to god

wtas x's profile picture
wtas x7 months ago

Thanks!

ABrownHat 🇻🇦's profile picture
ABrownHat 🇻🇦7 months ago

I can't decide whether we should give you a medal or put you in jail.

Diogenes of Cyberborea's profile picture
Diogenes of Cyberborea7 months ago

@dante_eats

thomas 🍙's profile picture
thomas 🍙7 months ago

Literally how

🌵 Marcel Wiessler's profile picture
🌵 Marcel Wiessler7 months ago

Can it run Doom?

Related Videos