groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use various macro packages in the same page (was: Re: Plan 9 man add


From: Ingo Schwarze
Subject: Re: Use various macro packages in the same page (was: Re: Plan 9 man added a new macro for man page references)
Date: Thu, 5 Aug 2021 15:42:43 +0200
User-agent: Mutt/1.12.2 (2019-09-21)

Hi,

G. Branden Robinson wrote on Thu, Aug 05, 2021 at 05:50:49PM +1000:
> At 2021-08-05T00:04:46+1000, John Gardner wrote:
>> Ingo Schwarze wrote:

>>> But the mdoc(7) and man(7) languages can also be regarded as
>>> languages with a grammar

>> I wish people would stop referring to these as "languages". They're
>> macro packages, plain and simple: their "syntax" is that of the
>> language they're written in, Roff. How mandoc(1) implements and parses
>> them is immaterial, especially since mandoc's job isn't to be an
>> implementation of Troff, but to be a formatter for these two very
>> specialised macro sets, using a cherry-picked subset of language
>> features.
>> 
>> It's difficult to get newcomers interested in Troff when they're
>> frequently being told that the program's input language isn't one, but
>> several... only to find out much later on how they really work, and
>> that the system is less complex than they initially believed.

> I don't think Ingo was addressing novices.  From a mathematical or
> computer science perspective, it is legitimate to regard mdoc and man(7)
> as languages.

Besides, it also happens to actually be true that for *roff, the
"input language isn't one, but several".  The tbl(7), eqn(7), pic(7),
grn(7), refer(1) languages and no doubt several others are all
separate languages not built on top of roff(7).  Also, there is
nothing wrong with having several small domain-specific languages
that are well-adapted to their respective domains.  That is not
necessarily more complex than having one giant language covering
everything.  Just like having several small tools than can be piped
together is not necessarily more complex than having one giant
program with lots of options and features.  In both cases, complexity
depends on the specifics.

Besides, nobody doubts that HTML is a "markup language" even though
it's really only XML with some additional rules.  Exactly like, i freely
admit, mdoc(7) and man(7) are just roff(7) with some additional rules.
Heck, even C++ is just C with some additional rules.

Some of those additional rules make part of the syntax supported
by the base language invalid in the derived language and some rules
permit additional syntax not supported by the base language.  In
all the examples provided above, even though the amounts of additional
rules vary.

Yours,
  Ingo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]