<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: IronScheme does CPS!</title>
	<atom:link href="http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/feed/" rel="self" type="application/rss+xml" />
	<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/</link>
	<description>A small, super fast, opensource and 100% C# IDE targetting .NET-based languages</description>
	<lastBuildDate>Tue, 08 Dec 2009 04:06:34 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: leppie</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-3299</link>
		<dc:creator>leppie</dc:creator>
		<pubDate>Fri, 06 Feb 2009 15:44:11 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-3299</guid>
		<description>Hi Jon

I kinda realised that, but after investigation, it appears the problem is with virtual calls only. I have changed my emitted code to call delegates non-virtual (as it&#039;s not really needed according to the spec), but have not tested tail recursion on Mono recently.

How does F# cope on Mono? I see they use tail calls in all tail positions.

Cheers

leppie</description>
		<content:encoded><![CDATA[<p>Hi Jon</p>
<p>I kinda realised that, but after investigation, it appears the problem is with virtual calls only. I have changed my emitted code to call delegates non-virtual (as it&#8217;s not really needed according to the spec), but have not tested tail recursion on Mono recently.</p>
<p>How does F# cope on Mono? I see they use tail calls in all tail positions.</p>
<p>Cheers</p>
<p>leppie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Harrop</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-3296</link>
		<dc:creator>Jon Harrop</dc:creator>
		<pubDate>Fri, 06 Feb 2009 10:17:33 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-3296</guid>
		<description>Note that Mono&#039;s implementation of tail calls is broken: they only eliminate direct self and mutual tail recursion and not general tail calls, i.e. to dynamic locations. Consequently, many conventional FP idioms (e.g. combinators) will leak stack space until the stack overflows on Mono.</description>
		<content:encoded><![CDATA[<p>Note that Mono&#8217;s implementation of tail calls is broken: they only eliminate direct self and mutual tail recursion and not general tail calls, i.e. to dynamic locations. Consequently, many conventional FP idioms (e.g. combinators) will leak stack space until the stack overflows on Mono.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leppie</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2743</link>
		<dc:creator>leppie</dc:creator>
		<pubDate>Mon, 10 Nov 2008 20:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2743</guid>
		<description>Antonio :

I was just browsing the F# generated assemblies, and they use tail calls where possible it seems.  I wonder how they deal with the performance impact. Perhaps .NET 4 will offer better performance in that aspect :)</description>
		<content:encoded><![CDATA[<p>Antonio :</p>
<p>I was just browsing the F# generated assemblies, and they use tail calls where possible it seems.  I wonder how they deal with the performance impact. Perhaps .NET 4 will offer better performance in that aspect <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leppie</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2719</link>
		<dc:creator>leppie</dc:creator>
		<pubDate>Thu, 06 Nov 2008 17:47:06 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2719</guid>
		<description>OTOH, that gives us an interesting problem to solve :)</description>
		<content:encoded><![CDATA[<p>OTOH, that gives us an interesting problem to solve <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leppie</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2718</link>
		<dc:creator>leppie</dc:creator>
		<pubDate>Thu, 06 Nov 2008 17:44:53 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2718</guid>
		<description>I applied the NoInlining option to the recursive calls, and it seems tail calls are never inlined (same time), probably intentional, but that still makes the tail call 6 times slower :(</description>
		<content:encoded><![CDATA[<p>I applied the NoInlining option to the recursive calls, and it seems tail calls are never inlined (same time), probably intentional, but that still makes the tail call 6 times slower <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio Cuni</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2716</link>
		<dc:creator>Antonio Cuni</dc:creator>
		<pubDate>Thu, 06 Nov 2008 13:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2716</guid>
		<description>@leppie
:-(
Ok, it seems that tail calls are indeed not an option for me at the moment. For scheme it&#039;s even worse, because you *need* to use tail calls anyway, I suppose.

FWIW, mono behaves much better with tail calls: on my machine tail calls are about 30% faster than normal calls, so you maybe want to run your benchmarks also there.</description>
		<content:encoded><![CDATA[<p>@leppie<br />
 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /><br />
Ok, it seems that tail calls are indeed not an option for me at the moment. For scheme it&#8217;s even worse, because you *need* to use tail calls anyway, I suppose.</p>
<p>FWIW, mono behaves much better with tail calls: on my machine tail calls are about 30% faster than normal calls, so you maybe want to run your benchmarks also there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leppie</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2715</link>
		<dc:creator>leppie</dc:creator>
		<pubDate>Thu, 06 Nov 2008 12:20:44 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2715</guid>
		<description>@Antonio: Thanks for the information, my results are the same as yours. I did not realize the tail calls on .NET behave this badly  :(

In my tests with the code, tail calls were roughly 10 times slower. Tried a few variations, it seems using an object type for a return value gets the best performance, but still very slow!

It also probably explains the 6 times slow down I get with the CPS version of IronScheme as every call should be a tail call.</description>
		<content:encoded><![CDATA[<p>@Antonio: Thanks for the information, my results are the same as yours. I did not realize the tail calls on .NET behave this badly  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>In my tests with the code, tail calls were roughly 10 times slower. Tried a few variations, it seems using an object type for a return value gets the best performance, but still very slow!</p>
<p>It also probably explains the 6 times slow down I get with the CPS version of IronScheme as every call should be a tail call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leppie</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2714</link>
		<dc:creator>leppie</dc:creator>
		<pubDate>Thu, 06 Nov 2008 11:58:53 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2714</guid>
		<description>@Antonio:
I have not tested it yet, but from the looks of it, I do something different. Due to the dynamic requirements of Scheme, types should be checked inside the procedure, hence I always use object types for parameters and return values, in the signature.

I will fiddle a bit with your code to see if some implicit boxing is occurring on the return value.</description>
		<content:encoded><![CDATA[<p>@Antonio:<br />
I have not tested it yet, but from the looks of it, I do something different. Due to the dynamic requirements of Scheme, types should be checked inside the procedure, hence I always use object types for parameters and return values, in the signature.</p>
<p>I will fiddle a bit with your code to see if some implicit boxing is occurring on the return value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio Cuni</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2713</link>
		<dc:creator>Antonio Cuni</dc:creator>
		<pubDate>Thu, 06 Nov 2008 11:37:55 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2713</guid>
		<description>@leppie
uhm, I&#039;m surprised that tail calls work so well for you, I wonder if I did something wrong.
I wrote a little benchmark that sums all the integers up to N using a loop, a normal recursive call and a tail call; the original C# source is here:
http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.cs

then I patched the IL to add the tail. prefix to the call:
http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.il

Here is the final .exe:
http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.exe

With CLR 2.0.50727 the tail call is about 6.5 times *slower* than the normal call, which is by itself 2 times slower than the for loop.
Could you try to run the benchmark, please?</description>
		<content:encoded><![CDATA[<p>@leppie<br />
uhm, I&#8217;m surprised that tail calls work so well for you, I wonder if I did something wrong.<br />
I wrote a little benchmark that sums all the integers up to N using a loop, a normal recursive call and a tail call; the original C# source is here:<br />
<a href="http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.cs" rel="nofollow">http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.cs</a></p>
<p>then I patched the IL to add the tail. prefix to the call:<br />
<a href="http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.il" rel="nofollow">http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.il</a></p>
<p>Here is the final .exe:<br />
<a href="http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.exe" rel="nofollow">http://codespeak.net/svn/user/antocuni/cli-bench/tailcall.exe</a></p>
<p>With CLR 2.0.50727 the tail call is about 6.5 times *slower* than the normal call, which is by itself 2 times slower than the for loop.<br />
Could you try to run the benchmark, please?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leppie</title>
		<link>http://xacc.wordpress.com/2008/11/03/ironscheme-does-cps/#comment-2711</link>
		<dc:creator>leppie</dc:creator>
		<pubDate>Thu, 06 Nov 2008 10:41:07 +0000</pubDate>
		<guid isPermaLink="false">http://xacc.wordpress.com/?p=141#comment-2711</guid>
		<description>@Antonio (again): Wow, very impressive numbers! I think I should start looking into using PyPy in some or other way (I did have a look at it about a year back).</description>
		<content:encoded><![CDATA[<p>@Antonio (again): Wow, very impressive numbers! I think I should start looking into using PyPy in some or other way (I did have a look at it about a year back).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
