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-Thread: a07f3367d7,bed01d177eaef486 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.39.72 with SMTP id f8mr1357257qae.7.1343314364638; Thu, 26 Jul 2012 07:52:44 -0700 (PDT) Received: by 10.66.88.168 with SMTP id bh8mr1471991pab.10.1343314250779; Thu, 26 Jul 2012 07:50:50 -0700 (PDT) Received: by 10.68.201.129 with SMTP id ka1mr88564pbc.4.1343314231631; Thu, 26 Jul 2012 07:50:31 -0700 (PDT) Path: a15ni105485768qag.0!nntp.google.com!q21no16168450qas.0!news-out.google.com!p10ni64874536pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!4no6400052pbo.1!news-out.google.com!b9ni60415685pbl.0!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!82.197.223.106.MISMATCH!feeder1.cambriumusenet.nl!feed.tweaknews.nl!94.232.116.12.MISMATCH!feed.xsnews.nl!border-2.ams.xsnews.nl!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news.swapon.de!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Keean Schupke Newsgroups: comp.lang.ada Subject: Re: Signature Package With Generic Proceedure Date: Tue, 24 Jul 2012 01:02:55 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <045f7b44-2a4a-4292-80fd-0b6bc8ee3465@googlegroups.com> <88734b25-68e5-42b2-89ea-0c0e3fc9fbc5@googlegroups.com> <93f32ea9-a61d-4148-83be-258ae0676cac@googlegroups.com> <79925d0c-b2dd-44a3-9451-48f0ee19485f@googlegroups.com> NNTP-Posting-Host: 82.44.19.199 Mime-Version: 1.0 X-Trace: posting.google.com 1343116975 11768 127.0.0.1 (24 Jul 2012 08:02:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Jul 2012 08:02:55 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.44.19.199; posting-account=T5Z2vAoAAAB8ExE3yV3f56dVATtEMNcM User-Agent: G2/1.0 X-Received-Bytes: 3727 X-Original-Bytes: 3495 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-24T01:02:55-07:00 List-Id: On Tuesday, 24 July 2012 03:53:20 UTC+1, Randy Brukardt wrote: > "Keean Schupke" wrote in message=20 > ... > > This is datatype generic programming, one of the things I thought Ad= a is=20 > > good at. > > Signatures are the only way in Ada of doing this with no runtime cos= t, and=20 > > the only way > > using generics. Signatures belong to a family of constructs across s= everal=20 > > languages with > > similar properties. For example: >=20 > There's nothing in Ada that says generics have to be implemented with= "no=20 > runtime cost". Many Ada 83 implementations, and a few more recent=20 > implementations, share all generic instantiations. The effect is very=20 > similar to tagged type dispatching, and it's most useful when there a= re a=20 > lot of instances in a program. Janus/Ada certainly does this (it might be= =20 > the last to do "universal generic sharing"). Some Ada implement= ations do=20 > "partial generic sharing", where the parameters involved determ= ine if=20 > sharing is used. >=20 > Normally, at this point, I'd say something about premature optimizati= on, but=20 > I realize from your past messages that you're already beyond that sta= ge, so=20 > I won't say any more. >=20 > Randy. Using DG is a choice like using OO. Languages seem to be very keen to add f= eatures to support OO programming. The zero run time cost is 'potential' be= cause all types can be statically determined at compile time. GNAT does thi= s (maybe because it shares a backend with C++) DG is my programming style of choice at the moment, so some of this is abou= t exploring different languages support for it. At some point C++ has proba= bly overtaken Ada in this regard. Haskell is great but performance is not a= lways good. At the moment the code written in Ada using Signatures and access variables= is faster than C++ (by a couple of percent) when both compiled with GCC. Cheers, Keean.