Insanity. Seriously. Reimplementing Troff is a task best not attempted at all. The grammar is horribly complex, the language riddled with cryptic, arcane features, and most importantly, it's not one program. It's several: the Troff pipeline involves preprocessors, postprocessors, and bundled macro packages, each of which have their own nuances and complications. You'd also be tasked with handling font metrics for device-specific output (PDF, terminal, PostScript, et al)...
Normally I don't discourage people from trying their own implementations, but there are some things you just don't try: hand-rolling your own web browser, writing your own compiler infrastructure, or reimplementing complex, ancient typesetting systems like TeX or Troff. You need to be a special sort of crazy (and patient, and knowledgeable) to want to endure the obvious pains of reimplementing such a complex system. Here's the source code <https://github.com/Alhadis/otroff> for the original AT&T troff, BTW. — John On Sat, 1 Dec 2018 at 02:37, Yves Cloutier <yves.clout...@gmail.com> wrote: > Hello, > > I'm in search of any documentation that provides insight into the design > and implementation of a *roff. > > I know source code exists for a few implementations like Plan 9, Heirloom, > Groff and Neatroff. > > However what I'm in search of is something a bit more high-level than > source code. Rather some design/implementation documentation that explains > an *approach* to implementing a *roff. > > Would anyone know if anything like this exists? > > My google searches how not come up with anything, and was just wondering if > someone somewhere might have such documentation lying around in their > archives. > > regards, > > yc >