From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Why are Ada compilers difficult to write ? Date: Fri, 22 Jun 2018 07:01:39 +0200 Organization: Adalog Message-ID: References: <584564c2-9f64-4965-b045-535cdaf899c0@googlegroups.com> NNTP-Posting-Host: wZ92b1Jf6WKcedzDuqoRAA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: fr Openpgp: preference=signencrypt Xref: reader02.eternal-september.org comp.lang.ada:53241 Date: 2018-06-22T07:01:39+02:00 List-Id: Le 21/06/2018 à 22:18, Dan'l Miller a écrit : > Pascal, what makes freezing rules difficult when writing Ada compilers? > 1) Is it that the freezing occurs later than what the compiler writer > would find convenient, forcing the compiler writer to keep clay soft > when it already seems to be in the kiln?> 2) Is it that freezing occurs prematurely, requiring the compiler > writer to expend effort enforcing the freezing too early for no good > reason?> 3) Is it that freezing rules are non-uniform/arbitrary/capricious > across language constructs?> 4) Something else? > 5) All of the above? I'm not Pascal ;-), but I'll answer these... Please do not assume that language designers are masochists that make the language unnecessarily complicated for no good reason. There are good reasons, and these can usually be found in the annotated reference manual. For example, if freezing happened at the end of a package (as you suggest), it would not be possible to declare a variable or a constant in the same package as its type (the type has to be frozen - i.e. its representation determined - for an object to be declared). Therefore, the declaration of an object freezes the type. Then, when you freeze a type, of course you have to freeze all types of subcomponents. etc... You end up with 13.14. You may argue that the way 13.14 is written is not very... pedagogical. True, but this is really for compiler writers, therefore rigor of definition is more important than clarity of the statement. The casual user just needs to rely on the compiler's message telling that some clause happens too late. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr