Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Pre-main construction order in modules Date: Tue, 01 Apr 2025 14:20:49 -0700 Organization: None to speak of Lines: 46 Message-ID: <87h637poi6.fsf@nosuchdomain.example.com> References: <20250401231040.00007eeb@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Tue, 01 Apr 2025 23:20:50 +0200 (CEST) Injection-Info: dont-email.me; posting-host="e17a10b86713ca024610b42adb491697"; logging-data="57818"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Rs6qkLcqfEhOJb7y6fcg9" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:SxIsJxGM2vsh9y0Q9Ogkb1DkcQA= sha1:uLdi/2J569U321r/27ERVYMrkBI= Bytes: 3402 Michael S writes: > On Tue, 1 Apr 2025 13:55:43 -0400 > James Kuyper 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.com void Void(void) { Void(); } /* The recursive call of the void */