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-18 15:16:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!c03.atl99!cyclone2.usenetserver.com!news.webusenet.com!news01.optonline.net!news4.srv.hcvlny.cv.net.POSTED!not-for-mail From: "Hillel Y. Sims" Newsgroups: comp.lang.ada References: <1041908422.928308@master.nyc.kbcfp.com> <1041997309.165001@master.nyc.kbcfp.com> <1042086217.253468@master.nyc.kbcfp.com> <1042477504.547640@master.nyc.kbcfp.com> <1042651417.215661@master.nyc.kbcfp.com> <1042743579.1165@master.nyc.kbcfp.com> <1042824191.538184@master.nyc.kbcfp.com> Subject: Re: Anybody in US using ADA ? One silly idea.. Organization: Phat Basset Novelties, www.phatbasset.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <_VkW9.266404$FT6.43771824@news4.srv.hcvlny.cv.net> Date: Sat, 18 Jan 2003 22:53:46 GMT NNTP-Posting-Host: 67.86.54.13 X-Trace: news4.srv.hcvlny.cv.net 1042930426 67.86.54.13 (Sat, 18 Jan 2003 17:53:46 EST) NNTP-Posting-Date: Sat, 18 Jan 2003 17:53:46 EST Xref: archiver1.google.com comp.lang.ada:33186 Date: 2003-01-18T22:53:46+00:00 List-Id: "Dmitry A. Kazakov" wrote in message news:b0bhef$ni0jk$1@ID-77047.news.dfncis.de... > If they are better, then there should be a rationale for that. So far, there > are only two arguments: > > 1. Efficiency [which is arguable and very often not an issue in a large > system] > Are you serious? Just a small example of potential efficiency, C++ templated std::sort() function is proven to be non-trivially faster than the mostly-equivalent C-based non-templated std::qsort() function which uses untyped void* parameters. On my system (HP Alphas running OpenVMS), templated std::sort() is more than 60% faster than std::qsort() for arrays of 500,000 integers or floats. Recent profiling of our system (financial data integration/analysis) indicated some sorting routines (really old fortran-based code) as potential relevant targets for efficiency improvement. I imagine similar kinds of efficiency improvement are possible in Ada using generics vs. untyped code? > 2. They can something, that other gears cannot [what if they could?] Has anyone suggested anything better yet? > > Compare this with gotos. They are extremely efficient and they do can [make > a maintenance nightmare out of any program] How do you compare gotos to generics? Generics do not destroy structured code. I just don't understand the analogy. > > This changes nothing: > > template class Y ...; > > how a specialization could help to create a container for Y. Note missing <> > after Y. There is simply no such thing as Y. There is only a bunch of > instances of Y, which are absolutely *unrelated*! It can actually help. For example, in the case of the standard C++ container class std::vector -- there can be a specialization defined (I forget if it is mandated by the Standard, but it is possible anyhow) for all std::vector such that they are inherited from std::vector with just the necessary casts thrown in by the compiler (inline). This can eliminate a large amount of unnecessary code bloat for all instantiations of vectors of pointer types. hys -- (c) 2003 Hillel Y. Sims hsims AT factset.com