<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Coffeehouse - is managed code faster than native?</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Coffeehouse - is managed code faster than native?</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Tue, 21 May 2013 15:56:17 GMT</pubDate>
	<lastBuildDate>Tue, 21 May 2013 15:56:17 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>69</c9:totalResults>
	<c9:pageCount>-69</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>the C# compiler is like 5 - 10x faster than the c&#43;&#43; compiler. Does that prove that real world managed code runs faster than native code?</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/7a500cb86acc4f98841da13a00ec3f8d#7a500cb86acc4f98841da13a00ec3f8d</link>
		<pubDate>Wed, 02 Jan 2013 14:20:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/7a500cb86acc4f98841da13a00ec3f8d#7a500cb86acc4f98841da13a00ec3f8d</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c7a500cb86acc4f98841da13a00ec3f8d">SteveRichter</a>: No. Perhaps the C# compiler is more parallel optimized during the compilation process. C&#43;&#43; is the fastest language there is. (in production use).</p><p><a href="http://blogs.msdn.com/b/vcblog/archive/2011/06/15/introducing-amp.aspx">http://blogs.msdn.com/b/vcblog/archive/2011/06/15/introducing-amp.aspx</a></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/84bbe1820ad64d36b799a13a00f349be#84bbe1820ad64d36b799a13a00f349be</link>
		<pubDate>Wed, 02 Jan 2013 14:45:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/84bbe1820ad64d36b799a13a00f349be#84bbe1820ad64d36b799a13a00f349be</guid>
		<dc:creator>Proton2</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Proton2/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/7a500cb86acc4f98841da13a00ec3f8d">36 minutes&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>the C# compiler is like 5 - 10x faster than the c&#43;&#43; compiler. Does that prove that real world managed code runs faster than native code?</p></div></blockquote><p></p><p>There are several reasons for this. Most importantly, C&#43;&#43; is a far more complex language (grammar wise) than C# so it takes longer to parse (particularly thanks to templates, which are a Turing-complete compile-time language), and the C&#43;&#43; compiler performs far more extensive optimizations (in the .Net world, most optimizations are performed by the JIT, so the work of the C# compiler is relatively light).</p><p>Whether managed or native is faster has no simple answer. With native code, it is possible to perform more optimizations&nbsp;so it is possible to write faster code than with managed. However, in practice it may be require extremely complex and hard to maintain code to actually beat managed code.&nbsp;A good example of this is the <a href="http://blogs.msdn.com/b/ricom/archive/2005/05/10/416151.aspx">optimization series that Raymond Chen and Rico Mariani once did</a>: his final optimized C&#43;&#43; version was faster than the&nbsp;.Net version, but he had to write his own memory allocation algorithms and stuff like that in order to get there. By comparison, the naïve .Net version was orders of magnitude faster than the naïve C&#43;&#43; version, and not even that much slower than the final optimized C&#43;&#43; version.</p><p>And that was done back in 2005, with .Net 2.0. There have been many significant performance improvements in .Net (particularly regarding start-up and the GC) since then.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/2f95a36372ce42e3a194a13a00f6de35#2f95a36372ce42e3a194a13a00f6de35</link>
		<pubDate>Wed, 02 Jan 2013 14:58:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/2f95a36372ce42e3a194a13a00f6de35#2f95a36372ce42e3a194a13a00f6de35</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/7a500cb86acc4f98841da13a00ec3f8d">40 minutes&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>the C# compiler is like 5 - 10x faster than the c&#43;&#43; compiler. Does that prove that real world managed code runs faster than native code.</p><p></p></div></blockquote><p></p><p>Length of time to compile is a bad measure of the performance of the output.</p><p>For example, the code I compile as &quot;Debug&quot; takes less time to compile than code compiled as &quot;Release&quot;, yet the code compiled as &quot;Release&quot; runs vastly faster.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3521539073d04b32ac13a13a00f95269#3521539073d04b32ac13a13a00f95269</link>
		<pubDate>Wed, 02 Jan 2013 15:07:45 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3521539073d04b32ac13a13a00f95269#3521539073d04b32ac13a13a00f95269</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/84bbe1820ad64d36b799a13a00f349be">6 minutes&nbsp;ago</a>, <a href="/Niners/Proton2">Proton2</a> wrote</p><p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c7a500cb86acc4f98841da13a00ec3f8d">SteveRichter</a>: No. Perhaps the C# compiler is more parallel optimized during the compilation process. C&#43;&#43; is the fastest language there is. (in production use).</p><p></p></div></blockquote><p></p><p>ok.&nbsp; I am just guessing that the C&#43;&#43; compiler, having been written in c&#43;&#43;, is impossible to refactor. I am finding it very sluggish and the compiler errors often times misleading. The other day I had the header version of a function returning a different type than the code version and the compiler just went nuts. Telling me I had over 100 errors.&nbsp; I run into that kind of scenario very frequently, forcing me to change my coding style where I recompile very frequently, after small code changes.</p><p>&nbsp;</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3d40fb29cef64849ac2fa13a00f9d211#3d40fb29cef64849ac2fa13a00f9d211</link>
		<pubDate>Wed, 02 Jan 2013 15:09:34 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3d40fb29cef64849ac2fa13a00f9d211#3d40fb29cef64849ac2fa13a00f9d211</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/3d40fb29cef64849ac2fa13a00f9d211">5 minutes&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>ok.&nbsp; I am just guessing that the C&#43;&#43; compiler, having been written in c&#43;&#43;, is impossible to refactor.</p><p></p></div></blockquote><p></p><p>Nice theory, except the C# compiler is written in C&#43;&#43; too (Mono's C# compiler is written in C#, but MS.Net's isn't).</p><p>It's C&#43;&#43;'s insane complexity, I tell you. C&#43;&#43;'s grammar isn't even LALR, so you can't use automated compiler generation tools like yacc or bison to create a parser for it. It is just stupidly convoluted in many places.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/393850c3981a4b53ab1aa13a00fc0dc6#393850c3981a4b53ab1aa13a00fc0dc6</link>
		<pubDate>Wed, 02 Jan 2013 15:17:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/393850c3981a4b53ab1aa13a00fc0dc6#393850c3981a4b53ab1aa13a00fc0dc6</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/2f95a36372ce42e3a194a13a00f6de35">10 minutes&nbsp;ago</a>, <a href="/Niners/Sven%20Groot">Sven Groot</a> wrote</p><p>Whether managed or native is faster has no simple answer. With native code, it is possible to perform more optimizations&nbsp;so it is possible to write faster code than with managed. However, in practice it may be require extremely complex and hard to maintain code to actually beat managed code.&nbsp;</p><p></p></div></blockquote><p></p><p>In my C&#43;&#43; code all strings are in std::wstring and I am making a lot of use of unique_ptr&lt;class&gt;. And since I do a lot of function calls which return these types, there must be a lot of constructors and destructors being called.&nbsp; Compared to C# simply returning a reference.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/89bb162ca11f49dd818ca13a00fc63b8#89bb162ca11f49dd818ca13a00fc63b8</link>
		<pubDate>Wed, 02 Jan 2013 15:18:55 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/89bb162ca11f49dd818ca13a00fc63b8#89bb162ca11f49dd818ca13a00fc63b8</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/89bb162ca11f49dd818ca13a00fc63b8">13 seconds&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>*snip*</p><p>In my C&#43;&#43; code all strings are in std::wstring and I am making a lot of use of unique_ptr&lt;class&gt;. And since I do a lot of function calls which return these types, there must be a lot of constructors and destructors being called.</p></div></blockquote><p></p><p>Could be, but not necessarily. In a lot of cases, the C&#43;&#43; compiler is able to avoid copying objects (copy elision). Even more so since the introduction of r-value references and move constructors in C&#43;&#43;11. And these things are aggressively inlined, even across compilation units.&nbsp;Doing those kinds of optimizations is what makes your code faster, but the compilation slower.</p><p>And std::unique_ptr doesn't have a copy constructor. That's kind of its main purpose (it does have a move constructor however, but that's no more expensive than copying&nbsp;a pointer).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ecffb04dfb074d0bb2bba13a00fd32ef#ecffb04dfb074d0bb2bba13a00fd32ef</link>
		<pubDate>Wed, 02 Jan 2013 15:21:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ecffb04dfb074d0bb2bba13a00fd32ef#ecffb04dfb074d0bb2bba13a00fd32ef</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/393850c3981a4b53ab1aa13a00fc0dc6">1 minute&nbsp;ago</a>, <a href="/Niners/Sven%20Groot">Sven Groot</a> wrote</p><p>*snip*</p><p>Nice theory, except the C# compiler is written in C&#43;&#43; too (Mono's C# compiler is written in C#, but MS.Net's isn't).</p><p></p></div></blockquote><p></p><p>what was Anders talking about last year when describing the data structures used in the Roselyn project?&nbsp; Where they did not have to recreate the entire parse tree or whatever it was called for every source code change. I recall him saying they had redone the entire compiler.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/11be3457c6df4b5a9b48a13a00fded9f#11be3457c6df4b5a9b48a13a00fded9f</link>
		<pubDate>Wed, 02 Jan 2013 15:24:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/11be3457c6df4b5a9b48a13a00fded9f#11be3457c6df4b5a9b48a13a00fded9f</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/84bbe1820ad64d36b799a13a00f349be">45 minutes&nbsp;ago</a>, <a href="/Niners/Proton2">Proton2</a> wrote</p><p>&nbsp;C&#43;&#43; is the fastest language there is.</p><p></p></div></blockquote><p></p><p>&nbsp;</p><p>Oh tosh. You could make that claim of anything that compiles to native. Speed is dependant on the compiler, the runtime, and how crappy the user's code is.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ad33c66283864a11bd37a13a01002f93#ad33c66283864a11bd37a13a01002f93</link>
		<pubDate>Wed, 02 Jan 2013 15:32:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ad33c66283864a11bd37a13a01002f93#ad33c66283864a11bd37a13a01002f93</guid>
		<dc:creator>blowdart</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/blowdart/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/393850c3981a4b53ab1aa13a00fc0dc6">26 minutes&nbsp;ago</a>, <a href="/Niners/Sven%20Groot">Sven Groot</a> wrote</p><p>*snip*</p><p>Nice theory, except the C# compiler is written in C&#43;&#43; too (Mono's C# compiler is written in C#, but MS.Net's isn't).</p><p>It's C&#43;&#43;'s insane complexity, I tell you. C&#43;&#43;'s grammar isn't even LALR, so you can't use automated compiler generation tools like yacc or bison to create a parser for it. It is just stupidly convoluted in many places.</p><p></p></div></blockquote><p></p><p>LOL .... it's funny, way back I loved C&nbsp; and to this day I will code in C or in C# but not in C&#43;&#43; unless I am forced to.... I have never liked what they did with C&#43;&#43; and never found a real world case where I could not write what I needed with C if I had to use C or C&#43;&#43;</p><p>as for speed well .net can be faster or slower depending on what is being done how it's done and many other factors.</p><p>runtime speed not the speed of the compiler.</p><p>compiler speed -- well as was posted what has to be done to compile C / C&#43;&#43; is way different than .net</p><p>also remember that a .net compiler only generates IL not native code. a C/C&#43;&#43; compiler does generate native code.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/df8ce80009af452e914ca13a0105da97#df8ce80009af452e914ca13a0105da97</link>
		<pubDate>Wed, 02 Jan 2013 15:53:22 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/df8ce80009af452e914ca13a0105da97#df8ce80009af452e914ca13a0105da97</guid>
		<dc:creator>figuerres</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/figuerres/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>One thing I found in both C# and C&#43;&#43; (STL), is to stay away from enumerators (foreach and begin()). Instead use simple integer loop indexing. There is a measurable performance drop in both cases when using enumerators.</p><p>Where&nbsp;performance doesn't matter, using an enumerator&nbsp;is fine.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/8b2dd119eea9481191aba13a011fb9bb#8b2dd119eea9481191aba13a011fb9bb</link>
		<pubDate>Wed, 02 Jan 2013 17:27:34 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/8b2dd119eea9481191aba13a011fb9bb#8b2dd119eea9481191aba13a011fb9bb</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/7a500cb86acc4f98841da13a00ec3f8d">3 hours&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>the C# compiler is like 5 - 10x faster than the c&#43;&#43; compiler. Does that prove that real world managed code runs faster than native code?</p><p></p></div></blockquote><p></p><p>That's an absurd conclusion. Depending on language compexity and optimizations applied, the compilation-time can vary wildly. One of the Go compilers can compile large code bases in less than a second. The Go language was designed to allow for that but it's also a product of how much optimization is applied in that particular compiler. There is still a need for a release compiler with a different compile-time vs run-time trade-off. The MLton compiler performs whole-program analysis and optimization - that is obviously going to be more time-consuming than local optimizations. The conclusion is so absurd that it leads one to believe you want to spur a heated debate.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/a586d8eaf5de4822a67aa13a0124bc38#a586d8eaf5de4822a67aa13a0124bc38</link>
		<pubDate>Wed, 02 Jan 2013 17:45:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/a586d8eaf5de4822a67aa13a0124bc38#a586d8eaf5de4822a67aa13a0124bc38</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/8b2dd119eea9481191aba13a011fb9bb">17 minutes&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>One thing I found in both C# and C&#43;&#43; (STL), is to stay away from enumerators (foreach and begin()). Instead use simple integer loop indexing. There is a measurable performance drop in both cases when using enumerators.</p><p>Where&nbsp;performance doesn't matter, using an enumerator&nbsp;is fine.</p><p></p></div></blockquote><p></p><p>If the use of an SDL enumerator rather than an integer indexer is the thing tanking your performance, then something has gone so far wrong in your app it's unreal.</p><p>My suggestion is that you&nbsp;<em>benchmark&nbsp;</em>your code before optimising it. Optimise only the bits that are actually in your hotpath, and choose algorithms that can be easily parallelized or which have known correct library implementations with lower big-Ohs to the ones you're using.</p><p>The rest of your code should focus on being&nbsp;<em>readable</em> and&nbsp;<em>correct&nbsp;</em>instead of being fast.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/50521422f24b408e8a03a13a0125722c#50521422f24b408e8a03a13a0125722c</link>
		<pubDate>Wed, 02 Jan 2013 17:48:24 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/50521422f24b408e8a03a13a0125722c#50521422f24b408e8a03a13a0125722c</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/50521422f24b408e8a03a13a0125722c">34 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictait​or</a> wrote</p><p>*snip*</p><p>If the use of an SDL enumerator rather than an integer indexer is the thing tanking your performance, then something has gone so far wrong in your app it's unreal.</p><p></p></div></blockquote><p></p><p>Wow that is quite a generalization for someone that has no clue what my code looks like. I'm talking about tight loops that does DSP processing (realtime FFT, filtering, FFT analysis, etc)&nbsp;as well as code that does asynchronous multithreaded low-level IO. In such cases the overhead of using enumerators can easily add a 30% performance drop in such tight loops. I've done the benchmarks and that is what they show. What does your&nbsp;benchmarks show for such cases?</p><p>If you think &quot;something has gone wrong&quot; in my code then with all due respect you should stick to writing simple code&nbsp;where no-one gives a crap about actual performance.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/830de66f749c44ec8bfaa13a01312995#830de66f749c44ec8bfaa13a01312995</link>
		<pubDate>Wed, 02 Jan 2013 18:31:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/830de66f749c44ec8bfaa13a01312995#830de66f749c44ec8bfaa13a01312995</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/830de66f749c44ec8bfaa13a01312995">20 minutes&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>Wow that is quite a generalization for someone that has no clue what my code looks like. I'm talking about tight loops that does DSP processing (realtime FFT, filtering, FFT analysis, etc)&nbsp;as well as code that does asynchronous multithreaded low-level IO. In such cases the overhead of using enumerators can easily add a 30% performance drop in such tight loops. I've done the benchmarks and that is what they show. What does your&nbsp;benchmarks show for such cases?</p><p></p></div></blockquote><p></p><p>I think you might get a bigger performance gain by taking a step back and asking if using other types of data structures and coding styles might give you better performance.</p><p>For example, a flat array will give you faster data accesses than an SDL list, even when using integer indexors.</p><p>And if you're really spending all of your time in a hot loop doing memory/CPU operations like FFTs, try writing them as a GPU shader in HLSL; you'll get orders of magnitude speed up by doing so. That's what I do for password-cracking for example. I certainly don't use the SDL at all for the hot loops of mine that actually make the room so hot you need four water cooling pumps and a heat-sink the size of a table to keep the processors from melting (but as you say, I only write code where performance doesn't matter, right <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' />)</p><p>Focusing on minor things like iterators versus integer indexers tends to hide the wood for the trees - as you said before you spend a lot of time doing low-level&nbsp;asynchronous&nbsp;IO - the syscall to kick that off will take tens of thousands of times longer to complete than the difference between an index in SDL verus the overloaded array indexer.</p><p>And since the SDL interator is not contractually bound to be slower - it might actually be faster on some machines or in future versions of the CRT. For example, integer array accesses need to be bounds checked for safety, whereas iterators do not.</p><p>Morale of the story is that writing, easy-to-read, obviously-correct and good-practices code for the most part, and only ever optimising (and liberally commenting and benchmarking) genuine hotloops tends to lead to better, more reliable and more long-lived code.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c06a34289bb941b98db3a13a013b46ef#c06a34289bb941b98db3a13a013b46ef</link>
		<pubDate>Wed, 02 Jan 2013 19:07:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c06a34289bb941b98db3a13a013b46ef#c06a34289bb941b98db3a13a013b46ef</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#cc06a34289bb941b98db3a13a013b46ef">evildictaitor</a>:</p><p>Well I was throwing different examples in there, so different approaches are required in each case.</p><p>To simplify things, for this example let's just say I'm implementing a DSP algorithm in C#. In that case there is quite a big difference in using for vs foreach. In my algorithm I analyze the FFT results, then classify peaks based on certain criteria. Then there are additional algorithms that enumerate over those results and analyze the musical relationships between all the collected peaks. So as you can see, there is a lot of looping.</p><p>What I have found is that the performance increase when switching to for loops&nbsp;from foreach loops is roughly 30%.</p><p>The IO example is a bit more complex because just profiling a specific part of the management code itself (C&#43;&#43;) has shown that that part also had a roughly 30% increase in performance when going to simple integer indexing. Now the IO in other parts of the code is a much bigger bottleneck, however changing the management code to use integer indexing resulted in an overall improvement of 5% or so. Not as big but still worthwhile.</p><p>BTW in this particular case the DSP algorithm needs to run on WP7/8. As such I can't use the GPU. I can use C&#43;&#43; on WP8 however to keep it backwards compatible with WP7, I prefer not to do that. The point is that with the right coding approach it is fast enough that I <em>don't</em> need to resort to&nbsp;something else.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3661cbad65ac49a5bf81a13a0142e74e#3661cbad65ac49a5bf81a13a0142e74e</link>
		<pubDate>Wed, 02 Jan 2013 19:35:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3661cbad65ac49a5bf81a13a0142e74e#3661cbad65ac49a5bf81a13a0142e74e</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/a586d8eaf5de4822a67aa13a0124bc38">1 hour&nbsp;ago</a>, <a href="/Niners/exoteric">exoteric</a> wrote</p><p>*snip*</p><p>That's an absurd conclusion. Depending on language compexity and optimizations applied, the compilation-time can vary wildly. One of the Go compilers can compile large code bases in less than a second.</p><p>&nbsp;</p></div></blockquote><p></p><p>I do not know other compilers. Was just figuring that the compilier would be the flagship app of a language and a lot of effort would be put into making it run well. And my recent experience using visual C&#43;&#43; is it is a bit shabby, kind of like the language and the compiler have been hacked together over the years. Which would be fine if I had an alternative. But C# does not handle structs very well and Microsoft says windows shell code should be written in C&#43;&#43;.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/dd9185591f0d4d78a501a13a0147ecd2#dd9185591f0d4d78a501a13a0147ecd2</link>
		<pubDate>Wed, 02 Jan 2013 19:53:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/dd9185591f0d4d78a501a13a0147ecd2#dd9185591f0d4d78a501a13a0147ecd2</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/393850c3981a4b53ab1aa13a00fc0dc6">4 hours&nbsp;ago</a>, <a href="/Niners/Sven%20Groot">Sven Groot</a> wrote</p><p>*snip*</p><p>Nice theory, except the C# compiler is written in C&#43;&#43; too</p><p></p></div></blockquote><p></p><p>Not any more, it was rewritten in C#.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/394aaec8440e4998a130a13a014e8938#394aaec8440e4998a130a13a014e8938</link>
		<pubDate>Wed, 02 Jan 2013 20:18:00 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/394aaec8440e4998a130a13a014e8938#394aaec8440e4998a130a13a014e8938</guid>
		<dc:creator>Auxon</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/FuncOfT/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c394aaec8440e4998a130a13a014e8938">FuncOfT</a>: In fact, I think they mentioned that they wrote each language's compiler in it's target language. C&#43;&#43;, C# and VB.Net. I don't know about F#.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/a42a201daebb456f872ca13a0153c901#a42a201daebb456f872ca13a0153c901</link>
		<pubDate>Wed, 02 Jan 2013 20:37:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/a42a201daebb456f872ca13a0153c901#a42a201daebb456f872ca13a0153c901</guid>
		<dc:creator>kettch</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/kettch/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/394aaec8440e4998a130a13a014e8938">7 hours&nbsp;ago</a>, <a href="/Niners/FuncOfT">FuncOfT</a> wrote</p><p>*snip*</p><p>Not any more, it was rewritten in C#.</p><p></p></div></blockquote><p></p><p>See: ~04:10 <a href="http://channel9.msdn.com/Events/Ch9Live/Channel-9-Live-at-Tech-Ed-Europe-2012/Dustin-Campbell-Roslyn">http&#58;&#47;&#47;channel9.msdn.com&#47;Events&#47;Ch9Live&#47;Channel-9-Live-at-Tech-Ed-Europe-2012&#47;Dustin-Campbell-Roslyn</a></p><p>Roslyn is slower WRT raw performance.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/657207ddadc642afb186a13b004ac956#657207ddadc642afb186a13b004ac956</link>
		<pubDate>Thu, 03 Jan 2013 04:32:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/657207ddadc642afb186a13b004ac956#657207ddadc642afb186a13b004ac956</guid>
		<dc:creator>felix9</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/felix9/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>Assembly &gt; C&#43;&#43; &gt; C# in raw performance.</p><p>C# &gt; C&#43;&#43; &gt; Assembly in ease of programing.</p><p>And since C# is very close to C&#43;&#43; in performance, you shouldn't worry about that. Often you ended up making cleaner faster program because it is easier using C# and gives your more time and less intimidation when trying to improve your program.</p><p>To me, C# for most apps and decent 3D games, C&#43;&#43; for extreme games and it is not limited to .Net platform.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/64d3dbeab4794e9189f8a13b005ccc58#64d3dbeab4794e9189f8a13b005ccc58</link>
		<pubDate>Thu, 03 Jan 2013 05:37:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/64d3dbeab4794e9189f8a13b005ccc58#64d3dbeab4794e9189f8a13b005ccc58</guid>
		<dc:creator>magicalclick</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/magicalclick/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/64d3dbeab4794e9189f8a13b005ccc58">3 hours&nbsp;ago</a>, <a href="/Niners/magicalclick">magicalclick</a> wrote</p><p>Assembly &gt; C&#43;&#43; &gt; C# in raw performance.</p><p></p></div></blockquote><p></p><p>I'd like the caveat that:</p><p>Optimal assembly &gt; optimal C&#43;&#43; &gt; optimal C# in raw performance.</p><p>With very few exceptions, people that write assembly write worse assembly (in terms of correctness and in terms of performance) than comes out the back of the C&#43;&#43; compiler and worse assembly than comes out of the C# JITter.</p><p>And people that make use of __asm in C&#43;&#43; not only make their code no longer portable to platforms other than x86 (including ARM and x64), they also cause the compiler to turn off inlining for that function, turn off optimisations for the function and cause the compiler to save and restore all of the registers it heuristically thinks it touches. It can also cause the compiler to make really suboptimal use of registers in the code:</p><p>Consequently the inline code inside a C&#43;&#43; function:</p><p>__asm { xor ebx, ebx; mov [_local], ebx }</p><p>is technically equivilent to _local = 0, but can be thousands of times slower in practice (since the compiler now has to save EBX over the block, no longer knows that _local is zero for optimisations later in the function, and can't initialize _local at the same time as it initializes all of the other local variables (using STOSDs not movs), it can't inline the function, can't make the function EBP-less and can't shuffle the asm block around to get better store/fetch performance on the processor, can't use SIMD and can't perform any compile-time checks of the code.</p><p>Even worse - if you dare to use that code in a declspec naked function without saving EBX over the call yourself, you might find that EBX is a register that you shouldn't be blindly destroying - and if you do it in kernel mode there's an exploitable error in there too.</p><p>It's also much harder to do algorithmic improvement in lower level languages. For example, doing a quick-sort in assembler is so difficult that in practice people do easier-to-implement, less-likely-to-go-wrong, but worse-big-Oh-performance algorithms when forced to use lower level languages, and consequently 2 days work on a handwritten assembler algorithm is likely to yield a slower algorithm than an&nbsp;equivalent&nbsp;amount of work on optimising the algorithm in a higher level language.</p><p>Morale of the story is that optimal assembler &gt; optimal C&#43;&#43;, but for nearly all values of &quot;you&quot;, your assembler &lt;&lt;&lt; Microsoft C&#43;&#43; compiler release output of your C&#43;&#43;.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/46a40f75bd9940b1889ba13b0097ca80#46a40f75bd9940b1889ba13b0097ca80</link>
		<pubDate>Thu, 03 Jan 2013 09:12:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/46a40f75bd9940b1889ba13b0097ca80#46a40f75bd9940b1889ba13b0097ca80</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/ad33c66283864a11bd37a13a01002f93">1 day&nbsp;ago</a>, <a href="/Niners/blowdart">blowdart</a> wrote</p><p>*snip*</p><p>&nbsp;</p><p>Oh tosh. You could make that claim of anything that compiles to native. Speed is dependant on the compiler, the runtime, and how crappy the user's code is.</p><p></p></div></blockquote>sure, but C&#43;&#43; is also one of its kind with the not paying for what you don't use philosophy, being native doesn't&nbsp;necessarily&nbsp;mean control or speed given high enough abstractions<p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3c01a8505dde4d4aaf5ba13b0141a46c#3c01a8505dde4d4aaf5ba13b0141a46c</link>
		<pubDate>Thu, 03 Jan 2013 19:31:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3c01a8505dde4d4aaf5ba13b0141a46c#3c01a8505dde4d4aaf5ba13b0141a46c</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>I haven't really seen a good argument, ever, on why managed languages (or dynamic/static) inherently perform better or worse than unmanaged. You can look at benchmarks all day, but all it will tell you is compilers/runtimes are better at optimization than others. Nothing about <em>languages</em>.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/e97a5bec54a94295bf83a13c01695eb3#e97a5bec54a94295bf83a13c01695eb3</link>
		<pubDate>Fri, 04 Jan 2013 21:55:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/e97a5bec54a94295bf83a13c01695eb3#e97a5bec54a94295bf83a13c01695eb3</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>Dynamic languages versus static languages is easy: dynamic languages need more runtime checks and an embedded parser in order to run code. Static languages get to remove certain checks (e.g. C&#43;&#43; doesn't need to decide if a variable should use an ADD opcode to add two integers or an FADD or possible a full-blown strncat, whereas PHP given a random variable doesn't know until runtime.</p><p>Managed languages versus unmanaged ones is less obviously one side or the other - managed languages get to take certain optimisations based on runtime data that static ones can't do, whereas static languages get to make slower, but ultimately more effective optimisations because they're not under pressure to return quickly so that the runtime isn't held up by the JIT.</p><p>Similarly the heap versus the GC are much of a muchness. The GC has to do expensive collects, but native heaps have to do expensive free-block&nbsp;coalescing and lose performance due to stuff like fragmentation pushing up the working set of the process and hence accesses being more likely to fault.</p><p>What I would really like though is the ability to tell C# to compile my app down not to CIL but to x86 and for it to burn in or link to a GC implementation. If it could strip all symbols, types and reflective information from the binary like I can strip PDBs from C&#43;&#43; that would be&nbsp;extraordinarily&nbsp;awesome too.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/26064131ee74452fb02ea13c0175a4db#26064131ee74452fb02ea13c0175a4db</link>
		<pubDate>Fri, 04 Jan 2013 22:40:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/26064131ee74452fb02ea13c0175a4db#26064131ee74452fb02ea13c0175a4db</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>The situations where you can know that when a function is called from somewhere it will always be passed values of a certain type are the same in static and dynamic languages (that's how type inference works). And in the situations where you can't, static typing doesn't buy you anything because you'd have to check the type anyway (eg, typecasting unpredictable input from I/O) or use interfaces to accomplish what dynamic languages give you for free via duck typing. (Also poorly and more verbosely.)</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3e6c712874b849ada023a13c01836919#3e6c712874b849ada023a13c01836919</link>
		<pubDate>Fri, 04 Jan 2013 23:30:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3e6c712874b849ada023a13c01836919#3e6c712874b849ada023a13c01836919</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/2f95a36372ce42e3a194a13a00f6de35">2 days&nbsp;ago</a>, <a href="/Niners/Sven%20Groot">Sven Groot</a> wrote</p><p>*snip*</p><p>There are several reasons for this. Most importantly, C&#43;&#43; is a far more complex language (grammar wise) than C# so it takes longer to parse (particularly thanks to templates, which are a Turing-complete compile-time language), and the C&#43;&#43; compiler performs far more extensive optimizations (in the .Net world, most optimizations are performed by the JIT, so the work of the C# compiler is relatively light).</p></div></blockquote>Based on research made by folk at the LLVM, it seems that the include system is the main offender, with modules they proved the the compilation time can be greatly reduced. The include system is flexible, and for any project you could probably find the optimal structure that yields the optimal compilation times, but not without sacrificing maintainability and readability.<p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/1c430da389af4863b1a7a13d005eb69c#1c430da389af4863b1a7a13d005eb69c</link>
		<pubDate>Sat, 05 Jan 2013 05:44:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/1c430da389af4863b1a7a13d005eb69c#1c430da389af4863b1a7a13d005eb69c</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/3e6c712874b849ada023a13c01836919">15 hours&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>The situations where you can know that when a function is called from somewhere it will always be passed values of a certain type are the same in static and dynamic languages (that's how type inference works).</p><p></p></div></blockquote><p></p><p>Type inference can&nbsp;<em>sometimes&nbsp;</em>tell what type a parameter will be (if you can, you get fast speeds. If you can't you have to do a slow runtime check).</p><p>Static types mean that you can&nbsp;<em>always&nbsp;</em>tell that a parameter will be, meaning that you never need to do a slow runtime check to ask what a parameter is to decide whether &#43; means ADD or FADD or call variant_Add.</p><p>&nbsp;</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/1a87079f1f524ed1ae81a13d00f83db9#1a87079f1f524ed1ae81a13d00f83db9</link>
		<pubDate>Sat, 05 Jan 2013 15:03:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/1a87079f1f524ed1ae81a13d00f83db9#1a87079f1f524ed1ae81a13d00f83db9</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c1a87079f1f524ed1ae81a13d00f83db9">evildictaitor</a>:</p><p>Can you point out a situation where type inference can't tell what a type would be, but a programmer can?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/f0546eb71a7d40418e19a13d01219b82#f0546eb71a7d40418e19a13d01219b82</link>
		<pubDate>Sat, 05 Jan 2013 17:34:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/f0546eb71a7d40418e19a13d01219b82#f0546eb71a7d40418e19a13d01219b82</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>There is major things that I feel constitute what I expect out of dynamic languages:</p><ul><li>Types as values instead of types as variables </li><li>Duck typing </li><li>Optional metaprogramming / reflection </li></ul><p>I'd like to really know why, on an objective level, these features would effect performance in any way, that a static language would not suffer from, ie. from virtual calls or type casting when needed to do certain things in a static language like I/O or polymorphism and some kinds of signalling. Reflection/metaprogramming is the one feature that I can see really complicating optimization (especially AOT), because it allows the programmer to literally f**k with code in arbitrary ways at runtime. But that sort of thing is optional even in dynamic languages and I think it's just &quot;slow&quot; in any language that offers it.</p><p>I like strongly typed dynamic languages. Also, the language doesn't need to be compiled at runtime, it could have a compiler that precompiles directly into machine code, if this improves performance.</p><p>Just to be specific..a dynamic language still should have a rich type system that exposes a reasonable amount of the functionality available on the CPU. If it only supports is the String datatype or floats, well that's not really what I'm looking for.<br><br>JavaScript/V8 engine is pretty interesting because at least on Debian's benchmark game it performance competitively with Mono and Java (both considered very fast), despite having inherited JavaScript's various optimization difficulties and not doing any precompilation like they do, oh and being significantly newer.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b87ce0740825408cb754a13d013817f4#b87ce0740825408cb754a13d013817f4</link>
		<pubDate>Sat, 05 Jan 2013 18:56:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b87ce0740825408cb754a13d013817f4#b87ce0740825408cb754a13d013817f4</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/f0546eb71a7d40418e19a13d01219b82">3 hours&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c1a87079f1f524ed1ae81a13d00f83db9">evildictaitor</a>:</p><p>Can you point out a situation where type inference can't tell what a type would be, but a programmer can?</p><p></p></div></blockquote><p></p><p>function &nbsp;add(var1, var2) { return var1 &#43; var2; }</p><p>alert(add(1, 2)); alert(add(&quot;1&quot;, &quot;2&quot;));</p><p>In this case, add will be implemented by a call, not by an ADD because two type inference passes will come back with different types.</p><p>If this was done via a C&#43;&#43; template the first time will be an ADD opcode for integer addition and the second one will be done by a call to a string concatenation routine.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ab0f145eea964ee58712a13d0162803c#ab0f145eea964ee58712a13d0162803c</link>
		<pubDate>Sat, 05 Jan 2013 21:30:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ab0f145eea964ee58712a13d0162803c#ab0f145eea964ee58712a13d0162803c</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>I don't get why that would require runtime type checking. The type of the values you are passing to add could be unambiguously determined to be (integer,integer) and (string,string). Thus the compiler could create two functions (or even inline the code), one for add(string,string) and one for add(int,int).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/4d845e2b549a414096cea13e000d35b1#4d845e2b549a414096cea13e000d35b1</link>
		<pubDate>Sun, 06 Jan 2013 00:48:05 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/4d845e2b549a414096cea13e000d35b1#4d845e2b549a414096cea13e000d35b1</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/4d845e2b549a414096cea13e000d35b1">17 hours&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>I don't get why that would require runtime type checking. The type of the values you are passing to add could be unambiguously determined to be (integer,integer) and (string,string). Thus the compiler could create two functions (or even inline the code), one for add(string,string) and one for add(int,int).</p><p></p></div></blockquote><p></p><p>If you think type inference in real programs is quick, easy or accurate, I suggest you go work for a compilers team for a short while. They will&nbsp;disfranchise&nbsp;you of this opinion.</p><p>Perhaps then you will understand why <em>knowing&nbsp;</em>what a type is allows you to generate faster code than <em>trying to&nbsp;guess&nbsp;</em>what it is.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/8b709de12c6c46dfb035a13e012b5d43#8b709de12c6c46dfb035a13e012b5d43</link>
		<pubDate>Sun, 06 Jan 2013 18:09:57 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/8b709de12c6c46dfb035a13e012b5d43#8b709de12c6c46dfb035a13e012b5d43</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/8b709de12c6c46dfb035a13e012b5d43">37 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictait​or</a> wrote</p><p>*snip*</p><p>If you think type inference in real programs is quick, easy or accurate, I suggest you go work for a compilers team for a short while. They will&nbsp;disfranchise&nbsp;you of this opinion.</p><p>Perhaps then you will understand why <em>knowing&nbsp;</em>what a type is allows you to generate faster code than <em>trying to&nbsp;guess&nbsp;</em>what it is.</p><p></p></div></blockquote><p></p><p>Explain when it isn't accurate. In your example, it would be trivial for the compiler to know the type, the parens give away the string and the fact that the value is a number gives away the int. Thus the compiler could optimize the function call without losing the advantages of dynamic behavior.</p><p>I'm trying to understand the instances when you wouldn't know what a type would be ahead-of-time. The only times I can think of involve metaprogramming and indirect calls (ie. polymorphism/interfaces/virtual calls, like using something like an &quot;IAddable&quot; and one function, which is what static languages use to get around the lack of duck typing in the language).</p><p>I didn't say writing an optimizing compiler is easy for dynamic language (or for static language even), just that I don't see what static languages inherently buy in performance (ie. static languages are &quot;inherently&quot; more optimization). If there isn't a inherent performance advantage, I want to see at least some example of a hard AI problem involved in decorating variables with types.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/214175b5f56448c4a50ca13e013681b6#214175b5f56448c4a50ca13e013681b6</link>
		<pubDate>Sun, 06 Jan 2013 18:50:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/214175b5f56448c4a50ca13e013681b6#214175b5f56448c4a50ca13e013681b6</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/214175b5f56448c4a50ca13e013681b6">3 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>*snip*</p><p>Explain when it isn't accurate.&nbsp;</p><p></p></div></blockquote><p></p><p>Because type inference between functions is a whole program optimisation, and is expensive and infeasible for large programs. Inlining functions can also only be done for certain classes of functions - namely small ones with no recursion.</p><p>Ultimately your solution for making a program written without types faster&nbsp;is to change it into a program written with types by type inference. Surely even you can see that it's faster (and more likely to find bugs) if you ask the programmer what the type should be in rather than trying (and often failing) to infer the type by second guessing the programmer.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/d95b70c5e8dd42bd94b2a13e013d4447#d95b70c5e8dd42bd94b2a13e013d4447</link>
		<pubDate>Sun, 06 Jan 2013 19:15:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/d95b70c5e8dd42bd94b2a13e013d4447#d95b70c5e8dd42bd94b2a13e013d4447</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>It can't be that complicated to do a search for places a function is called? That's O(n lg n) on the size of the code base at best?</p><p>I don't agree with letting code be more verbose to help the compiler. Isn't the point of programming languages to take needless complexity from the programmer? If we wanted to tell the computer everything, we'd be using assembly language.</p><p>I like this quote from the author of the Ruby language:</p><p><em>Often people, especially computer engineers, focus on the machines. They think, &quot;By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something.&quot; They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves. </em>--Yukihiro Matsumoto</p><p>I've done Java for awhile professionally. But now after doing Ruby for awhile, I've really started to understand this, especially why statically typed OO make programming far more complicated then it needs to be. The main thing is how much effort the team spends on pointless taxonomy, that's pretty much eliminated with Ruby. (In fact, I would say assembly is even better on this front. Static OO languages add complexity that simply doesn't even exist at the CPU level!) I'd say overall, productivity is just much better, especially the more people join a project. Less people arguing endlessly over how an object model should look.</p><p>It would be a shame if we still used static languages in the mainstream 20, 30 years from now.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c543afa210be4596acaaa13e01408a8b#c543afa210be4596acaaa13e01408a8b</link>
		<pubDate>Sun, 06 Jan 2013 19:27:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c543afa210be4596acaaa13e01408a8b#c543afa210be4596acaaa13e01408a8b</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>I think also having classical object creation is a bit easier to optimize vs prototypes. But it ought to be able to optimize both using some compiler heuristics. Although not every case of prototype-based object creation can be optimized, obviously ones that kinda look like a class creation would be easier (think what TypeScript generates).</p><p>With how fast it JavaScript is these days, and JavaScript is not really the best example of an easy to optimize dynamic language. It makes me wonder if you made a dynamic language, still with duck typing and types as values but with some minor modifications (eg: classes, richer numeric types) to help with static optimizations could be made to be C&#43;&#43; fast. Anyway I'd definitely like to learn more about this sort of thing.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/cd27aad115bd442d8aa1a13e014506a6#cd27aad115bd442d8aa1a13e014506a6</link>
		<pubDate>Sun, 06 Jan 2013 19:43:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/cd27aad115bd442d8aa1a13e014506a6#cd27aad115bd442d8aa1a13e014506a6</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/c543afa210be4596acaaa13e01408a8b">11 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>It can't be that complicated to do a search for places a function is called? That's O(n lg n) on the size of the code base at best?</p><p></p></div></blockquote><p></p><p>For <em>n&nbsp;</em>functions with&nbsp;<em>m&nbsp;</em>instructions where each parameter is&nbsp;<em>v&nbsp;</em>indirected from a type-fix point you have at least O(nmv) to resolve the function. If function lengths are independent of codebase size and type indirection grows with lg(n), this is O(n^2 lg(n)) at&nbsp;the very least, and that's assuming that the type of the parameter passed to the argument is transparently obvious what the type is. And as soon as you get a recursion loop or calls from external libraries the answer becomes undecidable ( pow($v, $n) { return ($n == 1)? 0 : pow($v,$n-1)*$v; } has indeterminate type to the compiler).</p><p></p><blockquote><div class="quoteText"><p></p><p>I don't agree with letting code be more verbose to help the compiler. Isn't the point of programming languages to take needless complexity from the programmer? If we wanted to tell the computer everything, we'd be using assembly language.</p><p></p></div></blockquote><p></p><p>You assume that the types add verbosity to the language just to get performance gain. Static types let you discover problems with your code as well. Telling my compiler that I intend to return an array of doubles from this function and it being able to tell me that foo(&quot;2&quot;, 1)[0] is a double, not an array of doubles is something that helps me keep typos, errors and knock-on effects of changing internal functions (which potentially affects the correctness of the callers) to a minimum.</p><p>Essentially static types are a really basic set of unit tests. They say &quot;Hey - this function is going to return a double. So unit test it so that it can never return an array, or a file pointer&quot;.</p><p>But unlike unit tests, it's a complete set of unit tests. The unit test covers all inputs and&nbsp;guarantees&nbsp;that the function will return something useful.</p><p></p><blockquote><div class="quoteText"><p></p><p>I've done Java for awhile professionally.</p><p></p></div></blockquote><p></p><p>I feel sorry for you. Java is a terrible language, and I see how if you think all statically typed languages are like Java and all dynamic ones are like Ruby why you'd think that static languages suck. However, before you condemn all static languages, I'd like to point out that not all of them are so retarded and verbose for so little benefit.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ae430e59980d43a4bd4ba13e0145a43a#ae430e59980d43a4bd4ba13e0145a43a</link>
		<pubDate>Sun, 06 Jan 2013 19:45:37 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/ae430e59980d43a4bd4ba13e0145a43a#ae430e59980d43a4bd4ba13e0145a43a</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>I don't buy the types as safety argument. Types are a very, very poor code contracts. You can enforce contracts in dynamic languages too. Also, poor man's immutability. So what if I can't change int a into &quot;foo&quot;, I can change it into 6 and that might totally change the behavior of the program. Erlang is an example of a language that is dynamic but has first class support for contracts and immutability is completely enforced. A dynamic language that is used to build routing and switching equipment that is expected to be totally impervious to anything.</p><p>I don't really believe type problems cause many bugs, it's more the contents of the types (passing bad values) that cause bugs and static typed languages don't help there. Again, code contracts help and immutability makes it a bit easier to guess certain things about the behavior of the code.</p><p>I've also done C# professionally (not nearly as long as Java), and while I agree it is better language than Java, I think it's feels like a dated approach. It's too much like Java.. And I prefer Java and all it's memory management over C&#43;&#43;. That covers all the mainstream static languages I think.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c50fbdf006e3478c9b7fa13e0146f8b6#c50fbdf006e3478c9b7fa13e0146f8b6</link>
		<pubDate>Sun, 06 Jan 2013 19:50:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c50fbdf006e3478c9b7fa13e0146f8b6#c50fbdf006e3478c9b7fa13e0146f8b6</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/c50fbdf006e3478c9b7fa13e0146f8b6">32 seconds&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>I don't buy the types as safety argument. Types are a very, very poor code contracts. You can enforce contracts in dynamic languages too. Also, immutability.</p><p></p></div></blockquote><p></p><p>You can, but experience shows that most people using dynamic languages don't use the time they gain by writing faster code to write better unit tests and other contracts.</p><p>Type safety is a ubiquitous set of basic unit tests on your code that are hard to opt out of. Indeed - Spec# goes further and tries to build even better contracts into the language, essentially going the complete other direction away from dynamic langauges.</p><p></p><blockquote><div class="quoteText"><p></p><p>I don't really believe type problems cause many bugs</p><p></p></div></blockquote><p></p><p>SQL injections, type-confusion attacks, XSS injections, code execution flaws, eval inclusions, arbitrary file upload vulnerabilities and SOAP injections are all special cases of bugs caused by types getting confused.</p><p>So yeah, type confusion bugs are a big real world problem.</p><p>I'm not saying that static languages fix all your problems. It's possible to make really bad logic bugs in static languages, but the types fix lots of the basic typos or knock-on problems caused by refactoring internal functions.</p><p>You need unit tests and security reviews for code written in static languages&nbsp;<em>and&nbsp;</em>in dynamic languages, but in the absense of formal security procedures and unit tests, dynamic languages tend to come out&nbsp;<em>vastly&nbsp;</em>worse in security and correctness reviews.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/02f618fe2bdf4d84a606a13e0148f275#02f618fe2bdf4d84a606a13e0148f275</link>
		<pubDate>Sun, 06 Jan 2013 19:57:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/02f618fe2bdf4d84a606a13e0148f275#02f618fe2bdf4d84a606a13e0148f275</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>Again, all you are arguing for is an extremely limited form of code contracts. Adding a bunch of complexity to a language to implement a safety feature poorly is not really a good idea.</p><p>All your apparent vulnerabilities effect static languages as well, and don't really see an argument on how like duck typing magically makes something more robust. In fact, I would argue the opposite by having less code to worry about, you can write more robust code. And duck typing helps you write less code. There is some interesting literature on the academic side of things showing problems along these lines in static languages.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b0bfe98383634c3ea44ba13e014ac582#b0bfe98383634c3ea44ba13e014ac582</link>
		<pubDate>Sun, 06 Jan 2013 20:04:18 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b0bfe98383634c3ea44ba13e014ac582#b0bfe98383634c3ea44ba13e014ac582</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/b0bfe98383634c3ea44ba13e014ac582">1 minute&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>Again, all you are arguing for is a extremely limited form of code contracts. Adding a bunch of complexity to a language to do something other languages do, poorly is not really a good idea.</p><p></p></div></blockquote><p></p><p>On the contrary. I think making types more powerful makes code better. That's why when I write code in C/C&#43;&#43; I use __in, __inout, const, __notnull and all sorts of other annotations to make my code better. I run static analysis tools to find unit-cases where a null-dereference or buffer overflow might occur that it finds algebraically rather than requiring me to think of it in advance in the unit tests.</p><p>That's why I really love Spec#. It's a way of building your unit tests inline with your code - and not only do your unit tests get auto-tested on each build, but the tests are algebraic (and therefore complete) rather than ad-hoc, and your compiler gets the opportunity to omit checks that it doesn't need because they are contractually verified.</p><p></p><blockquote><div class="quoteText"><p></p><p>All your apparent vulnerabilities effect static languages as well</p><p></p></div></blockquote><p></p><p>They only affect it where data becomes typeless. SQL injection is because you're mixing SQL code and attacker controlled data. A static typed approach would be to say that SQL code simply doesn't compose with the attacker controlled string, and hence no SQL injection is ever possible.</p><p>Similarly if HTML was strongly typed and you didn't write a HTML string out to the browser but wrote an AST out then XSS wouldn't exist. Silverlight might be dead, but it never had XSSes for the simple reason that nobody in their right mind would try to dynamically build a Silverlight app on the fly and glue attacker controlled strings directly into the code.</p><p>If your data never went into the filesystem as a typeless blob next to your code, but rather went fully typed into your database, then arbitrary uploads wouldn't exist either.</p><p>My point is that you get <em>better&nbsp;</em>security by having&nbsp;<em>stronger&nbsp;</em>types. Dynamic languages decouple unit and security non-composability requirements tests from your code, and too many developers don't have them, but have them&nbsp;separate&nbsp; They just don't have them, leading to worse and less secure code.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/2fc1aacba9834fe09962a13e014cce08#2fc1aacba9834fe09962a13e014cce08</link>
		<pubDate>Sun, 06 Jan 2013 20:11:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/2fc1aacba9834fe09962a13e014cce08#2fc1aacba9834fe09962a13e014cce08</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>I really don't buy it at all. First of all dynamic languages can be (and often are) strongly typed, I would argue Ruby is much more strongly typed then C with all it's type punning shenanigans.</p><p>If you want to see robust dynamic languages can do, again I would look at Erlang. Far more robust than anything you can throw at me about static typing. Duck typing just makes more sense for OOP.</p><p>All this complexity exists in static languages to implement what duck typing can do, and they do it in a manner that is incredibly less powerful and come up with ugly hacks like templates or if-type-then-cast to overcome the mess.</p><p>Unfortunately C&#43;&#43; somehow won over Smalltalk and Java and by extension C# duplicated the poor designs in their languages and because of it, I had to waste hundreds and hundreds of hours of my life in taxonomist meetings where the same two opinionated people duke out their perfect idea for an object model for every stupid feature where I could have been programming.</p><p>Dynamic language community wasn't helping either by implicitly saying that their languages aren't systems programming languages and acting totally apathetic to performance, but the JS wars helped a bit to show that dynamic languages can be pretty damn fast. So I'm hopeful.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/d363804870d94a07bd5ba13e014f2752#d363804870d94a07bd5ba13e014f2752</link>
		<pubDate>Sun, 06 Jan 2013 20:20:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/d363804870d94a07bd5ba13e014f2752#d363804870d94a07bd5ba13e014f2752</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>It's worth noting that PHP to C&#43;&#43; compiler also exists. It so happens that duck typing and values-not-variables-are-typed (this can be trivially shown**) map pretty cleanly to static languages. (Not surprising because of template concept).</p><p>The part that doesn't map well is metaprogramming (eg: PHP's eval()), but that's to be expected. But that's a small part of it all, and guess what I've yet to meet a static language that doesn't have some kind of metaprogramming (or hacky way to accomplish something similar) because metaprogramming is often useful.</p><p>** <br>Dynamic: a = 5; print(a); a = &quot;foo&quot;; print(a);<br>Converted to Static: a = 5; print(a); del(a) /* optional */; a' = &quot;foo&quot;; print(a');</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/873b073fa1734d95b321a13e0153acee#873b073fa1734d95b321a13e0153acee</link>
		<pubDate>Sun, 06 Jan 2013 20:36:43 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/873b073fa1734d95b321a13e0153acee#873b073fa1734d95b321a13e0153acee</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/d363804870d94a07bd5ba13e014f2752">10 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>I really don't buy it at all. First of all dynamic languages can be (and ofter are) strongly typed, I would argue Ruby is much more strongly typed then C with all it's type punning shenanigans.</p><p></p></div></blockquote><p></p><p>C is not a strongly typed language. Nobody claimed it was. Even C&#43;&#43; is only barely strongly typed.</p><p></p><blockquote><div class="quoteText"><p></p><p>If you want to see robust dynamic languages can do, again I would look at Erlang. Far more robust than anything you can throw at me about static typing. Duck typing just makes more sense for OOP.</p><p></p></div></blockquote><p></p><p>If we're fighting over what weird crazy languages can do, I'll see your Erlang and raise you Haskell and Spec#.</p><p></p><blockquote><div class="quoteText"><p></p><p>All this complexity exists in static languages to implement what duck typing can do, and they do it in a manner that is incredibly less powerful and come up with ugly hacks like templates or if-type-then-cast to overcome the mess.</p><p></p></div></blockquote><p></p><p>Implicit ducktyping is possible in strongly typed languages. It is no more a unique feature of dynamic languages than garbage collection is.</p><p></p><blockquote><div class="quoteText"><p></p><p>I had to waste hundreds and hundreds of hours of my life in taxonomist meetings where the same two opinionated people duke out their perfect idea for an object model for every stupid feature where I could have been programming.</p><p></p></div></blockquote><p></p><p>You seem to be under the (false) impression that boring and ineffective design meetings are either the sole preserve of, more commonly occur in, or are a feature of companies that use statically typed languages. This is not true.</p><p>I've watched hopeless PHP design teams spend days in rooms discussing how to write code before bothering to try stuff out. On the other hand I've watched C# teams in other companies communicate via Linq to request an interface (e.g. ILogin) which the front-end person codes to and the backend programmer codes&nbsp;simultaneously.</p><p>The fact that you know two bad C&#43;&#43; programmers doesn't make C&#43;&#43; a bad language (there are much better reasons why C&#43;&#43; is a bad language). And the fact that you're a good Ruby programmer doesn't mean you wouldn't write better, faster, more secure code in a different language.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/19da9f401acb40a6a7a6a13e0154f2b3#19da9f401acb40a6a7a6a13e0154f2b3</link>
		<pubDate>Sun, 06 Jan 2013 20:41:21 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/19da9f401acb40a6a7a6a13e0154f2b3#19da9f401acb40a6a7a6a13e0154f2b3</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/873b073fa1734d95b321a13e0153acee">4 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>It's worth noting that PHP to C&#43;&#43; compiler also exists.</p><p></p></div></blockquote><p></p><p>It is possible to write an x86 emulator in Haskell. Does this mean Haskell programs are generally as fast as C ones (since it can run anything C can run)? No, of course not.</p><p>And you can write a Haskell emulator in C. Does this mean that C is beautiful, strongly typed, garbage collected and functional, since C can do everything Haskell can do? Again, an absurd statement.</p><p>The fact that it is possible to convert one language to another doesn't mean the former gets any of the benefits of the latter.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b464676c754e491eb779a13e0156ce84#b464676c754e491eb779a13e0156ce84</link>
		<pubDate>Sun, 06 Jan 2013 20:48:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b464676c754e491eb779a13e0156ce84#b464676c754e491eb779a13e0156ce84</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>PHP is weakly typed. Weakly typed is when a language does bad(tm) things instead of failing (either at compile or runtime) when it encountered a type mismatch. I'm pretty sure any scary example from PHP you can come up with takes advantage of this.</p><p>Ruby and Python are fairly strongly typed, but dynamic. Again you can have &quot;static&quot; and weakly typed, like what pointers are in C. The type of a pointer is merely a suggestion. Heh. Also, rich type systems, like were a string is not just a f'ing pointer is helpful. These are were the REAL problems occur in robustness. Not in duck typing, and certainly not as values-as-types. Duck typing has almost no real disadvantage that I can see, and values-as-types can be considered syntactical sugar at best.</p><p>I don't disagree that weakly typed is a bad idea, I think you might be arguing against weakly typed stuff, which commonly is confused for dynamically typed stuff, because many dynamic languages happen to be somewhat weakly typed (PHP and JavaScript are no exception). So lets just agree that strongly typed languages are preferable.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/5d6a683086bb47589662a13e0156dc71#5d6a683086bb47589662a13e0156dc71</link>
		<pubDate>Sun, 06 Jan 2013 20:48:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/5d6a683086bb47589662a13e0156dc71#5d6a683086bb47589662a13e0156dc71</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p>guess what I've yet to meet a static language that doesn't have some kind of metaprogramming (or hacky way to accomplish something similar) because metaprogramming is often useful.</p><p></p></div></blockquote><p></p><p>C/C&#43;&#43; doesn't have meta programming.</p><p>Also I've never needed it (other than for reverse engineering other people's binaries), so I dispute that everything meta-programming can do can't be done better by other programming constructs.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b9d0fd1d9b234e899ce6a13e01577453#b9d0fd1d9b234e899ce6a13e01577453</link>
		<pubDate>Sun, 06 Jan 2013 20:50:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b9d0fd1d9b234e899ce6a13e01577453#b9d0fd1d9b234e899ce6a13e01577453</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>It has loadlibrary, which lets you add code at runtime. This is how it gets around not having metaprogramming.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b3e121c7a5b6483a807aa13e0157be11#b3e121c7a5b6483a807aa13e0157be11</link>
		<pubDate>Sun, 06 Jan 2013 20:51:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b3e121c7a5b6483a807aa13e0157be11#b3e121c7a5b6483a807aa13e0157be11</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/b3e121c7a5b6483a807aa13e0157be11">8 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>It has loadlibrary, which lets you add code at runtime.&nbsp;</p><p></p></div></blockquote><p></p><p>loadlibrary isn't part of the C or C&#43;&#43; languages.</p><p>Also, whilst people might use LoadLibrary to bring in extra but static code into their address-space, people never (or at least, I have never seen them) build libraries dynamically and then load them.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/977eb5105c4747fdb6cba13e015a30cd#977eb5105c4747fdb6cba13e015a30cd</link>
		<pubDate>Sun, 06 Jan 2013 21:00:26 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/977eb5105c4747fdb6cba13e015a30cd#977eb5105c4747fdb6cba13e015a30cd</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>it's also worth noting that you can implement the pretty useless restrictions interfaces provide for you with duck typing</p><p>foo( a ) { a.doYouImplementIAddable() }</p><p>class Foo {</p><p>doYouImplementIAddable() { true }</p><p>}</p><p>a = new Foo()</p><p>foo(a) // true</p><p>a = 5</p><p>foo(a) // Fail, could even fail at compile time</p><p>So really duck typing is a superset of everything static languages offer. If you want a complicated taxonomy go right ahead with dynamic typing. But they also let you do so much more.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/55b0bf8287fd4ba8b503a13e015a4b60#55b0bf8287fd4ba8b503a13e015a4b60</link>
		<pubDate>Sun, 06 Jan 2013 21:00:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/55b0bf8287fd4ba8b503a13e015a4b60#55b0bf8287fd4ba8b503a13e015a4b60</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c977eb5105c4747fdb6cba13e015a30cd">evildictaitor</a>:</p><p>Neither is almost anything, but realistically it's available on every mainstream and even obscure OS (might not be named the same thing). If you don't have it, a lot of things (plugins, etc.) become a lot harder to do.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/e764d2dd57dd41edba7ba13e015ab652#e764d2dd57dd41edba7ba13e015ab652</link>
		<pubDate>Sun, 06 Jan 2013 21:02:20 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/e764d2dd57dd41edba7ba13e015ab652#e764d2dd57dd41edba7ba13e015ab652</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/e764d2dd57dd41edba7ba13e015ab652">3 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c977eb5105c4747fdb6cba13e015a30cd">evildictaitor</a>:</p><p>Neither is almost anything, but realistically it's available on every mainstream and even obscure OS (might not be named the same thing). If you don't have it, a lot of things (plugins, etc.) become a lot harder to do.</p><p></p></div></blockquote><p></p><p>It only becomes hard to add native-code plugins to your closed source project. If you're open-source you just build it into the source code and recompile it (or add it via the command line to your compiler and it will become #if-included in).</p><p>Also, most programs don't have a need for plugins and those that do, the plugin interface is a very small part of the design and certainly doesn't factor into the language you use to write the code, or whether unit tests are a central feature of the language, or something you can choose to ignore to your later regret.</p><p>And if that wasn't enough, LoadLibrary isn't an eval, and isn't really&nbsp;equivalent&nbsp;to adding dynamic code to the codebase. It's dynamically adding more static code, which is quite different. Nobody in their right mind generates the library that they want out of a string of data to generate a library that they then LoadLibrary in.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/22219a2d03cf48ffbf3ea13e015d51d8#22219a2d03cf48ffbf3ea13e015d51d8</link>
		<pubDate>Sun, 06 Jan 2013 21:11:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/22219a2d03cf48ffbf3ea13e015d51d8#22219a2d03cf48ffbf3ea13e015d51d8</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>Also the thing about obscure languages, it shows how you can do dynamic languages right. Erlang's primary weakness is that it decided to copy the syntax of Prolog. That makes it very unapproachable for beginners.</p><p>You have language like Ruby which isn't that obscure at all and have beautiful syntax. I mean, it's all over the place these days, especially for new development. It has a much better syntax than Erlang and it's also very strongly typed. Ditto for Python. Very well designed languages, with unfortunately, very slow runtimes. That makes them useless for some things, which is incredibly unfortunate.</p><p>Then you have JS which is less pretty, but people have made it pretty via CoffeeScript. But JS is very fast, much faster than any dynamic language ever was because some people had the smart idea of trying to speed up a dynamic language for what seems to be the first real attempt.</p><p>At some point you will have the niceness of Ruby and Python, the robustness of Erlang, and the speed of JavaScript merge. That will be the language of the future.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/2f560ef4c2f846e58bd0a13e015ed49c#2f560ef4c2f846e58bd0a13e015ed49c</link>
		<pubDate>Sun, 06 Jan 2013 21:17:20 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/2f560ef4c2f846e58bd0a13e015ed49c#2f560ef4c2f846e58bd0a13e015ed49c</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c22219a2d03cf48ffbf3ea13e015d51d8">evildictaitor</a>:</p><p>I see no major difference between loading a library and eval, other than working with different languages. You are in fact, adding code to your process both ways, it just happens to that one is machine code. It's still code.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/8dfe941cfd8c4cdebcfea13e0160d71e#8dfe941cfd8c4cdebcfea13e0160d71e</link>
		<pubDate>Sun, 06 Jan 2013 21:24:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/8dfe941cfd8c4cdebcfea13e0160d71e#8dfe941cfd8c4cdebcfea13e0160d71e</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/2f560ef4c2f846e58bd0a13e015ed49c">39 seconds&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>Also the thing about obscure languages, it shows how you can do dynamic languages right. Erlang's primary weakness is that it decided to copy the syntax of Prolog. That makes it very unapproachable for beginners.</p><p>You have language like Ruby which isn't that obscure at all and have syntax that read almost like poetry. I mean, it's all over the place these days, especially for new development. It has a much better syntax than Erlang and it's also very strongly typed. Ditto for Python. Very well designed languages, with unfortunately, very slow runtimes. That makes them useless for some things, which is incredibly unfortunate.</p><p>Then you have JS which is less pretty, but people have made it pretty via CoffeeScript. But JS is very fast, much faster than any dynamic language ever was.</p><p>At some point you will have the niceness of Ruby and Python, the robustness of Erlang, and the speed of JavaScript merge. That will be the language of the future.</p><p></p></div></blockquote><p></p><p>You say that, but then you accuse statically typed languages of being equivilent to the dreadful languages of C&#43;&#43; and Java, missing out the elegance and simplicity of Haskell.</p><p>I'm not arguing against dynamic languages because I think that PHP is dreadful (it really, really is, by the way) or because I think that C&#43;&#43; and Java are the language that God himself would use (he really, really wouldn't). I'm arguing it because I feel that building unit-tests into the language via formalized contracts is the only way to get people to write them at all, and unit tests are the difference between good and bad code.</p><p>Forcing crappy developers to write unit tests, and getting the compiler to immediately abort and tell them when they do stuff wrong is&nbsp;<em>critical&nbsp;</em>to maintaining a healthy codebase. And making it easy for developers to see where semantics have changed slightly when refactoring their code to make refactoring easy rather than painful is&nbsp;<em>cruicial&nbsp;</em>to building systems that are effective.</p><p>Static types are a way of saying that writing unit tests is part of writing code. Too many people think that unit tests are optional or are something that we need a full time &quot;tester&quot; to write. Contracts and types let you find typos&nbsp;<em>immediately</em>, make code&nbsp;<em>more immediately obvious when reading&nbsp;</em>and&nbsp;<em>easier to algebraically prove correctness for</em>.</p><p><em>That's&nbsp;</em>why I like static languages, and that's why I feel that going from C# to Spec# is a&nbsp;positive&nbsp;thing, and going to PHP from C#/ASP.NET is a backwards thing.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/827acdfe18214eb18619a13e0160e486#827acdfe18214eb18619a13e0160e486</link>
		<pubDate>Sun, 06 Jan 2013 21:24:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/827acdfe18214eb18619a13e0160e486#827acdfe18214eb18619a13e0160e486</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/8dfe941cfd8c4cdebcfea13e0160d71e">13 seconds&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c22219a2d03cf48ffbf3ea13e015d51d8">evildictaitor</a>:</p><p>I see no major difference between loading a library and eval, other than working with different languages. You are in fact, adding code to your process both ways, it just happens to that one is machine code. It's still code.</p><p></p></div></blockquote><p></p><p>It is not code that is highly coupled to runtime data. That's the difference.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/601eee38004f4e759fbfa13e016118be#601eee38004f4e759fbfa13e016118be</link>
		<pubDate>Sun, 06 Jan 2013 21:25:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/601eee38004f4e759fbfa13e016118be#601eee38004f4e759fbfa13e016118be</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c601eee38004f4e759fbfa13e016118be">evildictaitor</a>:</p><p>I can go ahead and put the PHP runtime in there and execute PHP and eval PHP code right in. Ha ha. How's about that for inception.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/207679fa18e24a019313a13e0161fa4a#207679fa18e24a019313a13e0161fa4a</link>
		<pubDate>Sun, 06 Jan 2013 21:28:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/207679fa18e24a019313a13e0161fa4a#207679fa18e24a019313a13e0161fa4a</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c827acdfe18214eb18619a13e0160e486">evildictaitor</a>:</p><p>In a strongly typed dynamic language. Again I don't see how changing a type1 to a type2 is going to cause anything other than a type mismatch exception or even a compile-time error unless type1 and type2 are both ducks. The whole &quot;unit test&quot; argument is totally bogus. Static types are not helping you at all! Strong types are. You aren't get type safety from static languages. You are just getting more complicated code.</p><p>Duck typing is basically doing the work of adding interfaces to your code so you don't have to think about it. That's all. You can implement it in static languages with a *-ton of interfaces, something like n! interfaces where n is the number of methods/properties. That would be ugly (esp for big classes), but it's doable. Some &quot;pretty OO&quot; designs seem to approach that, with their interface soup. See Android SDK. In what planet is that preferable to duck typing?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/9d11eca1ec5c451a9e66a13e0163ed30#9d11eca1ec5c451a9e66a13e0163ed30</link>
		<pubDate>Sun, 06 Jan 2013 21:35:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/9d11eca1ec5c451a9e66a13e0163ed30#9d11eca1ec5c451a9e66a13e0163ed30</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/207679fa18e24a019313a13e0161fa4a">13 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c601eee38004f4e759fbfa13e016118be">evildictaitor</a>:</p><p>I can go ahead and put the PHP runtime in there and execute PHP and eval PHP code right in. Ha ha. How's about that for inception.</p><p></p></div></blockquote><p></p><p>I can get your PHP runtime to run an x86 emulator to bootstrap my static language. Ha ha. How's that for making PHP usable and safe?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/5954eb4b103c4a6e8d10a13e01663e68#5954eb4b103c4a6e8d10a13e01663e68</link>
		<pubDate>Sun, 06 Jan 2013 21:44:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/5954eb4b103c4a6e8d10a13e01663e68#5954eb4b103c4a6e8d10a13e01663e68</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>So it's like the same thing. Duh. That's what I've been saying.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/0673cf5198c94ae8b39ca13e016673d4#0673cf5198c94ae8b39ca13e016673d4</link>
		<pubDate>Sun, 06 Jan 2013 21:45:05 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/0673cf5198c94ae8b39ca13e016673d4#0673cf5198c94ae8b39ca13e016673d4</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/9d11eca1ec5c451a9e66a13e0163ed30">8 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c827acdfe18214eb18619a13e0160e486">evildictaitor</a>:</p><p>In a strongly typed dynamic language. Again I don't see how changing a type1 to a type2 is going to cause anything other than a type mismatch exception or even a compile-time error unless type1 and type2 are both ducks.</p><p></p></div></blockquote><p></p><p>Because all primitive types duck-type to each other by default. An int is a double is a string is an array is an object.</p><p></p><blockquote><div class="quoteText"><p></p><p>Duck typing is basically doing the work of adding interfaces to your code so you don't have to think about it. That's all. You can implement it in static languages with a *-ton of interfaces,</p><p></p></div></blockquote><p></p><p>Duck-typing can be done automatically by an IDE and can be built into a language. Duck-typing is not a feature of or the sole preserve of dynamic languages. Stop quoting it as such.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/d7efdcab2963476f8a6ea13e01692b72#d7efdcab2963476f8a6ea13e01692b72</link>
		<pubDate>Sun, 06 Jan 2013 21:54:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/d7efdcab2963476f8a6ea13e01692b72#d7efdcab2963476f8a6ea13e01692b72</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/0673cf5198c94ae8b39ca13e016673d4">10 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>So it's like the same thing. Duh. That's what I've been saying.</p><p></p></div></blockquote><p></p><p>I said it several pages ago (<a href="http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/b464676c754e491eb779a13e0156ce84). The">http&#58;&#47;&#47;channel9.msdn.com&#47;Forums&#47;Coffeehouse&#47;is-managed-code-faster-than-native&#47;b464676c754e491eb779a13e0156ce84&#41;.&#160;The</a> fact that both are turning complete doesn't mean that they are&nbsp;equally&nbsp;good languages. It just means they are equally powerful languages.</p><p>Do keep up.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/6e6969b75805491aa6e4a13e01698852#6e6969b75805491aa6e4a13e01698852</link>
		<pubDate>Sun, 06 Jan 2013 21:56:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/6e6969b75805491aa6e4a13e01698852#6e6969b75805491aa6e4a13e01698852</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/d7efdcab2963476f8a6ea13e01692b72">3 minutes&nbsp;ago</a>,&nbsp;<a href="/Niners/evildictaitor">evildictait​or</a>&nbsp;wrote</p><p>*snip*</p><p>Because all primitive types duck-type to each other by default. An int is a double is a string is an array is an object.</p><p></p></div></blockquote><p></p><p>Nope. If you are only using weakly typed languages you will have a very distorted view.</p><p></p><blockquote><div class="quoteText"><p></p><p>irb(main):001:0&gt; x = 5</p><p>=&gt; 5</p><p>irb(main):002:0&gt; x.length</p><p>NoMethodError: undefined method `length' for 5:Fixnum from (irb):2 from /usr/bin/irb:12:in `'</p><p>irb(main):003:0&gt; x = &quot;Foo&quot;</p><p>=&gt; &quot;Foo&quot;</p><p>irb(main):004:0&gt; x.length</p><p>=&gt; 3</p><p></p></div></blockquote><p></p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/6de023873b744518bf3aa13e016a0af2#6de023873b744518bf3aa13e016a0af2</link>
		<pubDate>Sun, 06 Jan 2013 21:58:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/6de023873b744518bf3aa13e016a0af2#6de023873b744518bf3aa13e016a0af2</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>It's kind of Ruby to helpfully report the typo of 5 instead of &quot;5&quot; only when you manage to generate a test case that exactly goes through that chain, rather than just telling you that you did a typo up front. Your customer also gets to appreciate the benefits of dynamic languages when he can't get his work done because of your &quot;500 server error&quot; caused by the error being detected only when he tries it.</p><p>In C# my compiler didn't let me deploy your broken code. Therefore there was never a NoMethodError thrown when my customer visited my webpage.</p><p>Result: I sleep easier and my customers are more happy.</p><p>Yay for statically typed languages.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c094201e8cf947bc805da13e016d88a0#c094201e8cf947bc805da13e016d88a0</link>
		<pubDate>Sun, 06 Jan 2013 22:10:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/c094201e8cf947bc805da13e016d88a0#c094201e8cf947bc805da13e016d88a0</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/is-managed-code-faster-than-native/c094201e8cf947bc805da13e016d88a0">9 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictait​or</a> wrote</p><p>It's kind of Ruby to helpfully report the typo of 5 instead of &quot;5&quot; only when you manage to generate a test case that exactly goes through that chain, rather than just telling you that you did a typo up front. Your customer also gets to appreciate the benefits of dynamic languages when he can't get his work done because of your &quot;500 server error&quot; caused by the error being detected only when he tries it.</p><p>In C# my compiler didn't let me deploy your broken code. Therefore there was never a NoMethodError thrown when my customer visited my webpage.</p><p>Result: I sleep easier and my customers are more happy.</p><p>Yay for statically typed languages.</p><p></p></div></blockquote><p></p><p>My point is that your statement was wrong. Not 20% wrong, not 90% wrong. 100% wrong. So maybe try to be a little more accurate in your criticisms next time.</p><p>Yeah sure, the magic of C#'s compiler catches bugs before you deploy. So you're saying with C#, I'd never have need a static verification tool like Ruby/JSLint, because the compiler is just that awesome. Okay.</p><div class="mainContent text"><h1>System Error</h1><div class="alert"><h2>Wow, that shouldn't have happened</h2><p>We're sorry. Something has gone terribly wrong.</p><p>If you would like to let us know about this, please <a href="http://channel9.msdn.com/ContactUs">Contact Us</a> and let us know what happened.</p><p>Reference:</p></div></div><p>Well you should tell Channel9 team that because I keep getting this like 20 times in this thread so far via their superior C# codebase. To be fair this is the only website I regularly visit written in C# (they are hard to come by, with bigger ones like MySpace failing and all despite using happy customer C# code), so the sample size is small. But it doesn't sell the compiler anti-bug technology to me very well.</p><p>Ruby OR C#, hopefully you have integration/unit tests that do more than load your page or something. Hopefully you are using a static verification tool (!= compiler), code coverage tool and a tool to run your unit tests BEFORE you deploy (realistically, BEFORE you check in). None of this is <span><strong>ever</strong></span> optional in the real world(tm)!</p><p>But really, if you want code contracts, use code contracts (in Ruby even!). Don't try to pass type decorations like they are code contracts.</p><p>Anyway the point of this conversation for me was to try and see if I can learn anything new or interesting about static languages. Something to objectively show that static languages are superior. That WOULD be interesting. But it's not really working. All I am getting in a genuine confusion about the difference between weakly typed and dynamic typed. So uh, good luck.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3740605b03e24a438de9a13e0173b65c#3740605b03e24a438de9a13e0173b65c</link>
		<pubDate>Sun, 06 Jan 2013 22:33:21 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/3740605b03e24a438de9a13e0173b65c#3740605b03e24a438de9a13e0173b65c</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/is-managed-code-faster-than-native#c3740605b03e24a438de9a13e0173b65c">Bass</a>:Can you point to a dynamically typed native language out there? Note, dynamically typed, not dynamic.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/dea764d91f2f4a7fbf7ea13f00bbdd4d#dea764d91f2f4a7fbf7ea13f00bbdd4d</link>
		<pubDate>Mon, 07 Jan 2013 11:23:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/dea764d91f2f4a7fbf7ea13f00bbdd4d#dea764d91f2f4a7fbf7ea13f00bbdd4d</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - is managed code faster than native?</title>
		<description><![CDATA[<p>The bit that annoys me about this type of discussion is that most dynamic languages give you less flexibility and choice than statically typed languages to do what you want.</p><p>In C#, for instance, if you want values rather than variable-sites to have types, use the &quot;object&quot; keyword, or just use an interface:</p><p>object Add(object a, object b)<br>{<br>&nbsp; return a.GetType().Invoke(&quot;op_add&quot;, a, b);<br>}</p><p>If you do that Add(1, 2) and Add(&quot;cat&quot;, &quot;dog&quot;) will now work without complaining at you. If you write Add(new object(), &quot;string&quot;) you'll end up with a runtime error, not a compile time one.</p><p>So the thing is that you&nbsp;<em>can&nbsp;</em>program dynamically in most static languages. What you&nbsp;<em>can't&nbsp;</em>do is program statically in dynamic languages. Yes, you can add code to test for types like this in PHP:</p><p>function add($var1, $var2) { assert(isint($var1)); assert(isint($var2)); }</p><p>but if you do that you still don't get a <em>compile time</em>&nbsp;or immediate IDE feedback when you write add(&quot;2&quot;, &quot;3&quot;) - meaning that it makes the time between when you make a silly mistake and when you have an opportunity to fix it longer. It also ups the barrier to refactoring your code, since when you change internal stuff it's now much harder to quickly see where the error was caused because errors can now happen further from your typo.</p><p>The static versus dynamic debate is a debate about choice, and a debate about whether some forms of basic error checking (which is itself a rudimentary form of unit testing) is a first-class citizen in the language. In Spec# they take this further and build proper unit tests with algebraic solvers into the language - to the improvement rather than to the detriment of programmer productivity, because in Spec# the cost of writing unit tests shrinks yet further to just those tests that are too complex to write as requires/ensures contracts.</p><p>Dynamically typed languages pull the other way. They say that variable sites shouldn't be able to &quot;ensure&quot; or &quot;require&quot; features of the thing that sits inside them. This means that a greater burden is put on the compiler to infer the type and ensure type-safety internally (assuming the langauge is even compiled - most are interpreted, taking a double hit on speed).</p><p>Increasingly C# is giving you the most flexibility of all of the languages to program how you like. Use imperative programming if you want, or functional programming if you prefer. Use compiler-based assertions to pick up common typos and logic errors, and have a dynamic keyword for when it's useful.</p><p>Indeed, with Spec#, you can bring more of your testing into your code - making it possible for your compilation to &quot;know&quot; that you've tested for and proved that certain code paths can't take place - and since in real life hardly anyone unit tests their code, this is a way of bringing testing to normal developers, and stopping testing from being &quot;the thing you do get someone else to do just before you launch the product&quot;..</p><p>The future of languages is having static types where possible and dynamic types for the few times when it's actually needed.</p><p><a href="http://research.microsoft.com/en-us/um/people/emeijer/Papers/RDL04Meijer.pdf">http&#58;&#47;&#47;research.microsoft.com&#47;en-us&#47;um&#47;people&#47;emeijer&#47;Papers&#47;RDL04Meijer.pdf</a></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/fa921fbf83924854b811a13f00c91513#fa921fbf83924854b811a13f00c91513</link>
		<pubDate>Mon, 07 Jan 2013 12:12:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/is-managed-code-faster-than-native/fa921fbf83924854b811a13f00c91513#fa921fbf83924854b811a13f00c91513</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>69</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>