by fosap · 12y ago · 0 comments
TeX is not a programming language, it's two programming languages. These languages have a self modifying syntax and is parsed with state machines that can be changed. Changing the syntax into something meaningful other is yet quite impossible. It's meant not meant to be able to read markdown or xml.
These Languages are so odd even division of two variables is non-trivial, yet both are truing complete and servly limited, a classic turing tar pit, even division of two variables is nontrivial.
The hole TeX thing is a huge state machine, and uses imperative paradigms, while declaratives would have been much nicer.
All that leads to a horrible, monkey patching coding style.
On the internals there are other horrible things: Unicode was known when it was invented, font formats are a mess (even with XeTeX; I think I can't have another mapping for my the cursive style of a font then for regular. Good thing is the very verbose documentation for fontspec does mention "mapping" twice)
Certainly not, not even latin-1 was existing when TeX was created.
Perhaps some dyslexia lead someone to believe they were invented in the same year? :-)
If does follow imperative paradigms, as it does, the programming language part is essential if you want to do anything meaningful with it. If exotic task you never need in typesetting, such as multiplication, is hard to implement, something is wrong. And IMO that is why LaTeX is so odd and hackish.
Context is much better, tough.
And, by the way, the unfortunalty dead ANT uses a nice Haskell like language and is still a typesetting DSL.
http://sourceforge.net/projects/ant.berlios/ https://web.archive.org/web/20090310012257/http://ant.berlio...
Knuth: So TeX is a programming language but I had to put in those features kicking and screaming.Yes, certainly, but you said (https://news.ycombinator.com/item?id=8615643):
> TeX is not a programming language.
rather than "TeX is not intended to be a programming language." It is nit-picking to be sure, but I think that, if the creator of a language (especially one who knows his stuff as Knuth does) says that it is a programming language, then it is.
Another appeal to (a lesser) authority—the TeX Users Group (https://www.tug.org/whatis.html):
In summary, TeX is a special-purpose programming language that is the centerpiece of a typesetting system that produces publication quality mathematics (and surrounding text), available to and usable by individuals.
… and an appeal to the fact that people have written programs in it: http://stackoverflow.com/a/1931289.(P.S. To "so, is XSLT a programming language because of, say, http://www.unidex.com/turing/utm.htm ?" I say "sure, why not?" What is the point of excluding something from being a programming language?)
They are hardly programming languages.