Hacker News new | ask | show | jobs
by aaroninsf 2157 days ago
Idle question,

is CSS/HTML turing complete?

If so I look forward to a Show HN of a CSS/HTML emulator of JSMESS emulating a 386 running Windows 98.

4 comments

My understanding is that:

Neither CSS nor HTML is turing complete.

The combination of CSS and HTML together is not quite turing complete either.

The combination of CSS and HTML plus an external source that repeated clicks the mouse is turing complete.

I could be remembering this wrong, however.

It is (and has been since the css 2.0 era) if you include user clicking mouse.

There is a famous demo of rule110 in css at http://eli.fox-epste.in/rule110-full.html

Mouse is not necessary using CSS 3 (animations); Minesweeper[1] is enough to show Turing completeness.

[1] http://web.mat.bham.ac.uk/R.W.Kaye/minesw/infmsw.pdf

edit: ^ previously said "with css variables to hold state" or something similar (or my wires got crossed and I saw that somewhere else)

CSS variables can't be set by animations yet without JS's CSS Houdini giving them a type - a CSS @ property is in the works to do it without JS though!

I would say no because the core boolean mechanic that allows CSS-Sweeper to exist cannot be inverted directly (NOT, !). In order to invert anything here, you have to start with an inverted copy of every bit and do the opposite calculation at every &, |, etc to always have a "NOT" var to reference. Like a shadowy, anti-vein, copy of the main logic.

There are several edge cases where a sort of simile of NOT is possible though. You can branch from truthy/falsey into falsy/truthy numbers. And if is something is falsey you can "else" into another action.

Just can't "else" from a truthy state without the ...anti-vein... always being present.

It’s not.