comp.lang.ada
 help / color / mirror / Atom feed
From: Keean Schupke <keean.schupke@googlemail.com>
Cc: mailbox@dmitry-kazakov.de
Subject: Re: Signature Package With Generic Proceedure
Date: Tue, 24 Jul 2012 01:59:52 -0700 (PDT)
Date: 2012-07-24T01:59:52-07:00	[thread overview]
Message-ID: <12e6b873-efc1-4111-9d95-829e0fb49372@googlegroups.com> (raw)
In-Reply-To: <1ggt9jiju0199$.1n51td48pi4in.dlg@40tude.net>

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:
> 
> &gt; On Tuesday, 24 July 2012 03:53:20 UTC+1, Randy Brukardt  wrote:
> &gt;&gt; &amp;quot;Keean Schupke&amp;quot; wrote in message 
> &gt;&gt; ...
> &gt;&gt; &amp;gt; This is datatype generic programming, one of the things I thought Ada is 
> &gt;&gt; &amp;gt; good at.
> &gt;&gt; &amp;gt; Signatures are the only way in Ada of doing this with no runtime cost, and 
> &gt;&gt; &amp;gt; the only way
> &gt;&gt; &amp;gt; using generics. Signatures belong to a family of constructs across several 
> &gt;&gt; &amp;gt; languages with
> &gt;&gt; &amp;gt; similar properties. For example:
> &gt;&gt; 
> &gt;&gt; There&amp;#39;s nothing in Ada that says generics have to be implemented with &amp;quot;no 
> &gt;&gt; runtime cost&amp;quot;. Many Ada 83 implementations, and a few more recent 
> &gt;&gt; implementations, share all generic instantiations. The effect is very 
> &gt;&gt; similar to tagged type dispatching, and it&amp;#39;s most useful when there are a 
> &gt;&gt; lot of instances in a program. Janus/Ada certainly does this (it might be 
> &gt;&gt; the last to do &amp;quot;universal generic sharing&amp;quot;). Some Ada implementations do 
> &gt;&gt; &amp;quot;partial generic sharing&amp;quot;, where the parameters involved determine if 
> &gt;&gt; sharing is used.
> &gt;&gt; 
> &gt;&gt; Normally, at this point, I&amp;#39;d say something about premature optimization, but 
> &gt;&gt; I realize from your past messages that you&amp;#39;re already beyond that stage, so 
> &gt;&gt; I won&amp;#39;t say any more.
> &gt; 
> &gt; Using DG is a choice like using OO.
> 
> DG is &quot;dangerous goods&quot; or &quot;differential geometry&quot;?
> 
> &gt; Languages seem to be very keen to add features to support OO programming.
> &gt; The zero run time cost is &#39;potential&#39; because all types can be statically
> &gt; determined at compile time. GNAT does this (maybe because it shares a
> &gt; 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.  



  reply	other threads:[~2012-07-26 15:37 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
2012-07-24  8:59               ` Keean Schupke [this message]
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