13
\$\begingroup\$

CSS can simulate rule 110 and thus is turing complete. Thus HTML + CSS is considered a programming language for our definition. However, as user @TimmyD mentioned appropriately

HTML+CSS is Turing-complete so long as Turing is clicking buttons making the program go. ;-)

(used with permission).

Thus I propose that we should ban HTML/CSS as a language. In the interests of full disclosure I have written an answer myself in HTML/CSS. However I am still in favor of this. This does bring up the broader question of whether a language which requires a human to "crank" it by feeding it meaningless input is a language.

Related discussion on Stack Overflow (Credits to minxomat for bringing this up in comments).

\$\endgroup\$
4
  • 7
    \$\begingroup\$ It can check if a number is prime, thanks to @minxomat. \$\endgroup\$
    – user48538
    Commented Aug 5, 2016 at 18:20
  • 4
    \$\begingroup\$ Current consensus allows for HTML+CSS as a programming language. Additionally, going by your last sentence, Vim or the like can be "cranked" by hand or fed in via a command-line. What's to prevent someone creating a JSFiddle that "cranks" the buttons? Then we'd just call that JSFiddle the interpreter running the code. \$\endgroup\$ Commented Aug 5, 2016 at 18:34
  • \$\begingroup\$ @minxomar that is where I got this argument from. Thanks for linking it here, I should have linked it myself. \$\endgroup\$ Commented Aug 11, 2016 at 0:18
  • \$\begingroup\$ Is the downvoter willing to discuss why s/he decided to downvote. Perhaps leave some feedback so I can edit the post or clarify something? \$\endgroup\$ Commented Aug 16, 2016 at 18:58

1 Answer 1

23
\$\begingroup\$

Yes

CSS is a programming language. From What is a programming language, which is the authoritative answer, and has a score of 44:

This definition does not require a language to be Turing-complete (although it certainly permits any Turing-complete language). This is intentional. Turing-completeness is unnecessary for many problems on this site, and there are interesting non-Turing-complete languages and interesting languages whose status with respect to Turing-completeness is unknown.

(Emphasis added)

If it's turing complete, than it meets all of other criteria for "being a language" automatically. That doesn't mean it's easy to use, but if you can write programs for adding and primality checking in brainfuck, by extension you must be able to in CSS. (And game-of-life for that matter)

Now, as for the "crank" issue. Yes, CSS is not fully automated. However, languages do not have to be automated! We allow vim and the worse editor emacs, and both of these languages require a user to type the entire program in to "run". But, this is not an issue for a language to be valid or not. As long as a language has the right computational abilities, we can consider it a language, and it is valid for answers on this site.

One can even imagine an entirely mechanical language, that requires turning a literal crank. If such a language were to exist, as long as it could take input and produce output, and there was some reasonable way of scoring it in bytes, I would consider it to be a valid language for the site.

\$\endgroup\$
13
  • 8
    \$\begingroup\$ I would give it +2 for the struck through worse editor emacs \$\endgroup\$ Commented Aug 5, 2016 at 18:51
  • \$\begingroup\$ Accepted the answer as it seems like a fair consensus. Congrats on 10k! On a similar note does that mean that a fully mechanical language could be considered a language? \$\endgroup\$ Commented Aug 5, 2016 at 18:54
  • \$\begingroup\$ @RohanJhunjhunwala Even though I agree with this answer (since I posted it myself), it would probably be best to wait a couple days and see if there are any alternating opinions, and if the general community agrees too, \$\endgroup\$
    – DJMcMayhem
    Commented Aug 5, 2016 at 18:55
  • \$\begingroup\$ OK unaccepted. (these characters somehow add more meaning to the comment) \$\endgroup\$ Commented Aug 5, 2016 at 18:56
  • 3
    \$\begingroup\$ "both of these languages require a user to type the entire program in to "run"" Actually, you can run vim keystrokes from the command line (which is why you're allowed to count vim answers in bytes). \$\endgroup\$
    – Doorknob
    Commented Aug 6, 2016 at 1:39
  • 1
    \$\begingroup\$ @doorknob Well, really it's more because there is a one to one mapping of keystrokes to bytes. IMO if vim was only runnable with keystrokes, it would still count as a valid "programming language", although whether it should be counted in bytes or keystrokes is another matter. \$\endgroup\$
    – DJMcMayhem
    Commented Aug 6, 2016 at 16:19
  • 1
    \$\begingroup\$ Even if vim required a user to type in the program once at the beginning, that is very different from requiring the user to make logical decisions and perform actions (“find the next orange checkbox and click it” or “press the key indicated at the top of the screen”) to power each computation step. Would you consider plain text a programming language, given that you can provide plain text instructions to the user explaining how to perform a desired computation step-by-step? \$\endgroup\$ Commented Aug 7, 2016 at 23:21
  • 1
    \$\begingroup\$ @AndersKaseorg the user isn't doing math, but spam clicking a button, I do feel like a crucial difference lies there. Plus a JSFiddle can just crank the button. \$\endgroup\$ Commented Aug 7, 2016 at 23:26
  • \$\begingroup\$ For HTML/CSS, does the crank need to be turned a specific number of times? Aka, if my challenge is: "Output 'X' 4 times", and my program requires that the crank be turned 4 times, then we are effectively storing data in the number of crank turns. \$\endgroup\$ Commented Aug 8, 2016 at 17:32
  • \$\begingroup\$ the code can be written so that efter the needed amount of cranks, it will produce no more output @NathanMerrill from what i understand \$\endgroup\$ Commented Aug 9, 2016 at 2:02
  • \$\begingroup\$ It is a language - however, for the usual definition of programming, it can't be used for programming. \$\endgroup\$
    – user20574
    Commented Aug 15, 2016 at 6:23
  • 1
    \$\begingroup\$ In 1950 it would have been considered a very powerful language, at that time manual operation while computing was the standard. \$\endgroup\$
    – Emmanuel
    Commented Aug 19, 2016 at 11:59
  • \$\begingroup\$ Someone should make a Rube Goldberg "Mechanical Language". \$\endgroup\$
    – mbomb007
    Commented Aug 19, 2016 at 17:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .