Good answer. TeX is an input language and is fairly good at what it does for mathematicians. From a programming language and systems point of view, it is an ancient, ad hoc mess. TeX could be used as a computer representation, but it fails for that purpose for lots of reasons, several of which you mention here.