Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!s41.csrd.uiuc.edu!eijkhout From: eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) Newsgroups: comp.text.tex Subject: Re: Why use TeX if ... Message-ID: <1991May10.211802.4344@csrd.uiuc.edu> Date: 10 May 91 21:18:02 GMT References: <1991May9.164341.14084@csrd.uiuc.edu> <1991May9.204113.17636@beaver.cs.washington.edu> <1991May10.065219.23433@agate.berkeley.edu> Sender: news@csrd.uiuc.edu (news) Organization: UIUC Center for Supercomputing Research and Development Lines: 65 edward@priam.Berkeley.EDU (Edward Wang) writes: >In article <1991May9.204113.17636@beaver.cs.washington.edu> pauld@stowe.cs.washington.edu (Paul Barton-Davis) writes: >>The hacking problem is primarily caused by the fact that the TeX >>extension language was designed (apparently) as a macro replacement >>language. If TeX has a "normal" or "proper" programming language, then >>it would a lot easier to extend, without getting used to its >>arcane grammar. What do you mean 'arcane grammar'? TeX, like that other symbolic language Lisp, has no syntax to speak of. Control sequences are trivially recognised, macro argument absorbtion uses only the simplest type of pattern matching. Some trivial facts about braces, and there you have the whole of TeX. But I do agree that the language is arcane. This is a consequence of the fact that TeX is not really processed by a single interpreter, but rather by three or four processor. 1/ The input processor maps from OS-characters to tokens (with confusion number one: OS-characters are not TeX character tokens); 2/ The expansion processor (roughly the programming language level) tackles certain control sequence tokens (confusion number two: exactly what is expandable), and 3/ The execution processor (roughly the typesetter) accepts executable control sequences and characters and makes lists (hor/ver/math) out of them. These three terms, by the way, are coined by me in an attempt to explain TeX's workings, both in an article in the next issue of TUGboat, and in my upcoming book on TeX. >I agree. I can think of three things wrong with the Tex language: >textual substitution macros (rather than functions or even >Lisp-like macros), One. Lisp has (as I said above) like TeX the 'program is data' principle; macros accept arbitrary pieces of list and does textual substitution. >dynamic scoping (lexical is better, both is best), Sorry, am not that kind of computer scientist. I don't know what you mean by this. Examples would be appreciated. >lack of a programmer-visible representation of text (boxes are not enough). This would be fun, yes. >On the last point, it would be sufficient to have a side-effectless >way to map text (strings as in the input document) into typeset text. >As it is, the result is inconsistencies like Latex's fragile commands. You're subject to confusion number one here: TeX's characters have a category code, so there is no one mapping from input text to typeset text. The mapping depends on the catcode assignments. Which can be changed by that very text. This is not quite what's the trouble with LateX's fragile commands, but it has to do with it. Victor.