[TUHS] [patch] do not strip mdoc macros

Doug McIlroy doug at cs.dartmouth.edu
Sat Mar 16 07:21:53 AEST 2019


>> But sed, awk, perl, python, ... lex and parse once into an AST or
>> bytecode, removing the recurring cost of comments, etc. that impact
>> groff.  So I don't think it's an even comparison.
> 
> Of course it's a valid comparison.  Which sed or awk or shell script is
> distributed in a stripped/compressed form?  Do they store their AST
> somewhere, so as to avoid recompilation?  They do not.  Just as
> with groff, every parse starts anew.

Comments inside of a macro definition get scanned each time it's called.
This justifies the first paragraph above.

In the wild, almost all comments occur outside macro definitions.
This justifies the second.

Thus comments are harmless in practice.

Doug


More information about the TUHS mailing list