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,7d14d8f47ca035bf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-04 09:24:06 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!spacestar!newsfeed.frii.net!newsfeed.mesh.ad.jp!sjc-peer.news.verio.net!news.verio.net!sea-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Ada Generic vs. C++ Templates In-Reply-To: <3ACA4A12.9FC665D5@bigfoot.com> Message-ID: References: <3AC8E799.189EE51C@bigfoot.com> <3ACA4A12.9FC665D5@bigfoot.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Wed, 04 Apr 2001 16:17:54 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sea-read.news.verio.net 986401074 206.184.139.136 (Wed, 04 Apr 2001 16:17:54 GMT) NNTP-Posting-Date: Wed, 04 Apr 2001 16:17:54 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:6457 Date: 2001-04-04T16:17:54+00:00 List-Id: On Tue, 3 Apr 2001, Francois Godme wrote: > I still don't think we can all rest on our laurels. > > The C++ STL is, by far, a piece of code larger than all the Ada generic units > combined you can find in the Ada95 standard. GCC compiles the STL, so > do Visual C++ and aCC. Isn't it enough signs of evidence? > > Even more, now that the language has been written down as a standard, > what can stop the convergence of the C++ compilers to the standard? Good points.You could also mention that it was some time before Ada generics were robust too. Stepanov mentions in some of his early STL papers that lots of Ada compilers couldn't handle his code. Contrary to what someone else wrote, C++ templates do give you extra expressive power over Ada in some areas. Examples? Sure http://www.eecs.harvard.edu/~nr/pubs/error-abstract.html Would I want to write that in C++? No, I much prefer (OCa)ML, but the point is that automatic instantiation of template gives you a crude form of parametric polymorphism, whereas Ada generics are *not* parametric polymorphism, papers by Barbey et al notwithstanding. Is the converse true too? Sure Ada generics provide type constraints, can take subprogram arguments (and simulate *some* cases of downward funargs), can be packages and take package arguments, etc. As I've said many times, automatic instantiation would be very nice, and would tip the scales totally to Ada IMO. But it isn't going to happen. If that bothers you too much, don't use Ada. Anyways, the responses to the question have been depressing, with lots of finger pointing at some old Mozilla site. If I were the original poster I'd have guessed by now that Ada programmers are very defensive, and dumber than mud, since they can't answer simple questions. :-) -- Brian