top | item 41449409

(no title)

TheGlav | 1 year ago

It really is a whole alien domain to itself. The syntax being so foreign to most developers doesn't help. But it's so powerful, incredibly powerful, and in most browsers, extremely efficient.

The extremely vast majority of web app developers don't need 99% of what CSS can offer. But it's neat to know it's there.

discuss

order

Jerrrrrrry|1 year ago

  whole alien domain
  so foreign to most developers
  doesn't help.
  it's so powerful, incredibly powerful,
  most browsers, extremely efficient.
That is because CSS is a different Chomsky Grammar than HTML and EMCA - intentionally not Turing complete, nor-self referential - why the "has(" puedo property was so problematic.

That also relates to sibling comments about the awkwardness of the pairing to Javscript, which is of a higher grammar, and Turing Complete*.

It also relates to the "awesomeness" of the "fire-and-forget" nature of CSS - unless very specifically hooked, it can be hardware-accelerated nearly care-free because it isn't per frame to the DOM, which Javascript is (meaning HTML, it's own Chomsky Grammar!)

It is what it is, the epitome of an optimized amalgamation of technical debt we call the modern web specification.

kaba0|1 year ago

> That is because CSS is a different Chomsky Grammar than HTML and EMCA - intentionally not Turing complete, nor-self referential - why the "has(" puedo property was so problematic.

It will be a nitpicky comment, and I’m sure you mean it this way, but it wasn’t clear to me: a language’s syntax being in one type of grammar class is irrelevant to its execution semantics corresponding to a recognizing automaton. So you can have a language with a regular syntax that is Turing complete just fine.

In fact, most languages’ syntaxes are context-free (sometimes with some escape hatches), but are semantically Turing-complete.

idoubtit|1 year ago

> That is because CSS is a different Chomsky Grammar than HTML and EMCA - intentionally not Turing complete

CSS has been Turing complete for many years.

You can simulate Turing machines with pure HTML+CSS, e.g. https://github.com/yrd/tm2css

"Rule 110" which implies Turing-completeness has also been implemented in CSS, e.g. http://eli.fox-epste.in/rule110/

samatman|1 year ago

You could just call it syntax, you know.