3 ms·
The author seems to mix up three quite separate things. First, the fact that the core TeX engine is written in WEB -- a literate programming system with Pascal
by gjm11 14y ago
The author seems to mix up three quite separate things.
First, the fact that the core TeX engine is written in WEB -- a literate programming system with Pascal as the underlying programming language. This is responsible for maybe 1% of the author's problems, but the author writes as if it's the main issue.
Second, the fact that the LaTeX ecosystem includes things like kpathsea built out of C, bash scripts, and baling wire. This is certainly a real problem for any porting effort.
Third, the fact that LaTeX itself equals the TeX engine plus lots (lots and lots and lots) of other bits written in TeX. TeX is not only a typesetter, it's a (horrible, horrible) programming language, and LaTeX is built out of lots of packages implemented on top of that. This is what makes LaTeX slow; it has nothing whatever to do with Pascal or WEB or even bash scripts.
Rewriting the WEB stuff in modern C (or CWEB, if the people concerned wanted to preserve the literate-programming approach) might help with portability. It would do nothing to help with speed. In fact, rewriting the old Knuth code would probably make the system slower -- there are things not to like about Knuth's coding style, for sure, but no one would accuse him of not being sufficiently concerned with efficiency or of not being able to write efficient code. What it would take to make LaTeX much faster is not a from-scratch rewrite of the codebase the author complains about, but a from-scratch redesign to enable much more of the work to be done in native code instead of in packages implemented in a nasty macro-expansion language, and to make the extension language nicer and more efficient. (Most likely, by replacing it with Python or Lua or something; see http://www.luatex.org/ http://www.luatex.org/ for an attempt to do something rather like that.) Plus a monstrously large project to re-implement all the packages that make LaTeX what it is on that new substrate.
- keenerd 14y agoYou get 95% of the functionality in 1% the size with a 50x boost in speed by using Lout instead of LaTeX. http://lout.wiki.sourceforge.net http://lout.wiki.sourceforge.net
- gjm11 14y agoMaybe Lout has improved a lot since I last tried it -- which, admittedly, was a long long time ago -- but my recollection is that the quality of its typesetting was always very greatly inferior to that of TeX's. It might have 95% of the functionality as measured by feature-counting (though ... there are a lot of LaTeX packages out there, doing all kinds of wacky things) but that's not worth much if the output just doesn't look good.