Hacker News new | ask | show | jobs
by svat 3067 days ago
I wonder whether this is the right approach. TeX itself is one of the most heavily documented programs in existence. Not only are its workings documented in detail in The TeXbook (and a host of other books by other authors, such as Eijkhout's TeX by Topic) but even the program itself has been written in a “literate programming” style, with pretty formatted source code (with profuse comments) available in print (Vol B of Computers and Typesetting) and as a PDF (http://texdoc.net/texmf-dist/doc/generic/knuth/tex/tex.pdf), there's a detailed history/retrospective and log of every change that went into the program (see Chapters 10 and 11 of the book Literate Programming, though the log without explanation is also available online http://texdoc.net/texmf-dist/doc/generic/knuth/errata/errorl...), and there are even 12 hours of video of Knuth talking about the internals of the program (https://www.youtube.com/watch?v=bbqY1mTwrj8&index=12&list=PL...).

So when the article says:

> To reproduce all of LaTeX in the browser is too much to ask

I wonder why? The file tex.web is less than 25000 lines long, much of it comments, so I'd estimate that TeX itself is only about 20000 sloc (in fact tangle on tex.web generates a Pascal file tex.p which is only 6115 lines long). This is not a lot IMO, and it would be a lot better to actually re-implement this, with additional support for things like getting the parse tree etc.