<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Gem #1: Limited Types in Ada 2005 &#8212; Limited Aggregates</title>
	<atom:link href="http://www.adacore.com/2007/05/14/gem-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adacore.com/2007/05/14/gem-1/</link>
	<description>AdaCore technology and news</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:59:19 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul F. Pearson</title>
		<link>http://www.adacore.com/2007/05/14/gem-1/comment-page-1/#comment-11</link>
		<dc:creator>Paul F. Pearson</dc:creator>
		<pubDate>Wed, 30 May 2007 14:07:20 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/05/14/gem-1-limited-types-in-ada-2005-limited-aggregates/#comment-11</guid>
		<description>Bob Duff said:

Note that my example used Unbounded_String, and then I turn around and say controlled types are expensive. Oh well, it’s just an example.

That actually helps answer my question - a feature can be &quot;expensive&quot;, but worth the expense (e.g. a Mercedes vs. a Pinto).  In your example, the simplicity of the Unbounded_String helped keep the focus on the subject (in spite of my tangent).</description>
		<content:encoded><![CDATA[<p>Bob Duff said:</p>
<p>Note that my example used Unbounded_String, and then I turn around and say controlled types are expensive. Oh well, it’s just an example.</p>
<p>That actually helps answer my question &#8211; a feature can be &#8220;expensive&#8221;, but worth the expense (e.g. a Mercedes vs. a Pinto).  In your example, the simplicity of the Unbounded_String helped keep the focus on the subject (in spite of my tangent).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Duff</title>
		<link>http://www.adacore.com/2007/05/14/gem-1/comment-page-1/#comment-6</link>
		<dc:creator>Bob Duff</dc:creator>
		<pubDate>Mon, 21 May 2007 13:56:04 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/05/14/gem-1-limited-types-in-ada-2005-limited-aggregates/#comment-6</guid>
		<description>Paul F. Pearson said, &quot;Of course, this means that Unbounded_String will be used less often… :-)&quot;

Yes, Unbounded_String is controlled and is therefore expensive.  Whether it&#039;s _too_ expensive can best be determined by measuring.

Note that my example used Unbounded_String, and then I turn around and say controlled types are expensive.  Oh well, it&#039;s just an example.</description>
		<content:encoded><![CDATA[<p>Paul F. Pearson said, &#8220;Of course, this means that Unbounded_String will be used less often… :-)&#8221;</p>
<p>Yes, Unbounded_String is controlled and is therefore expensive.  Whether it&#8217;s _too_ expensive can best be determined by measuring.</p>
<p>Note that my example used Unbounded_String, and then I turn around and say controlled types are expensive.  Oh well, it&#8217;s just an example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul F. Pearson</title>
		<link>http://www.adacore.com/2007/05/14/gem-1/comment-page-1/#comment-5</link>
		<dc:creator>Paul F. Pearson</dc:creator>
		<pubDate>Fri, 18 May 2007 20:18:10 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/05/14/gem-1-limited-types-in-ada-2005-limited-aggregates/#comment-5</guid>
		<description>I forgot to comment on the topic:

This looks to be a *very* useful feature of Ada 2005.  Thank you for pointing this out.

I look forward to the next &quot;gem&quot;.</description>
		<content:encoded><![CDATA[<p>I forgot to comment on the topic:</p>
<p>This looks to be a *very* useful feature of Ada 2005.  Thank you for pointing this out.</p>
<p>I look forward to the next &#8220;gem&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul F. Pearson</title>
		<link>http://www.adacore.com/2007/05/14/gem-1/comment-page-1/#comment-4</link>
		<dc:creator>Paul F. Pearson</dc:creator>
		<pubDate>Fri, 18 May 2007 20:16:27 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/05/14/gem-1-limited-types-in-ada-2005-limited-aggregates/#comment-4</guid>
		<description>Thank you, Franco.

That paper is *very* informative (as usual).  I can see that there is quite a bit of overhead.  While I was hoping to find an analysis quantifying the expense, I can see that my hope was a bit unrealistic.  

I suppose that my design decisions related to controlled types will be made like other features - if my code needs to be fast, be *very* thoughtful about using controlled types.

Of course, this means that Unbounded_String will be used less often... :-)</description>
		<content:encoded><![CDATA[<p>Thank you, Franco.</p>
<p>That paper is *very* informative (as usual).  I can see that there is quite a bit of overhead.  While I was hoping to find an analysis quantifying the expense, I can see that my hope was a bit unrealistic.  </p>
<p>I suppose that my design decisions related to controlled types will be made like other features &#8211; if my code needs to be fast, be *very* thoughtful about using controlled types.</p>
<p>Of course, this means that Unbounded_String will be used less often&#8230; :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Franco Gasperoni</title>
		<link>http://www.adacore.com/2007/05/14/gem-1/comment-page-1/#comment-3</link>
		<dc:creator>Franco Gasperoni</dc:creator>
		<pubDate>Thu, 17 May 2007 14:17:37 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/05/14/gem-1-limited-types-in-ada-2005-limited-aggregates/#comment-3</guid>
		<description>&quot;What is the cost of controlled types&quot;, asks Paul.

The way controlled types are currently implemented in GNAT is to put each controlled object onto a finalization list so that Finalize can be called before the object gets destructed.

So each controlled object has two extra pointers to be doubly chained. So there is a space cost (for you to decide whether that is acceptable or not).

The runtime cost is adding/removing each controlled object onto the finalization list and calling initialize/adjust/finalize when appropriate.

More details are available in a paper that Cyrille, Gary, and I wrote several years ago. The paper is available at:

http://www.adacore.com/2001/01/26/the-gnat-implementation-of-controlled-types/

Enjoy :)</description>
		<content:encoded><![CDATA[<p>&#8220;What is the cost of controlled types&#8221;, asks Paul.</p>
<p>The way controlled types are currently implemented in GNAT is to put each controlled object onto a finalization list so that Finalize can be called before the object gets destructed.</p>
<p>So each controlled object has two extra pointers to be doubly chained. So there is a space cost (for you to decide whether that is acceptable or not).</p>
<p>The runtime cost is adding/removing each controlled object onto the finalization list and calling initialize/adjust/finalize when appropriate.</p>
<p>More details are available in a paper that Cyrille, Gary, and I wrote several years ago. The paper is available at:</p>
<p><a href="http://www.adacore.com/2001/01/26/the-gnat-implementation-of-controlled-types/" rel="nofollow">http://www.adacore.com/2001/01/26/the-gnat-implementation-of-controlled-types/</a></p>
<p>Enjoy :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul F. Pearson</title>
		<link>http://www.adacore.com/2007/05/14/gem-1/comment-page-1/#comment-2</link>
		<dc:creator>Paul F. Pearson</dc:creator>
		<pubDate>Wed, 16 May 2007 13:47:08 +0000</pubDate>
		<guid isPermaLink="false">http://www2.adacore.com/2007/05/14/gem-1-limited-types-in-ada-2005-limited-aggregates/#comment-2</guid>
		<description>&quot;[...]but controlled types are expensive&quot;.  I&#039;ve heard this before, and I can believe it.  However, has there been any analysis of *how* expensive?  What is their cost compared to a  custom implementation providing similar functionality (e.g. providing a &quot;deep copy&quot; procedure/function)?  How can someone decide when a controlled type is &quot;too expensive&quot;?

For instance, when should I decide to *not* use Unbounded_String, since (at least in the GNAT versions I&#039;ve seen) it uses a Controlled type?</description>
		<content:encoded><![CDATA[<p>&#8220;[...]but controlled types are expensive&#8221;.  I&#8217;ve heard this before, and I can believe it.  However, has there been any analysis of *how* expensive?  What is their cost compared to a  custom implementation providing similar functionality (e.g. providing a &#8220;deep copy&#8221; procedure/function)?  How can someone decide when a controlled type is &#8220;too expensive&#8221;?</p>
<p>For instance, when should I decide to *not* use Unbounded_String, since (at least in the GNAT versions I&#8217;ve seen) it uses a Controlled type?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

