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.6 required=5.0 tests=BAYES_20,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: "James B. White, III (Trey)" Subject: Re: Ada vs C++ (Ada 0X) Date: 1997/09/09 Message-ID: <34155698.4AE9@osc.edu>#1/1 X-Deja-AN: 270998793 References: <34090462.4652@easystreet.com> <340C47F8.670B@osc.edu> <5v0lba$jnv$1@goanna.cs.rmit.edu.au> <341404B4.13CB@osc.edu> Organization: Ohio Supercomputer Center Newsgroups: comp.lang.ada Date: 1997-09-09T00:00:00+00:00 List-Id: 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. > (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