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,FREEMAIL_FROM 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 22:18:35 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: kcline17@hotmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: 18 Jan 2003 22:18:35 -0800 Organization: http://groups.google.com/ Message-ID: References: <1042477504.547640@master.nyc.kbcfp.com> <1042651417.215661@master.nyc.kbcfp.com> <1042743579.1165@master.nyc.kbcfp.com> <1042824191.538184@master.nyc.kbcfp.com> <_VkW9.266404$FT6.43771824@news4.srv.hcvlny.cv.net> NNTP-Posting-Host: 24.219.89.90 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1042957115 6140 127.0.0.1 (19 Jan 2003 06:18:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 19 Jan 2003 06:18:35 GMT Xref: archiver1.google.com comp.lang.ada:33199 Date: 2003-01-19T06:18:35+00:00 List-Id: "Hillel Y. Sims" wrote in message news:<_VkW9.266404$FT6.43771824@news4.srv.hcvlny.cv.net>... > "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. It's not mandated by the standard and it's generally not done. There's not much point since most of the standard container member functions are rather short, and are almost always compiled inline.