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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Possible Ada deficiency? Date: 10 Jan 2005 16:51:54 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <1104544963.930877.75170@c13g2000cwb.googlegroups.com> <1104595073.731663.180100@c13g2000cwb.googlegroups.com> NNTP-Posting-Host: shell01-e.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1105393914 31251 69.38.147.31 (10 Jan 2005 21:51:54 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 10 Jan 2005 21:51:54 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:7625 Date: 2005-01-10T16:51:54-05:00 List-Id: "Randy Brukardt" writes: > "Robert A Duff" wrote in message > news:wccwtun9481.fsf@shell01.TheWorld.com... > ... > > So I guess the Ada 83 designers invented the private part so the > > compiler wouldn't have to look at the body to generate efficient code. > > But the compiler has to look at the body anyway, in order to implement > > generics (unless they are always code-shared) and pragmas Inline. > > So the decision seems somewhat inconsistent to me. > > I viewed the intent of the Ada 83 design to be exactly that: no looking at > the body is required. Generics should be shared, "Generics should be shared", says the man who wrote the only Ada compiler in the world that always shares generics. ;-) I tend to agree, if we're talking about an "ideal world". Ideally, the semantics of generics would be defined in a way that makes sharing the obvious default choice. (Eiffel does this.) Then macro expansion would be an optimization, just like inlining. And (in that ideal world) I would view a compiler that doesn't support inlining, or doesn't support non-shared generics, as insufficient. But this would be a radical change to the language. For example, the rules about whether parameters are passed by copy or reference should not depend on the actual type passed to a generic formal type. >... inline is a hint and the > dependencies need not (and should not) be used. Do any inlining/macro > expansion at link-time. I don't see link-time as an improvement. Whether you do this work at compile time or link time, it still costs in terms of rebuild time. And either way, you have to redo the work when the body changes. >...Certainly I wasn't the only one who thought that was > the intent. But you're the only one who implemented it that way! >...Machines of the era weren't really powerful enough to implement > that intent, thus the hacks of the generic dependency and the inline > dependency were allowed. > > Of course, Ada 95 came along and changed that intent. I don't understand that. Maybe I don't understand what you mean by "that intent". Which rules of Ada 95 are you talking about, here? >... Which is too bad, as > machines now are powerful enough to implement the Ada 83 intent! I don't understand that, either. Are you saying that the run-time overhead of the always-share model is now acceptable? - Bob