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.66.75.39 with SMTP id z7mr1419831pav.6.1343317059088; Thu, 26 Jul 2012 08:37:39 -0700 (PDT) Received: by 10.66.72.165 with SMTP id e5mr1621091pav.4.1343314506301; Thu, 26 Jul 2012 07:55:06 -0700 (PDT) Path: p10ni65138561pbh.1!nntp.google.com!u4no209177pbs.0!news-out.google.com!b9ni60415685pbl.0!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border6.newsrouter.astraweb.com!news.astraweb.com!border6.a.newsrouter.astraweb.com!feed.xsnews.nl!border-1.ams.xsnews.nl!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:59:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: <12e6b873-efc1-4111-9d95-829e0fb49372@googlegroups.com> 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> <1ggt9jiju0199$.1n51td48pi4in.dlg@40tude.net> NNTP-Posting-Host: 82.44.19.199 Mime-Version: 1.0 X-Trace: posting.google.com 1343120772 18108 127.0.0.1 (24 Jul 2012 09:06:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Jul 2012 09:06:12 +0000 (UTC) Cc: mailbox@dmitry-kazakov.de In-Reply-To: <1ggt9jiju0199$.1n51td48pi4in.dlg@40tude.net> 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: 4143 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-07-24T01:59:52-07:00 List-Id: On Tuesday, 24 July 2012 09:43:03 UTC+1, Dmitry A. Kazakov wrote: > On Tue, 24 Jul 2012 01:02:55 -0700 (PDT), Keean Schupke wrote: > > > On Tuesday, 24 July 2012 03:53:20 UTC+1, Randy Brukardt wrote: > >> &quot;Keean Schupke&quot; wrote in message > >> ... > >> &gt; This is datatype generic programming, one of the things I thought Ada is > >> &gt; good at. > >> &gt; Signatures are the only way in Ada of doing this with no runtime cost, and > >> &gt; the only way > >> &gt; using generics. Signatures belong to a family of constructs across several > >> &gt; languages with > >> &gt; similar properties. For example: > >> > >> There&#39;s nothing in Ada that says generics have to be implemented with &quot;no > >> runtime cost&quot;. Many Ada 83 implementations, and a few more recent > >> implementations, share all generic instantiations. The effect is very > >> similar to tagged type dispatching, and it&#39;s most useful when there are a > >> lot of instances in a program. Janus/Ada certainly does this (it might be > >> the last to do &quot;universal generic sharing&quot;). Some Ada implementations do > >> &quot;partial generic sharing&quot;, where the parameters involved determine if > >> sharing is used. > >> > >> Normally, at this point, I&#39;d say something about premature optimization, but > >> I realize from your past messages that you&#39;re already beyond that stage, so > >> I won&#39;t say any more. > > > > Using DG is a choice like using OO. > > DG is "dangerous goods" or "differential geometry"? > > > Languages seem to be very keen to add features to support OO programming. > > The zero run time cost is 'potential' because all types can be statically > > determined at compile time. GNAT does this (maybe because it shares a > > backend with C++) > > GNAT does this because in Ada static dispatch is always zero run-time cost. > This gives full advantages of OO over generics with no performance loss. > > -- > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de DG is Datatype Generic programming, its a different way of working to Object Oriented design, focusing on algorithms and concepts (or type-classes or signature packages). It has many advantages over OO with potentially better performance. Cheers, Keean.