0

I read that TeX was written in SAIL and re-writen in Pascal. Do we still use that version today? In my Linux distribution, I use TeX-Live. Does that also use the Pascal version?

Wikipedia says the last major revision was in 1982 and that it's quite stable. So only a few changes have been necessarily over the years.

I don't quite totally agree, since certain layout features are quite difficult to execute, and what if I don't like Pascal?

For my first issue, it may be possible to learn TeX (rather than LaTeX) and address these graphic design issues myself. Still I am rather curious about to layers, thanks.

What language is TeX implemented in?


From blog Implementing TeX in Clojure:

TeX source code is full of examples of what would not be considered good programming style today, such as:

  • global variables
  • one-character variables
  • goto statements
  • procedures spanning hundreds of lines;
  • lots of macros;
  • duplicate code;
  • local variable reuse;
  • single-threaded assumption is “everywhere”;
  • mutability is just “pervasive”

  • 1
    It's implemented in Pascal, but the compilation process used by TeX Live first translates the WEB Pascal source into C. But you don't need to like or dislike Pascal, which has no role whatsoever in using TeX. TeX just uses its own language, like Perl that's surely not written in Perl. – egreg Feb 03 '16 at 22:37
  • "...what if I don't like Pascal?" ... :) – Werner Feb 03 '16 at 22:39
  • 2
    I don't like the Java language -- shall I drop Firefox and Thunderbird then? ;-) –  Feb 03 '16 at 22:41
  • 2
    this must be a duplicate of something but didn't spot an exact match just now. note that you mean tex not texlive, the latter is a distribution of thousands of files written in all kinds of things, your last paragraph about difference between plain and latex seems rather unrelated to the first. the two – David Carlisle Feb 03 '16 at 22:42
  • actually isn't this just a duplicate of the linked question? – David Carlisle Feb 03 '16 at 22:43
  • @DavidCarlisle I was able to find the source code in some kind of Pascal. It compiles to both the book and to TeX itself? – john mangual Feb 03 '16 at 23:14
  • 1
    Yes, in Knuth's WEB system (which he invented in order to write TeX), you write the program and the documentation at the same time---"literate programming." So the pdf you get from entering texdoc tex at the terminal is the documentation, containing the complete program in (theoretically) human-readable format. The same source code can be used to generate computer-readable program code. – musarithmia Feb 03 '16 at 23:21
  • you can call it some kind of pascal or some kind of C . WEB is the language which these days is processed to C then compiled, originally it was processed to pascal then compiled. No actual pascal compiler has been used for decades in the unix (now texlive) version. But the implementation language is rather unimportant to any tex users, just the few who compile from source. – David Carlisle Feb 04 '16 at 00:02

0 Answers0