chris blogs

February 2005

09feb2005 · TeX in Ruby

Today in #ruby-de, I came up with the idea of re-implementing TeX in Ruby. What first looks like “Mission Impossible” turns out not to be as hard as it seems (I hope, at least :-)):

  • The font issue is solved. Knuth did a great job doing Computer Modern in Metafont, and there is no reason to repeat that amazing work. Metafont fonts (rather, their output) should be easily usable and TrueType/OpenType support can’t be that hard either.

  • We live in the 21th century. There is no need to reimplement the Pascal “standard” library anymore. (And neither doing our own dynamic memory stuff, or transforming the host character encoding to ASCII.)

  • PDF should be the main output format. Although other output formats would be possible (please, let DVI rest in peace), PDF is the most popular and widely supported format for printing. (Postscript would have been a possibility, but lacks good graphics support and hyperlinking.) If pdfTeX can do PDF, we can too.

  • We have Unicode. Unicode should be the default encoding, addressing issues that Omega tries to solve.

  • We have Ruby. Ruby should be used for all issues addressing programming. No more ugly hacking, fiddling with \expandafter or \catcode. Ideally, we would have a high-quality output library that gets driven by:

    1. XML (possibly XSL-FO?)
    2. A LaTeX-like system (the library should not care about semantics)
    3. plain TeX (this will be a mess to implement, and is probably not needed)

We should not strive for bug-to-bug—whoops, those don’t exist in TeX—bit-to-bit compatiblity with TeX, as this wont result in progress, but rather playing at the same level of output quality. I hope the result will be more satisfying to use than TeX, which clearly shows it’s age.

If you are interested about helping/starting this, not-that-easy task, please show up on IRC or mail This is a task that cannot be done alone. (Hey, I’m not Knuth…)

Right now, I’m investigating a reimplementation of the formula subset of TeX in SML, as I have no idea of the internals of that.

NP: Dan Bern—Are You Gonna Follow Your Soul?

Copyright © 2004–2016