DEV Community

Discussion on: So, how many of you respect CSS as a programming language?

Collapse
 
collingskenny profile image
Kenny Collings • Edited

I do not think a programming language needs to be turning complete. In fact, I don't think "computer science" defines what a programming language is.

Computer science, however does define a formal language. From the bible of computer science, Introduction to Algorithms, "a language L over [an alphabet] is any set of strings made up of symbols from [that alphabet]." Basically, any series of words made using a defined set of letters is a language. This is incredibly broad. A language can include everything from the null language (a language of nothing), to turning complete languages, to even human languages like english. In automata theory, the simplest languages defined is the language of a DFA, or a regular language. DFAs, by definition, do not have to be turning complete.

If however, we want to define what a programming language is we have to go broader. From the bible of the internet, Wikipedia, "A programming language is a formal language comprising a set of instructions that produce various kinds of output." By this definition CSS IS A PROGRAMMING LANGUAGE. It is a formal language (see definition above) and it's set of instructions provide an output that shape the web in beautiful ways.

From my understanding of computer science, turning completness is a descriptor of some programming languages, not the other way around. Programming languages come in all shapes and forms, from regex to javascript, from html to scratch.

I am far from an expert in this field, and this is my interpretation and understanding of mathematics, so please correct me where I am wrong! Programming languages are really cool and I think it is amazing that computer science is really just an offshoot of linguistics! 😁 Have a nice day!

Collapse
 
ajxn profile image
Anders Jackson

About the first definition about formal language.

Not all languages are computer languages, even if they fall in that definition like HTML or regular expressions. Nor is grammar like LR(1) or LL(n) grammars, even if they can be used to define grammar of programming languages.
You see, DFA and grammars are important tools to make usable programming languages.
And all languages doesn't need to be abel to be described with DFA and with grammars. Like FORTRAN IV.

DFA and grammars and HTML and CSS are still not part of the sub group of languages that is programming languages.