- From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
- Date: Tue, 29 Mar 2022 15:52:55 -0600
- To: Steven Pemberton <steven.pemberton@cwi.nl>
- Cc: Norm Tovey-Walsh <norm@saxonica.com>, public-ixml@w3.org
C. M. Sperberg-McQueen writes: > If we are communicating with an ixml processor, it is not necessary to > use a pragma to communicate information already communicated by the > grammar, so I think the only plausible use cases for pragmas are for > communicating information that is not expressible using ixml as > specified. That was carelessly put. My apologies. I should have said that "many" (not "the only") plausible use cases for pragmas in a language involve communicating information not expressible in the language as specified. Another class of use cases involves information which *can* be expressed without the pragma, but which the pragma allows to be expressed more conveniently. The use case John Lumley sometimes brings up is an example: it uses a pragma to request a specified rewriting of a rule or grammar. As we know, the rewritten grammar is expressible in ixml but is roughly double in size and error-prone to edit. (Here, too, the Pascal standard seems to have been familiar with the phenomenon: it foresees Pascal implementations providing alternative synta for some constructs and requires that conforming implementations (a) not *require* such alternate syntax to be used, and (b) be able to treat it as an error.) Pragmas that request a behavior that could be achieved by a source-to-source transformation of the ixml grammar (or input) can of course in principle be dispensed with: the user could write a shell script which accepts a grammar G and an input I and produces output, by first running a grammatical transformation on G to produce grammar G', and then running a conventional ixml processor to parse I against G'. There are some evident advantages if the user does not have to write such a shell; I assume that similar advantages persuaded the designers of C to specify that the pre-processor is part of any C compiler. Pragmas providing information that has no expression in standard ixml cannot, in principle, be dispensed with in the same way. For that reason I tend to regard them as more compelling use cases. And for the same reason I would be reluctant to forbid pragmas which extend the base spec, even if I thought it might be possible to formulate words in the spec which could capture that thought in a suitable way. (Since I believe there is no real possibility of capturing such a requirement in testable spec prose, let alone enforcing it, the idea is in any case I think purely a thought experiment. That is another reason, perhaps, that I am surprised that Steven expresses surprise that the pragmas proposal allows pragmas to be defined with meanings that cannot be captured in standard ixml. I don't think there is any coherent way to forbid it, so I am surprised that Steven appears to have expected it to be forbidden.) -- C. M. Sperberg-McQueen Black Mesa Technologies LLC http://blackmesatech.com
Received on Tuesday, 29 March 2022 21:54:06 UTC