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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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.85.136 with SMTP id h8mr1690115paz.46.1343314414630; Thu, 26 Jul 2012 07:53:34 -0700 (PDT) Path: b9ni64896747pbl.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!border6.newsrouter.astraweb.com!news.astraweb.com!border6.a.newsrouter.astraweb.com!ramfeed-2.ams.xsnews.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.straub-nv.de!news.swapon.de!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Signature Package With Generic Proceedure Date: Tue, 24 Jul 2012 10:43:03 +0200 Organization: cbb software GmbH Message-ID: <1ggt9jiju0199$.1n51td48pi4in.dlg@40tude.net> 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> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-07-24T10:43:03+02:00 List-Id: 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: >> "Keean Schupke" wrote in message >> ... >> > This is datatype generic programming, one of the things I thought Ada is >> > good at. >> > Signatures are the only way in Ada of doing this with no runtime cost, and >> > the only way >> > using generics. Signatures belong to a family of constructs across several >> > languages with >> > similar properties. For example: >> >> There's nothing in Ada that says generics have to be implemented with "no >> runtime cost". 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'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 "universal generic sharing"). Some Ada implementations do >> "partial generic sharing", where the parameters involved determine if >> sharing is used. >> >> Normally, at this point, I'd say something about premature optimization, but >> I realize from your past messages that you're already beyond that stage, so >> I won'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