1

Are all those markup languages programming languages?

For example XML or HTML are programming languages?

tsilb
  • 7,977
  • 13
  • 71
  • 98
giri
  • 26,773
  • 63
  • 143
  • 176

4 Answers4

5

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
  • 27,253
  • 7
  • 76
  • 97
  • 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 Jan 21 '10 at 20:17
5

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
  • 67,514
  • 53
  • 213
  • 334
1

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
  • 62,085
  • 98
  • 303
  • 499
0

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
  • 476,176
  • 80
  • 629
  • 1,111