(Prompted by a thread on HackerNews, which quickly transitioned into debating the merits of LaTeX as a markup language and typesetting system: https://news.ycombinator.com/item?id=7278907.)
[TikZ] is a perfect example of TeX's missed potential: it is an outstandingly well designed DSL for diagram creation, embedded in an insane macro language. The moment you try to do anything nontrivial that exploits the programmatic (rather than purely declarative) nature of TikZ you immediately run into wall after wall trying to express basic programming concepts in the host language, TeX.
For example, two common patterns I have seen frequently arise as perfect uses for a programmatic diagram description:
-
using computed coordinates and transforms to construct complex paths and diagram layouts from the composition of basic geometric reasoning;
-
using abstraction to tersely encapsulate common visual components, both for simple iteration over many similar components, or for higher-order encapsulation of