On 5/8/23, Douglas McIlroy <douglas.mcil...@dartmouth.edu> wrote: > K-P would not be a mere add-on to groff. K-P knows in advance the > shape of the space into which a paragraph must fit, but groff doesn't. > This means a whole lot of groff state must be carried along with the > K-P dynamic program.
I don't doubt your analysis of the challenges of implementing K-P, but it's been done in at least two other roff systems (Heirloom and neatroff), so it's attainable in a roff framework. In both of those it's implemented in the core language, not macro space. I don't know how feasible Branden's macro idea is, but I like the novel concept! Plus, a macro implementation is a whole lot easier for users to tinker with if they're largely happy with K-P but don't like this or that particular aspect of it. They could tweak it and try their changes immediately without needing to rebuild groff. And doubtless whatever core language features would need to be added to enable a hypothetical K-P macro set will find other creative uses as well.