views:

156

answers:

5

Hi

Are all those markup languages programming languages?

For example XML or HTML are programming languages?

A: 

No. Why do you ask? Any reason? Any other background you can give on your question?

S.Lott
+1  A: 

It depends on the language. There are turing complete markup languages(including XMLish) of course, they aren't common though because they are ugly.

Earlz
+3  A: 

Markup Languages could more accurately be called Data Description Languages. They describe your data.

While Programming languages are used to instruct the computer to perform logic.

Matthew Vines
And where do you draw the line? TeX: markup or programming language? XSLT: markup or programming language (keeping in mind that XSLT **is** XML)? PostScript? … S-Expressions? M-Expressions? Those actually illustrate nicely that programs *are* data.
Konrad Rudolph
+4  A: 

The term "programming language" isn't defined rigorously enough for this to have a good answer. It really depends on the context in which the term is being used. In many contexts (usually if languages like C++, D or Java are being heavily mentioned) a "programming language" has to be Turing complete. However, XML and HTML do meet a more lenient set of criteria. They have a grammar and are textual means of expressing to a computer what you want it to do. Therefore, in some contexts they could be considered declarative programming languages.

dsimcha
A: 

As the terms are most often used, I'd say HTML and plain XML both fall outside the realm of programming languages.

That said, quite a bit of HTML includes bits and pieces of JavaScript, which would have to be considered a programming language by almost any definition. Likewise, the "X" in XML is short of eXtensible. That (indirectly) means you can attach nearly any meaning you want to something stored in XML. In this case, the structure of the source code and the structure of the XML can be direct reflections of each other. Nonetheless, these are really examples of the markup language being a container for source code (or object code, though that's somewhat less common) for code written in some separately defined programming language, which doesn't change the fact that the markup language itself isn't really a programming language.

There are more borderline cases (e.g. defining animations in HTML with CSS) but while they approach the border, at least right offhand none occurs to me that really crosses the border to the point that you unequivocally call either a programming language.

Jerry Coffin