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!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: 'Protected' abstract subprograms Date: Sun, 19 Jan 2014 16:07:41 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <839fee13-2743-49f6-a7f3-f95578386201@googlegroups.com> <1aav8alqsnqqv.5urmifgwh1mv.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1390165661 7262 192.74.137.71 (19 Jan 2014 21:07:41 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 19 Jan 2014 21:07:41 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:PbGCN54IR4CRkZMUGMM8X62JFcQ= Xref: news.eternal-september.org comp.lang.ada:18229 Date: 2014-01-19T16:07:41-05:00 List-Id: "Randy Brukardt" writes: > "Robert A Duff" wrote in message > news:wccvbxje5sn.fsf@shell01.TheWorld.com... > ... >> The freezing rules make my brain hurt. Even though I had a hand in >> writing them! ;-) >> >> A better-designed language would not have anything like freezing rules. > > That's a facinating assertion from the guy that's responsible for most the > AARM notes describing the freezing rules. Especially as you guys pretty much > redesigned that area in Ada 95 -- you essentially created a whole new > language design for it. Not really. Ada 83 had "forcing occurrences" regarding rep clauses. And I think a bunch of similar rules regarding premature use of private types. IIRC, we decided that these two sets of rules should be combined. Also, the rules were buggy, and we wanted to fix them. The actual rules in Ada 95 are almost the same as in Ada 83. They don't look the same, because the wording was changed a lot. But the things that are legal and illegal in Ada 83 didn't change much in Ada 95. In other words: Don't mix up "the Ada language" with "the words we use to describe the Ada Language in the RM". The latter can change without changing the former. And in this case, the latter changed a lot while the former changed a little. >... It makes me wonder how a language could be better > designed and not "have anything like freezing rules". Well, I'm too lazy to give all the details, but here's one key point: It is obvious[*] that module specs should not be elaborated. They should be purely a compile-time description of the interface, and should not exist at all at run time. [*] I'm just kidding about "obvious". It took me years to figure that out. But having done so, it's obvious (to me). Another point: Something like Ada's aspect clauses are better than pragmas and separate syntax for rep clauses. That's because aspect clauses are physically attached to the declaration, so there's less of an issue about when things are evaluated. Also, you don't have to refer to the thing by name; you're just saying "this thing has so an so properties". Every time you refer to something by name, you put a (slight) burden on the person reading the code, who has to match up uses with declarations. > After all, a compiler has to have a known representation for types and > objects at some point, certainly before code generation. If one is going to > support some sort of separate compilation (especially *safe* separate > compilation), freezing rules or something like them seems manditory. [There > is an argument to be made that a truly modern language doesn't need to > support separate compilation at the language level, given that it is now > practical to delay compilation until bind time. But that seems awfully > radical and would seem to put an upper limit on the sizes of programs that > could be written in the language. I don't think that's what you meant.] No, that's not what I meant. > Ada's freezing rules are far more detailed than absolutely necessary, but > the obvious way to get simplify them would be to require that all types are > declared before all objects (a-la Pascal) -- and we have evidence that's too > inflexible. There don't seem to be any obvious way to simplify them if > objects can be declared anywhere. I hate that aspect of Pascal. I wouldn't call Pascal a well-designed language, although it is much better than many others in many respects. > So I have to wonder what sort of "well-designed language" you have in mind. Well, I gave some hints above. - Bob