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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-07 04:31:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Tue, 07 Jan 2003 13:33:44 +0100 Message-ID: <3chl1vg7p83jlgcgjndaa8n5lnh11a3l5t@4ax.com> References: <3E147D79.2070703@cogeco.ca> <4519e058.0301031434.51a0c880@posting.google.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1041942683 15422150 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:32666 Date: 2003-01-07T13:33:44+01:00 List-Id: On Mon, 6 Jan 2003 13:07:44 -0600, "Randy Brukardt" wrote: >Dmitry A. Kazakov wrote in message ... >>>> 1.a. This kills code reuse at run-time. >>> >>> This is therefore not necessarily true, based on the above. >> >>No, you cannot reuse code across instantiations. Each of them is a >macro >>expansion which has a separate body. Theoretically one could share >generic >>bodies [at least in Ada it is sometimes possible], but practically it >is >>not the case. > >Bull. > >You just need to use a different compiler. Ada /= GNAT! GNAT becomes sort of MS VC++ for Ada. (:-)) >Janus/Ada 95 shares all generic bodies. That's probably too aggressive, >but it's too expensive to change. > >Dan Eilers will tell you that their compiler (ICC) shares generic bodies >(I believe unless pragma Inline is used on the generic). > >Many Ada 83 compilers shared generic bodies, include DEC and Rational. >It's harder in Ada 95, but if there was any significant demand, >compilers would have it. Yes, I know. Shared bodies are working against the C++'s myth about unbeatable efficience of templates. Then if we can share bodies, then why do we need to instantiate something at compile-time? Should we drop this limitation completely, then instead of a "generic type", we would have our well-known friend discriminated type. My point is that we could get rid of generics in most cases and Ada is much more fit for that than C++. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de