<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Artisan Coder &#187; othello</title>
	<atom:link href="http://www.artisancoder.com/tag/othello/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artisancoder.com</link>
	<description>Software development as a craft</description>
	<lastBuildDate>Thu, 15 Dec 2011 10:57:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Scheme hits the App Store</title>
		<link>http://www.artisancoder.com/2009/10/scheme-hits-the-app-store/</link>
		<comments>http://www.artisancoder.com/2009/10/scheme-hits-the-app-store/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:32:47 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scheme]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[othello]]></category>
		<category><![CDATA[reversi]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=123</guid>
		<description><![CDATA[I believe I have got the first Scheme application past Apple review into the iTunes App Store. It is yet another Reversi clone, called Reverso. It is a combination of 90% Scheme and 10% Objective-C, written with Gambit-C Scheme. James Long has already shown how to compile Gambit-C for the iPhone, and I started from [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.dunasystems.com.br/reverso/images/revlogo.png" alt="Reverso logo" style="float:left;padding:20px;" /></p>
<p>I believe I have got the first Scheme application past Apple review into the iTunes App Store. It is yet another <a href="http://en.wikipedia.org/wiki/Reversi" title="Reversi">Reversi</a> clone, called <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=334979538&#038;mt=8" title="Reverso">Reverso</a>. It is a combination of 90% Scheme and 10% Objective-C, written with <a href="http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Main_Page" title="Gambit-C">Gambit-C Scheme</a>. James Long has already <a href="http://jlongster.com/blog/2009/06/17/write-apps-iphone-scheme/" title="Writing apps for the iPhone in Scheme">shown how to compile Gambit-C for the iPhone</a>, and I started from there. My Scheme code is compiled to C by Gambit and later by GCC to produce native ARM code, bundled in a static library, which is ok with the iPhone SDK license agreement. The Objective-C then calls the library as a pure C library. The Scheme code deals with position evaluation, alpha-beta pruning, transposition tables, move legality, different strategies and so on. The Objective-C code deals with sound, animations, GUI, user preferences, basically everything that calls the iPhone OS API. Reversi was chosen because I like strategy games and it is much more algorithmic than artistic, and I am no artist.</p>
<p>The performance of the code is excellent. I used some Gambit-specific declarations, only fixnum arithmetic, pre-allocated a large heap, and called the garbage-collector every time the user needed to think. The search is not memory intensive, but the transposition tables are. I did not write a specific hash function but relied on Gambit-C&#8217;s table type. The boards used during search were retrieved from a pool (the newest Gambit-C has made <tt>subu8vector-move!</tt> a public API), so they did not put pressure on the garbage-collector. In the end it was a very successful experiment. Developing with Scheme is orders of magnitude more productive than with most other languages. Gambit-C is also one of the best Scheme compilers out there, and made my job a lot easier.</p>
<p><strong>Update</strong>: There was a bug in the application that caused it to play poorly. The weak AI was not Gambit&#8217;s or Scheme&#8217;s fault, but mine. I already sent an updated version to Apple that will play much better. Besides fixing the bug, I am now using Zobrist&#8217;s hashing instead of Gambit&#8217;s own hash function, that performs poorly for game positions. It is still written in Scheme, though. Now I am waiting for the approval of the update, and to hear further feedback from my users. <img src='http://www.artisancoder.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.artisancoder.com/2009/10/scheme-hits-the-app-store/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

