<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Type Inference vs. Static/Dynamic Typing</title>
	<atom:link href="http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/feed/" rel="self" type="application/rss+xml" />
	<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/</link>
	<description>Herb Sutter on software, hardware, and concurrency</description>
	<lastBuildDate>Sat, 14 Nov 2009 15:42:31 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: girtby.net &#8211; Why You Should Learn C++</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-1052</link>
		<dc:creator>girtby.net &#8211; Why You Should Learn C++</dc:creator>
		<pubDate>Fri, 23 Jan 2009 23:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-1052</guid>
		<description>[...] outdated perception of the C++ language, at least as it is practiced today, because you certainly can use dynamic typing in C++, for one [...]</description>
		<content:encoded><![CDATA[<p>[...] outdated perception of the C++ language, at least as it is practiced today, because you certainly can use dynamic typing in C++, for one [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DynamicAny -- ciekawostka przyrodnicza &#124; hilpers</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-1044</link>
		<dc:creator>DynamicAny -- ciekawostka przyrodnicza &#124; hilpers</dc:creator>
		<pubDate>Sun, 18 Jan 2009 15:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-1044</guid>
		<description>[...] powyzej nie umiem napisac w Pythonie jak ktos potrafi to prosze o uzupelnienie.  Pozdrawiam,  [1] http://herbsutter.wordpress.com/2008...ynamic-typing/ [2] http://pocoproject.org/poco/docs/Poco.DynamicAny.html  -- &#124;//&#124; Seweryn Habdank-Wojewodzki [...]</description>
		<content:encoded><![CDATA[<p>[...] powyzej nie umiem napisac w Pythonie jak ktos potrafi to prosze o uzupelnienie.  Pozdrawiam,  [1] <a href="http://herbsutter.wordpress.com/2008...ynamic-typing/" rel="nofollow">http://herbsutter.wordpress.com/2008&#8230;ynamic-typing/</a> [2] <a href="http://pocoproject.org/poco/docs/Poco.DynamicAny.html" rel="nofollow">http://pocoproject.org/poco/docs/Poco.DynamicAny.html</a>  &#8212; |//| Seweryn Habdank-Wojewodzki [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Fabijanic</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-796</link>
		<dc:creator>Alex Fabijanic</dc:creator>
		<pubDate>Thu, 04 Sep 2008 14:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-796</guid>
		<description>Part I of the mentioned &lt;a href=&quot;http://accu.org/index.php/journals/1502&quot; rel=&quot;nofollow&quot;&gt;ACCU Overload article about DynamicAny&lt;/a&gt; has been published.</description>
		<content:encoded><![CDATA[<p>Part I of the mentioned <a href="http://accu.org/index.php/journals/1502" rel="nofollow">ACCU Overload article about DynamicAny</a> has been published.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Koftinoff</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-674</link>
		<dc:creator>Jeff Koftinoff</dc:creator>
		<pubDate>Wed, 16 Jul 2008 09:22:51 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-674</guid>
		<description>Glen, here is a recent comp.lang.c++.moderated posting asking about the exact same thing as I am:

http://groups.google.com/group/comp.lang.c++.moderated/msg/dca1e018039c79ff

quote:
----
Hi, 
Can anyone confirm if my observation is correct? 
According to N2673, I will not be able to write: 
     class Parser 
     { 
         auto member = func(); 
     }; 
but I will be able to write (according to the current Standard Draft): 
     class Parser 
     { 
         decltype( func() ) member = func(); 
     }; 
Which eventually will encourage me to write and use a macro: 
     class Parser 
     { 
         DECLARE_AUTO_MEMBER( member, func() ); 
     }; 
I have one particular usage in mind, which is the Boost.Spirit, where 
the grammar rules are implemented with class non-static members. 

-----

--jeffk++</description>
		<content:encoded><![CDATA[<p>Glen, here is a recent comp.lang.c++.moderated posting asking about the exact same thing as I am:</p>
<p><a href="http://groups.google.com/group/comp.lang.c++.moderated/msg/dca1e018039c79ff" rel="nofollow">http://groups.google.com/group/comp.lang.c++.moderated/msg/dca1e018039c79ff</a></p>
<p>quote:<br />
&#8212;-<br />
Hi,<br />
Can anyone confirm if my observation is correct?<br />
According to N2673, I will not be able to write:<br />
     class Parser<br />
     {<br />
         auto member = func();<br />
     };<br />
but I will be able to write (according to the current Standard Draft):<br />
     class Parser<br />
     {<br />
         decltype( func() ) member = func();<br />
     };<br />
Which eventually will encourage me to write and use a macro:<br />
     class Parser<br />
     {<br />
         DECLARE_AUTO_MEMBER( member, func() );<br />
     };<br />
I have one particular usage in mind, which is the Boost.Spirit, where<br />
the grammar rules are implemented with class non-static members. </p>
<p>&#8212;&#8211;</p>
<p>&#8211;jeffk++</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DanielWaechter.com &#187; Blog Archive &#187; The Long Road Back to C++</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-656</link>
		<dc:creator>DanielWaechter.com &#187; Blog Archive &#187; The Long Road Back to C++</dc:creator>
		<pubDate>Thu, 10 Jul 2008 01:39:45 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-656</guid>
		<description>[...] has some improvements. For example, I can&#8217;t wait for type inference; if the compiler can figure out what type I want, then why should I spell it out every time (though [...]</description>
		<content:encoded><![CDATA[<p>[...] has some improvements. For example, I can&#8217;t wait for type inference; if the compiler can figure out what type I want, then why should I spell it out every time (though [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-630</link>
		<dc:creator>Glen</dc:creator>
		<pubDate>Thu, 26 Jun 2008 21:22:06 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-630</guid>
		<description>I&#039;m not sure I&#039;d like your example to be legal myself, because if the type of the initializer of &#039;i&#039; changed, the layout of the struct s would also change, something i&#039;d prefer not to have happen quite so subtly. I also think something as core as a class declaration should be spelled out to improve code clarity. It&#039;s fine for where it will primarily be used for though, such as in local variable definitions in functions. I imagine decltype might suit your desire more here.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure I&#8217;d like your example to be legal myself, because if the type of the initializer of &#8216;i&#8217; changed, the layout of the struct s would also change, something i&#8217;d prefer not to have happen quite so subtly. I also think something as core as a class declaration should be spelled out to improve code clarity. It&#8217;s fine for where it will primarily be used for though, such as in local variable definitions in functions. I imagine decltype might suit your desire more here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Koftinoff</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-626</link>
		<dc:creator>Jeff Koftinoff</dc:creator>
		<pubDate>Wed, 25 Jun 2008 17:32:43 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-626</guid>
		<description>@Lee R:

Your example:

struct s { int i = 0; };

will be legal in C++0x

I would like for it to also allow:

struct s { auto i = 0; };

--jeffk++</description>
		<content:encoded><![CDATA[<p>@Lee R:</p>
<p>Your example:</p>
<p>struct s { int i = 0; };</p>
<p>will be legal in C++0x</p>
<p>I would like for it to also allow:</p>
<p>struct s { auto i = 0; };</p>
<p>&#8211;jeffk++</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wtom</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-624</link>
		<dc:creator>wtom</dc:creator>
		<pubDate>Wed, 25 Jun 2008 07:50:57 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-624</guid>
		<description>&quot;This gets increasingly important as we don’t want to, or can’t, write out the type ourselves, because we have:

...
    * types without names (or hard-to-find names) &quot;


I even know where those hard-to-find names (or more exactly - types) will be came from:

auto i = ...
...
auto j = i;
...
auto g = j;
...
auto v = g;
...
auto m = v;

Grats! We are going to get one more Basic.
Hope, I&#039;m wrong.</description>
		<content:encoded><![CDATA[<p>&#8220;This gets increasingly important as we don’t want to, or can’t, write out the type ourselves, because we have:</p>
<p>&#8230;<br />
    * types without names (or hard-to-find names) &#8221;</p>
<p>I even know where those hard-to-find names (or more exactly &#8211; types) will be came from:</p>
<p>auto i = &#8230;<br />
&#8230;<br />
auto j = i;<br />
&#8230;<br />
auto g = j;<br />
&#8230;<br />
auto v = g;<br />
&#8230;<br />
auto m = v;</p>
<p>Grats! We are going to get one more Basic.<br />
Hope, I&#8217;m wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee R</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-621</link>
		<dc:creator>Lee R</dc:creator>
		<pubDate>Tue, 24 Jun 2008 00:41:22 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-621</guid>
		<description>@Jeff Koftinoff

The problem with your example is one of member initialisation and shouldn&#039;t really be considered a limitation of &#039;auto&#039;. Consider the following (no use of auto, yet still illegal):

struct s { int i = 0; };</description>
		<content:encoded><![CDATA[<p>@Jeff Koftinoff</p>
<p>The problem with your example is one of member initialisation and shouldn&#8217;t really be considered a limitation of &#8216;auto&#8217;. Consider the following (no use of auto, yet still illegal):</p>
<p>struct s { int i = 0; };</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg M</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-618</link>
		<dc:creator>Greg M</dc:creator>
		<pubDate>Mon, 23 Jun 2008 04:34:46 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-618</guid>
		<description>@Martin:

Type inferencing doesn&#039;t _give_ you duck typing, but it&#039;s certainly compatible with it. Although statically-typed languages (I&#039;m thinking ML or Haskell) tend to give you a different flavour of duck, all the more sophisticated static type systems have some way of getting the expressivity and flexibility you&#039;d use duck typing for without sacrificing type safety.

@Anocka:

I don&#039;t see how that goes beyond the &quot;inference just happens to let you declare variables in a style that can be similar to the way you do it all the time in a dynamically typed language&quot;, which immediately follows the quote you&#039;re disputing.</description>
		<content:encoded><![CDATA[<p>@Martin:</p>
<p>Type inferencing doesn&#8217;t _give_ you duck typing, but it&#8217;s certainly compatible with it. Although statically-typed languages (I&#8217;m thinking ML or Haskell) tend to give you a different flavour of duck, all the more sophisticated static type systems have some way of getting the expressivity and flexibility you&#8217;d use duck typing for without sacrificing type safety.</p>
<p>@Anocka:</p>
<p>I don&#8217;t see how that goes beyond the &#8220;inference just happens to let you declare variables in a style that can be similar to the way you do it all the time in a dynamically typed language&#8221;, which immediately follows the quote you&#8217;re disputing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vu64</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-615</link>
		<dc:creator>vu64</dc:creator>
		<pubDate>Sun, 22 Jun 2008 04:28:21 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-615</guid>
		<description>Great C++ Libraries include Boost, ACE and Loki. If you do scientific computing, there are Blitz++, MTL and POOMA.
Matthew Wilson has STLSoft which  complements STL. It is a good library but didn&#039;t succeed because of poor documentation. It is described in his book Extended STL (the first volume has been published by Addison-Wesly, the Second Volume will come out in Sep).</description>
		<content:encoded><![CDATA[<p>Great C++ Libraries include Boost, ACE and Loki. If you do scientific computing, there are Blitz++, MTL and POOMA.<br />
Matthew Wilson has STLSoft which  complements STL. It is a good library but didn&#8217;t succeed because of poor documentation. It is described in his book Extended STL (the first volume has been published by Addison-Wesly, the Second Volume will come out in Sep).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Top Posts &#171; WordPress.com</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-614</link>
		<dc:creator>Top Posts &#171; WordPress.com</dc:creator>
		<pubDate>Sun, 22 Jun 2008 00:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-614</guid>
		<description>[...]  Type Inference vs. Static/Dynamic Typing Jeff Atwood just wrote a nice piece on why type inference is convenient, using a C# sample: I was absolutely thrilled [...] [...]</description>
		<content:encoded><![CDATA[<p>[...]  Type Inference vs. Static/Dynamic Typing Jeff Atwood just wrote a nice piece on why type inference is convenient, using a C# sample: I was absolutely thrilled [...] [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Fabijanic</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-612</link>
		<dc:creator>Alex Fabijanic</dc:creator>
		<pubDate>Sat, 21 Jun 2008 20:54:19 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-612</guid>
		<description>&quot;Never heard of POCO, are there any other great C++ libraries besides Boost?&quot;

Yes, &lt;a href=&quot;http://www.cse.wustl.edu/~schmidt/ACE-overview.html&quot; rel=&quot;nofollow&quot;&gt;ACE&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>&#8220;Never heard of POCO, are there any other great C++ libraries besides Boost?&#8221;</p>
<p>Yes, <a href="http://www.cse.wustl.edu/~schmidt/ACE-overview.html" rel="nofollow">ACE</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikola Smiljanić</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-611</link>
		<dc:creator>Nikola Smiljanić</dc:creator>
		<pubDate>Sat, 21 Jun 2008 20:22:26 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-611</guid>
		<description>For some reason all comments in your examples are cut off at one point. Tried it in Firefox and IE but it looks the same. Is it just me or there is something wrong with this page?

&quot;Again unlike a union, a variant can include essentially any kind of type.&quot; I think you wanted to say &quot;any can include&quot;, not variant.

Never heard of POCO, are there any other great C++ libraries besides Boost?</description>
		<content:encoded><![CDATA[<p>For some reason all comments in your examples are cut off at one point. Tried it in Firefox and IE but it looks the same. Is it just me or there is something wrong with this page?</p>
<p>&#8220;Again unlike a union, a variant can include essentially any kind of type.&#8221; I think you wanted to say &#8220;any can include&#8221;, not variant.</p>
<p>Never heard of POCO, are there any other great C++ libraries besides Boost?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Koftinoff</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-610</link>
		<dc:creator>Jeff Koftinoff</dc:creator>
		<pubDate>Sat, 21 Jun 2008 18:51:31 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-610</guid>
		<description>Is it true that the auto keyword in C++0x can&#039;t be used for a class member variable, even though C++0x allows initialization of member variables outside of constructors?

ie:

class X
{
public:
   X() {}
   auto f = [](int x){ return x+2; };
};

int main()
{
  X x;
  std::cout &lt;&lt; X.f(5) &lt;&lt; &quot;\n&quot;;
  return 0;
}

Of course this example is simplistic but there are numerous places where I&#039;d love to be able to use this pattern with c++ expression template objects being directly within another object, and I don&#039;t see why this pattern can&#039;t be allowed.

--jeffk++</description>
		<content:encoded><![CDATA[<p>Is it true that the auto keyword in C++0x can&#8217;t be used for a class member variable, even though C++0x allows initialization of member variables outside of constructors?</p>
<p>ie:</p>
<p>class X<br />
{<br />
public:<br />
   X() {}<br />
   auto f = [](int x){ return x+2; };<br />
};</p>
<p>int main()<br />
{<br />
  X x;<br />
  std::cout &lt;&lt; X.f(5) &lt;&lt; &#8220;\n&#8221;;<br />
  return 0;<br />
}</p>
<p>Of course this example is simplistic but there are numerous places where I&#8217;d love to be able to use this pattern with c++ expression template objects being directly within another object, and I don&#8217;t see why this pattern can&#8217;t be allowed.</p>
<p>&#8211;jeffk++</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: POCO C++ Libraries Community Blog &#187; Herb Sutter on type inference vs. static/dynamic typing</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-609</link>
		<dc:creator>POCO C++ Libraries Community Blog &#187; Herb Sutter on type inference vs. static/dynamic typing</dc:creator>
		<pubDate>Sat, 21 Jun 2008 16:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-609</guid>
		<description>[...] a blog entry on the topic. Your humble correspondent posted some examples and links to DynamicAny, which caused [...]</description>
		<content:encoded><![CDATA[<p>[...] a blog entry on the topic. Your humble correspondent posted some examples and links to DynamicAny, which caused [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Fabijanic</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-607</link>
		<dc:creator>Alex Fabijanic</dc:creator>
		<pubDate>Sat, 21 Jun 2008 14:02:36 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-607</guid>
		<description>@ vu64:
Let me just say that I did not claim superiority of any library. I obviously have my preferences, but that is a topic for some other thread. Here, I have only provided facts. Some time ago, I have shared the same facts with &lt;a href=&quot;http://www.boost.org/users/people/kevlin_henney.html&quot; rel=&quot;nofollow&quot;&gt;Kevlin Henney&lt;/a&gt;, the author of boost::any. He had no problem agreeing.

And a couple more facts:

boost::any has been &lt;a href=&quot;http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Foundation/include/Poco/Any.h?view=markup&quot; rel=&quot;nofollow&quot;&gt;ported&lt;/a&gt; to &lt;a href=&quot;http://pocoproject.org/&quot; rel=&quot;nofollow&quot;&gt;POCO&lt;/a&gt;
Poco::DynamicAny design was inspired by boost::any. It was not meant as a replacement for any, but rather as a complement, providing &quot;softness&quot; on the value extraction side
The downside of DynamicAny compared to boost::any is that it can not hold any value out-of-the-box (a holder specialization is needed)


There&#039;s an article that should come out soon in &lt;a href=&quot;http://accu.org/index.php/overloadonline&quot; rel=&quot;nofollow&quot;&gt;Overload&lt;/a&gt; systematically comparing boost::any and boost::lexical_cast with Poco::DynamicAny. Stay tuned.</description>
		<content:encoded><![CDATA[<p>@ vu64:<br />
Let me just say that I did not claim superiority of any library. I obviously have my preferences, but that is a topic for some other thread. Here, I have only provided facts. Some time ago, I have shared the same facts with <a href="http://www.boost.org/users/people/kevlin_henney.html" rel="nofollow">Kevlin Henney</a>, the author of boost::any. He had no problem agreeing.</p>
<p>And a couple more facts:</p>
<p>boost::any has been <a href="http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Foundation/include/Poco/Any.h?view=markup" rel="nofollow">ported</a> to <a href="http://pocoproject.org/" rel="nofollow">POCO</a><br />
Poco::DynamicAny design was inspired by boost::any. It was not meant as a replacement for any, but rather as a complement, providing &#8220;softness&#8221; on the value extraction side<br />
The downside of DynamicAny compared to boost::any is that it can not hold any value out-of-the-box (a holder specialization is needed)</p>
<p>There&#8217;s an article that should come out soon in <a href="http://accu.org/index.php/overloadonline" rel="nofollow">Overload</a> systematically comparing boost::any and boost::lexical_cast with Poco::DynamicAny. Stay tuned.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vu64</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-604</link>
		<dc:creator>vu64</dc:creator>
		<pubDate>Sat, 21 Jun 2008 10:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-604</guid>
		<description>I don&#039;t see why you criticize boost::any so hard. Boost is the most popular C++ library. Anyway, this is the first time I&#039;ve heard about DynamicAny. If their library is superior, can they submit it to Boost to replace boost::any?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see why you criticize boost::any so hard. Boost is the most popular C++ library. Anyway, this is the first time I&#8217;ve heard about DynamicAny. If their library is superior, can they submit it to Boost to replace boost::any?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neilhendo</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-597</link>
		<dc:creator>neilhendo</dc:creator>
		<pubDate>Sat, 21 Jun 2008 02:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-597</guid>
		<description>Re this:

------------------
WidgetBase* wb = new Widget();

if( dynamic_cast( wb ) ) { … } 	
------------------

Wouldn&#039;t wb&#039;s dynamic type already be Widget* before the dynamic_cast?</description>
		<content:encoded><![CDATA[<p>Re this:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
WidgetBase* wb = new Widget();</p>
<p>if( dynamic_cast( wb ) ) { … }<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Wouldn&#8217;t wb&#8217;s dynamic type already be Widget* before the dynamic_cast?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: website design</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-596</link>
		<dc:creator>website design</dc:creator>
		<pubDate>Sat, 21 Jun 2008 01:55:19 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-596</guid>
		<description>Type inference in the ML family showed me that it&#039;s really easy to get lost in your types. When you see a variable with type vector::iterator, you can at least unravel that in a methodical fashion. But if you have to backtrack through half a dozen different variable declarations to figure out the type of your variable, it&#039;s a lot easier to get confused. IMO, the solution here is better tool support. The IDEs should be able to perform the same type inferencing to show you the variable types, and the error messages should be better. ML didn&#039;t have a decent IDE or error messages, but C++ will. Also, &quot;niftily&quot;? We&#039;re adverbializing adjectives now? Nuts, I must have justily missed the memo.</description>
		<content:encoded><![CDATA[<p>Type inference in the ML family showed me that it&#8217;s really easy to get lost in your types. When you see a variable with type vector::iterator, you can at least unravel that in a methodical fashion. But if you have to backtrack through half a dozen different variable declarations to figure out the type of your variable, it&#8217;s a lot easier to get confused. IMO, the solution here is better tool support. The IDEs should be able to perform the same type inferencing to show you the variable types, and the error messages should be better. ML didn&#8217;t have a decent IDE or error messages, but C++ will. Also, &#8220;niftily&#8221;? We&#8217;re adverbializing adjectives now? Nuts, I must have justily missed the memo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Fabijanic</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-595</link>
		<dc:creator>Alex Fabijanic</dc:creator>
		<pubDate>Sat, 21 Jun 2008 01:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-595</guid>
		<description>&quot;With boost’s “any”, you need to cast it to some concrete type before you can use it.&quot;

Actually, boost::any can only be cast  back to the exact type it holds. It works well for storing different types in an STL container. However, on the value retrieval side, it is even more rigid than the C++ language itself. 

I would also disagree with Herb&#039;s qualification of any_cast as flexible - boost::any is static and very rigid on the value extraction side. That&#039;s where DynamicAny (see my &lt;a href=&quot;http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-586&quot; rel=&quot;nofollow&quot;&gt;reply above&lt;/a&gt;) comes handy.</description>
		<content:encoded><![CDATA[<p>&#8220;With boost’s “any”, you need to cast it to some concrete type before you can use it.&#8221;</p>
<p>Actually, boost::any can only be cast  back to the exact type it holds. It works well for storing different types in an STL container. However, on the value retrieval side, it is even more rigid than the C++ language itself. </p>
<p>I would also disagree with Herb&#8217;s qualification of any_cast as flexible &#8211; boost::any is static and very rigid on the value extraction side. That&#8217;s where DynamicAny (see my <a href="http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-586" rel="nofollow">reply above</a>) comes handy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin C. Martin</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-594</link>
		<dc:creator>Martin C. Martin</dc:creator>
		<pubDate>Sat, 21 Jun 2008 01:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-594</guid>
		<description>Thanks for the great post Herb.  It&#039;s good to see these distinctions getting explained.

One of the key verbosity-reducers of dynamic languages is duck typing.  With boost&#039;s &quot;any&quot;, you need to cast it to some concrete type before you can use it.  &quot;any&quot; seems more like Java&#039;s Object than anything from a dynamically typed language.

Type inference doesn&#039;t give you duck typing, one of the key benefits of dynamic typing.  It seems that, even with type inference, you can&#039;t be &quot;dynamic when needed&quot; if that need is to call a method of a derived class, when all the compiler knows is that the object is of the base class.</description>
		<content:encoded><![CDATA[<p>Thanks for the great post Herb.  It&#8217;s good to see these distinctions getting explained.</p>
<p>One of the key verbosity-reducers of dynamic languages is duck typing.  With boost&#8217;s &#8220;any&#8221;, you need to cast it to some concrete type before you can use it.  &#8220;any&#8221; seems more like Java&#8217;s Object than anything from a dynamically typed language.</p>
<p>Type inference doesn&#8217;t give you duck typing, one of the key benefits of dynamic typing.  It seems that, even with type inference, you can&#8217;t be &#8220;dynamic when needed&#8221; if that need is to call a method of a derived class, when all the compiler knows is that the object is of the base class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-06-21</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-593</link>
		<dc:creator>links for 2008-06-21</dc:creator>
		<pubDate>Sat, 21 Jun 2008 00:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-593</guid>
		<description>[...] Type Inference vs. Static/Dynamic Typing « Sutter’s Mill (tags: c c++ compiler design programming language) [...]</description>
		<content:encoded><![CDATA[<p>[...] Type Inference vs. Static/Dynamic Typing « Sutter’s Mill (tags: c c++ compiler design programming language) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anocka</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-592</link>
		<dc:creator>anocka</dc:creator>
		<pubDate>Sat, 21 Jun 2008 00:25:51 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-592</guid>
		<description>&quot;Inference doesn’t have anything to do with dynamic typing.&quot;
Well, that&#039;s not always true.

In the ocaml object system, when a function calls the method m of type, say
    m : unit -&gt; int

on an object x, the inferred type of x is :
   x :  int; ... &gt;

Basically, the function accepts any object that has the m method. That&#039;s close to the dynamic paradigm (except that the presence of the methods is checked at compile-time).

Sadly, I don&#039;t know of any other similar typing system...</description>
		<content:encoded><![CDATA[<p>&#8220;Inference doesn’t have anything to do with dynamic typing.&#8221;<br />
Well, that&#8217;s not always true.</p>
<p>In the ocaml object system, when a function calls the method m of type, say<br />
    m : unit -&gt; int</p>
<p>on an object x, the inferred type of x is :<br />
   x :  int; &#8230; &gt;</p>
<p>Basically, the function accepts any object that has the m method. That&#8217;s close to the dynamic paradigm (except that the presence of the methods is checked at compile-time).</p>
<p>Sadly, I don&#8217;t know of any other similar typing system&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett Hall</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-590</link>
		<dc:creator>Brett Hall</dc:creator>
		<pubDate>Fri, 20 Jun 2008 22:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-590</guid>
		<description>I think the big win in with the auto keyword in C++ will be in some forms of meta-programming. A few years back I was working on an expression template system for doing vector and matrix operations and some of the template types involved were hairy to say the least. The auto keyword would have been a great help at the time in reducing things like

VecOp op = VecOp(op1, op2);

to 

auto op = VecOp(op1, op2);

On an unrelated note, it&#039;s interesting to see the reaction to Jeff&#039;s use of var in C# over at refector my code.  The first 3 out of five comments are complaints about it. It&#039;ll be interesting to see if var in C# gets the same reaction as closures are getting in Java.</description>
		<content:encoded><![CDATA[<p>I think the big win in with the auto keyword in C++ will be in some forms of meta-programming. A few years back I was working on an expression template system for doing vector and matrix operations and some of the template types involved were hairy to say the least. The auto keyword would have been a great help at the time in reducing things like</p>
<p>VecOp op = VecOp(op1, op2);</p>
<p>to </p>
<p>auto op = VecOp(op1, op2);</p>
<p>On an unrelated note, it&#8217;s interesting to see the reaction to Jeff&#8217;s use of var in C# over at refector my code.  The first 3 out of five comments are complaints about it. It&#8217;ll be interesting to see if var in C# gets the same reaction as closures are getting in Java.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Fabijanic</title>
		<link>http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-586</link>
		<dc:creator>Alex Fabijanic</dc:creator>
		<pubDate>Fri, 20 Jun 2008 21:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/#comment-586</guid>
		<description>There is also &lt;a href=&quot;http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Foundation/include/Poco/DynamicAny.h?view=markup&quot; rel=&quot;nofollow&quot;&gt;Poco::DynamicAny&lt;/a&gt;, which conveniently combines capabilities of boost::any and boost::lexical_cast, so you can do things like this:

DynamicAny any(&quot;42&quot;);
int i = any; // i == 42
any = 65536;
std::string s = any; // s == “65536”
char c = any; // too big, throws RangeException

or this:

std::cout &lt;&lt; RecordSet(session, &quot;SELECT * FROM Table&quot;);

All happening dynamically, behind the scene and (of course) in standard C++. See &lt;a href=&quot;http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Data/include/Poco/Data/Row.h?revision=415&amp;view=markup&quot; rel=&quot;nofollow&quot;&gt;Poco::Data::Row&lt;/a&gt; and &lt;a href=&quot;http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Data/samples/RowFormatter/src/RowFormatter.cpp?view=markup&quot; rel=&quot;nofollow&quot;&gt;Poco::Data::RowFormatter&lt;/a&gt; sample for a more complete insight.</description>
		<content:encoded><![CDATA[<p>There is also <a href="http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Foundation/include/Poco/DynamicAny.h?view=markup" rel="nofollow">Poco::DynamicAny</a>, which conveniently combines capabilities of boost::any and boost::lexical_cast, so you can do things like this:</p>
<p>DynamicAny any(&#8220;42&#8243;);<br />
int i = any; // i == 42<br />
any = 65536;<br />
std::string s = any; // s == “65536”<br />
char c = any; // too big, throws RangeException</p>
<p>or this:</p>
<p>std::cout &lt;&lt; RecordSet(session, &#8220;SELECT * FROM Table&#8221;);</p>
<p>All happening dynamically, behind the scene and (of course) in standard C++. See <a href="http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Data/include/Poco/Data/Row.h?revision=415&amp;view=markup" rel="nofollow">Poco::Data::Row</a> and <a href="http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Data/samples/RowFormatter/src/RowFormatter.cpp?view=markup" rel="nofollow">Poco::Data::RowFormatter</a> sample for a more complete insight.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
