<?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: A Rapid Language Tour</title>
	<atom:link href="http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/feed/" rel="self" type="application/rss+xml" />
	<link>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/</link>
	<description>no magic - just tricks</description>
	<lastBuildDate>Fri, 06 Nov 2009 19:50:06 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jonathan Palardy</title>
		<link>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/#comment-177</link>
		<dc:creator>Jonathan Palardy</dc:creator>
		<pubDate>Sat, 26 Apr 2008 00:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://technotales.wordpress.com/?p=59#comment-177</guid>
		<description>wrt Smalltalk:

Tower of Hanoi, as far as I understand its performance, is IO bound. In Smalltalk, I guess I could output to the Transcript which is terribly slow (their own words!). My interest in Smalltalk is purely non-performance related … although it has been claimed faster than Ruby in most cases. We&#039;ll see how that goes.

wrt Haskell.

Thanks! I googled for &quot;haskell performance&quot; last night after I posted this. There are a number of tips and tricks out there. I had not been looking to make this really fast. In fact, I could have adopted a more imperative style to make it faster and forego the list creation completely … but that wouldn&#039;t be very Haskell-ish.</description>
		<content:encoded><![CDATA[<p>wrt Smalltalk:</p>
<p>Tower of Hanoi, as far as I understand its performance, is IO bound. In Smalltalk, I guess I could output to the Transcript which is terribly slow (their own words!). My interest in Smalltalk is purely non-performance related … although it has been claimed faster than Ruby in most cases. We&#8217;ll see how that goes.</p>
<p>wrt Haskell.</p>
<p>Thanks! I googled for &#8220;haskell performance&#8221; last night after I posted this. There are a number of tips and tricks out there. I had not been looking to make this really fast. In fact, I could have adopted a more imperative style to make it faster and forego the list creation completely … but that wouldn&#8217;t be very Haskell-ish.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don Stewart</title>
		<link>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/#comment-176</link>
		<dc:creator>Don Stewart</dc:creator>
		<pubDate>Fri, 25 Apr 2008 16:21:05 +0000</pubDate>
		<guid isPermaLink="false">http://technotales.wordpress.com/?p=59#comment-176</guid>
		<description>My guess is you didn&#039;t compile the Haskell code, but instead ran it in an interpreter like Hugs or GHCi.

This slight refactor:

    import System.Environment

    showMove src dst = putStrLn (show src ++ &quot; -&gt; &quot; ++ show dst)

    data T = One &#124; Two &#124; Three
        deriving Show

    hanoi :: Int -&gt; T -&gt; T -&gt; T -&gt; [(T, T)]
    hanoi 1 src dst acc = [(src, dst)]
    hanoi n src dst acc = hanoi (n-1) src acc dst ++
                          hanoi 1 src dst acc ++
                          hanoi (n-1) acc dst src

    main = do
        args &lt;- getArgs
        let n = read (head args)
        mapM_ (uncurry showMove) (hanoi (n :: Int) One Two Three)

Runs in 10seconds on my box, when compiled:

   ghc -O2 A.hs 

Note its extrememly naive -- you could for a start replace (++) on lists by an O(1) append operation.</description>
		<content:encoded><![CDATA[<p>My guess is you didn&#8217;t compile the Haskell code, but instead ran it in an interpreter like Hugs or GHCi.</p>
<p>This slight refactor:</p>
<p>    import System.Environment</p>
<p>    showMove src dst = putStrLn (show src ++ &#8221; -&gt; &#8221; ++ show dst)</p>
<p>    data T = One | Two | Three<br />
        deriving Show</p>
<p>    hanoi :: Int -&gt; T -&gt; T -&gt; T -&gt; [(T, T)]<br />
    hanoi 1 src dst acc = [(src, dst)]<br />
    hanoi n src dst acc = hanoi (n-1) src acc dst ++<br />
                          hanoi 1 src dst acc ++<br />
                          hanoi (n-1) acc dst src</p>
<p>    main = do<br />
        args &lt;- getArgs<br />
        let n = read (head args)<br />
        mapM_ (uncurry showMove) (hanoi (n :: Int) One Two Three)</p>
<p>Runs in 10seconds on my box, when compiled:</p>
<p>   ghc -O2 A.hs </p>
<p>Note its extrememly naive &#8212; you could for a start replace (++) on lists by an O(1) append operation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macournoyer</title>
		<link>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/#comment-175</link>
		<dc:creator>macournoyer</dc:creator>
		<pubDate>Fri, 25 Apr 2008 15:17:56 +0000</pubDate>
		<guid isPermaLink="false">http://technotales.wordpress.com/?p=59#comment-175</guid>
		<description>How was Smalltalk perf?

I&#039;m surprised about Haskell. Looking at http://shootout.alioth.debian.org/ it seems to perform quite well.

Also Lua and Io look very interesting too.

Nice post!</description>
		<content:encoded><![CDATA[<p>How was Smalltalk perf?</p>
<p>I&#8217;m surprised about Haskell. Looking at <a href="http://shootout.alioth.debian.org/" rel="nofollow">http://shootout.alioth.debian.org/</a> it seems to perform quite well.</p>
<p>Also Lua and Io look very interesting too.</p>
<p>Nice post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Palardy</title>
		<link>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/#comment-174</link>
		<dc:creator>Jonathan Palardy</dc:creator>
		<pubDate>Fri, 25 Apr 2008 14:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://technotales.wordpress.com/?p=59#comment-174</guid>
		<description>Good question :)

I make no claim at expertise in Haskell, and here&#039;s what I had come up with: http://s3.amazonaws.com/mps/hanoi.hs

You can compare that with http://www.kernelthread.com/hanoi/html/hs.html which generates the whole list in memory (lazily, of course) and outputs it. Keep in mind that 20 rings represents 2^20 lines of output.

Haskell is a fun language with a lot of will-hurt-your-brain ideas … I don&#039;t want to make it sound like this is representative of anything.</description>
		<content:encoded><![CDATA[<p>Good question :)</p>
<p>I make no claim at expertise in Haskell, and here&#8217;s what I had come up with: <a href="http://s3.amazonaws.com/mps/hanoi.hs" rel="nofollow">http://s3.amazonaws.com/mps/hanoi.hs</a></p>
<p>You can compare that with <a href="http://www.kernelthread.com/hanoi/html/hs.html" rel="nofollow">http://www.kernelthread.com/hanoi/html/hs.html</a> which generates the whole list in memory (lazily, of course) and outputs it. Keep in mind that 20 rings represents 2^20 lines of output.</p>
<p>Haskell is a fun language with a lot of will-hurt-your-brain ideas … I don&#8217;t want to make it sound like this is representative of anything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Haran</title>
		<link>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/#comment-173</link>
		<dc:creator>Gary Haran</dc:creator>
		<pubDate>Fri, 25 Apr 2008 13:46:28 +0000</pubDate>
		<guid isPermaLink="false">http://technotales.wordpress.com/?p=59#comment-173</guid>
		<description>Why was Haskell taking that long?</description>
		<content:encoded><![CDATA[<p>Why was Haskell taking that long?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
