views:

296

answers:

4

CSS isn't, insofar as I know, Turing complete. But my knowledge of CSS is very limited.

  • Is CSS Turing complete?
  • Are any of the existing draft or committees considering language features that might enable Turing completeness if it isn't right now?
+4  A: 

As per this article, it's not. The article also argues that it's not a good idea to make it one.

To quote from one of the comments:

So, I do not believe that CSS is turing complete. There is no capability to define a function in CSS. In order for a system to be turing-complete it has to be possible to write an interpreter: a function that interprets expressions that denote programs to execute. CSS has no variables that are directly accessible to the user; so you cannot even model the structure that represents the program to be interpreted in CSS.

DVK
CSS isn't executable in any way. The person who wrote the quoted comment doesn't seem to understand that. :-\
Ryan Prior
CSS is a set of instructions to a processor (layout engine). What's so not "executable" about it?
DVK
+1  A: 

No and No, respectively.

(as far as I know)

Deltics
+4  A: 

CSS is not a programming language, so the question of turing-completeness is a meaningless one. If programming extensions are added to CSS such as was the case in IE6 then that new synthesis is a whole different thing.

CSS is merely a description of styles; it does not have any logic, and its structure is flat.

Ryan Prior
Also (IIRC), there is some ambiguity about which styles take precedence when multiple conflicting (duplicate) styles are used. And then there is the slightly different ways that different browsers implement/interpret markup styles to deal with.
Loadmaster
*"CSS is not a programming language, so the question of turing-completeness is a meaningless one."* Tautological sentences are tautological.
Adam Davis
A: 

CSS doesn't have conditionals or branching (lacks the if statement), so it can't be a Turing-complete language.

CSS is just a presentation extension to HTML and markup languages can't be Turing-complete.

http://en.wikipedia.org/wiki/Turing_completeness

omgzor