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=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e28ffe0eaf31d1b6 X-Google-Attributes: gid103376,public From: ohk@tfdt-o.nta.no (Ole-Hjalmar Kristensen FOU.TD/DELAB) Subject: Re: Ada vs C++ (Ada 0X) Date: 1997/09/10 Message-ID: #1/1 X-Deja-AN: 271264355 References: <34090462.4652@easystreet.com> <340C47F8.670B@osc.edu> <5v0lba$jnv$1@goanna.cs.rmit.edu.au> <341404B4.13CB@osc.edu> <34155698.4AE9@osc.edu> Organization: Telenor Online Public Access Newsgroups: comp.lang.ada Date: 1997-09-10T00:00:00+00:00 List-Id: "James B. White, III (Trey)" writes: > > > Brian Rogoff wrote: > > I think it is obvious that you can't do this stuff with Ada generics > > because Ada generic instantiation is not primitive recursive function > > calculation (what a mouthful, was that clear?). > > Clear. More about this below. > > > Lisp macros can do > > arbitrary computation during expansion, so given a decent Lisp compiler > > you should be able to get the same effect. Ask nicely on the Lisp newsgroup > > and I bet you'll even get code. > > Finding code is easy. The trick is finding a decent Lisp compiler! > > > My question is whether it is necessary for your purposes to have this > > capability directly supported in the language, or if some source to source > > transformation tool would suffice; i.e., an Ada aware macro system or some > > other such tool. I recall reading about such a macro system (M5?) but I > > forget where... > > If it's supported in the language, it is portable. Before anyone starts > slamming the portability of C++ and templates, realize the situation has > changed dramatically over the last few months. > Don't bet on that. We still have template classes which are legal C++, but which in practice can only be compiled by CenterLine CC (and probably other Cfront derivates), but not by g++, and not by Sun CC, because of different strategies for instantiating the templates. > > (In case anyone missed it, the C++ techniques being discussed can be found > > at http://monet.uwaterloo.ca/blitz/ ) > > I guess my real point is the following. Expression templates in C++ > demonstrate a level of functionality absent from Ada. If the Ada > standard is updated again (Ada 0X?), perhaps the Ada community should > consider ways of including the capabilities of expression templates (and > template metaprograms) in the new standard. I certainly don't advocate > supporting C++-style templates. What I would like to see is the > *capabilities* of these techniques added to Ada, but with a better > implementation. > -- > James B. White, III (Trey) > Ohio Supercomputer Center > trey@osc.edu > > Phone: (614)292-9291 Fax: (614)292-7168