Jerry said:
[ ... ]
I don't see how that quote says anything about whether interpreters are
allowed.
It seems to be that "interpreter" describes the structure of an
implementation. To repeat: "This International Standard places no
requirement on the structure of conforming implementations."
I don't see how that could be read as anything short of explicit
permission for an implementation to be an interpreter.
Interpreters (in the traditional meaning of the term) could be ruled out by
requirements of the standard upon the *behavior* and not upon the
*structure* of an implementation.
It explicitly places NO requirement on the structure of a conforming
implementation. How can that possibly be read as limiting the range of
possible implementations in any way?
I guess, I was not clear about this. I think we are in agreement here. I
already said, in the part you snipped,
In other words an interpreter is clearly a possible structure for an
implementation.
However, whether the implementation has to issue all required diagnostics
independently of whether a program is executed or whether it is allowed to
issue some of those diagnostics while the program is running and maybe even
only when flow control takes certain paths, this question is about behavior
not structure; and the standard clearly imposes restrictions on the
behavior of conforming implementations.
So even an interpreter could be required to perform static analysis of a
program before execution (or at least independently of execution) so that
an ill-formed program will be diagnosed as such even if the path of
execution never hits upon the ill-formed line. I think that the standard
actually requires that explicitly when it asks that for every ill-formed
program there has to be at least one diagnostic message. (We already agree
in the next paragraph that this is easy to satisfy: however an interpreter
in the traditional sense would not do so.)
I agree.
I still really don't agree in this respect. When you read "Having done
so, however, they can compile and execute such programs." as meaning
"the diagnostic must take place before execution, but can take place
during or after compilation" it sounds extremely strained to me --
you're taking exactly the same words to specify extremely tight
sequencing requirements in one part, but virtually no sequencing
requirements in the other part.
I already provided a reading of "compilation" that does not run into this
kind of problem (namely compilation=code generation). It is a good principle
to interpret terms so that the provisions of the standard come out
meaningfully. The reading I propose does that.
However, I admit that this reading is called into question by the
admissibility of non-compiling implementations. Note, however, that the
possibility of non-compiling implementations makes it somewhat hard to take
the term "compilation" in this paragraph too serious at all. That, however,
does not apply to the term "execution". (I am not inclined to
treat "compile and execute" as a compound phrase: for one, it is clearly
possible that the implementation compiles a program but does not execute
it; for a second reason, refer to the my response to the next paragraph.)
It seems to me that when the exact same words are applied to two things
(compilation and execution) they have to be applied in the same way to
both. If this is taken as meaning that any required diagnostic must be
issued before execution begins, then it also requires that it be issued
before compilation begins. If it means it can be issued sometime during
compilation, then it also means it can be issued sometime during
execution.
I admit that this is a possible interpretation. However, it throws the
words "Having done so, ..." right out of the window. And I think, the
rational you provide is shaky: you want to apply the phrase "Having done
so, however, they can do X" equally to "compile " and to "execute".
However, you end up not applying the phrase at all -- you end up ignoring
it. All that because your reading of "compile" renders a part of the
provision unenforcible.
I disagree with this approach: One of the principles in interpreting
normative materials such as laws or contracts is that the inapplicability
of one provision does not, in itself, void any other. Even if there are
compelling reasons to read the term "compilation" in a way that makes it
impossible to issue diagnostics before, then this renders only a certain
normative aspect of this clause non-sensical. Any other aspect of this
clause should be unaffected: and it *is* possible to issue diagnostics
before execution regardless of how you read the term "compilation". The
idea behind this hermeneutic guideline is to preserve as much of the
normative force of the wording as possible.
Best
Kai-Uwe Bux