Sujet : Re: Pre-main construction order in modules
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.c++Date : 01. Apr 2025, 22:20:49
Autres entêtes
Organisation : None to speak of
Message-ID : <87h637poi6.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7
User-Agent : Gnus/5.13 (Gnus v5.13)
Michael S <
already5chosen@yahoo.com> writes:
On Tue, 1 Apr 2025 13:55:43 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
On 4/1/25 00:29, Jakob Bohm wrote:
However treating the standard text as an imperfect description of
traditional compiler techniques used for 2nd. Edition compilers
makes much more sense .
No, that does not. The standard was never intended as a description of
how compilers actually work, it was always intended to be a
description of requirements on how they should work.
>
It sounds to me like a revisionisms.
Most language standards are intended to codify commonalities of work of
existing compilers. That applies to C++98 and mostly, although not
completely, to the following C++ standards.
I disagree. Many language standards are *based on* the behavior
of existing compilers. In the case of C, for example, there were
multiple implementations before the first standard was published, and
the standard was largely based on their behavior (and on K&R1). The
C++ standard evolved similarly; there were several implementations
and books before the first C++ standard was published.
But once a standard is published, it is a set of requirements on
conforming implementations and programs. Note in particular that
standards typically don't mention any specific implementations,
and that implementations have had to be changed to satisfy the
standard's requirements.
I think of a language standard as a proposed contract between
implementers and programmers. If an implementation claims
conformance, programmers have a right to expect conforming code to
behave as specified by the standard. But neither implementers nor
programmers are necessarily required to accept the contract.
There exist exceptions, for example, Ada83. But they are exceptions.
Ada 83 was unusual in the sense that the standard was deliberately
developed first, and implementations followed (though a lot of it
was based on other existing languages). But once published, the
Ada standard served much the same purpose as the C and C++ standards.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */