From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Signature Package With Generic Proceedure
Date: Tue, 24 Jul 2012 10:43:03 +0200
Date: 2012-07-24T10:43:03+02:00 [thread overview]
Message-ID: <1ggt9jiju0199$.1n51td48pi4in.dlg@40tude.net> (raw)
In-Reply-To: df151d92-5aea-4a1d-89c3-80324db9a0b9@googlegroups.com
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
next prev parent reply other threads:[~2012-07-26 14:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <045f7b44-2a4a-4292-80fd-0b6bc8ee3465@googlegroups.com>
2012-07-21 22:22 ` Signature Package With Generic Proceedure Adam Beneschan
2012-07-22 7:28 ` Dmitry A. Kazakov
2012-07-22 16:22 ` Keean Schupke
2012-07-23 0:45 ` Adam Beneschan
[not found] ` <79925d0c-b2dd-44a3-9451-48f0ee19485f@googlegroups.com>
[not found] ` <500d3a9d$0$6566$9b4e6d93@newsspool4.arcor-online.net>
2012-07-23 18:29 ` Keean Schupke
[not found] ` <ac8bfaed-dbcc-491a-a760-c25672445eef@googlegroups.com>
2012-07-23 19:41 ` Keean Schupke
2012-07-24 2:57 ` Randy Brukardt
[not found] ` <jul2n4$af5$1@munin.nbi.dk>
2012-07-24 8:02 ` Keean Schupke
2012-07-24 8:43 ` Dmitry A. Kazakov [this message]
2012-07-24 8:59 ` Keean Schupke
2012-07-23 10:26 ` Simon Wright
2012-07-23 18:36 ` Keean Schupke
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox