<?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; Lua</title>
	<atom:link href="http://www.artisancoder.com/category/programming/lua/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artisancoder.com</link>
	<description>Software development as a craft</description>
	<lastBuildDate>Mon, 23 Aug 2010 13:19:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Apple relaxes restriction on interpreted code</title>
		<link>http://www.artisancoder.com/2010/06/apple-relaxes-restriction-on-interpreted-code/</link>
		<comments>http://www.artisancoder.com/2010/06/apple-relaxes-restriction-on-interpreted-code/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 17:31:11 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scheme]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://www.artisancoder.com/?p=174</guid>
		<description><![CDATA[Apple&#8217;s iOS SDK license agreement terms have always been source of disputes, discussions and many blog posts. Many accuse Apple of being too draconian and elitist, while being ineffective at barring bad applications from entering the store. The uproar just got fueled when Apple released the 4.0 version of the SDK with a new license [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s iOS SDK license agreement terms have always been source of disputes, discussions and many blog posts. Many accuse Apple of being too draconian and elitist, while being ineffective at barring bad applications from entering the store. The uproar just got fueled when Apple released the 4.0 version of the SDK with a new license agreement, changing</p>
<blockquote>
<p>3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs.</p>
</blockquote>
<p>to</p>
<blockquote>
<p>3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).</p>
</blockquote>
<p>The intended effect is obviously to ban third-party abstraction layers, like then soon-to-be-released <a href="http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/" title="Adobe Flash">Adobe&#8217;s Flash for iPhone</a>. But the wording is very broad and cover too many uses of other programming languages and technologies. Steve Jobs demoed himself the Tap Tap Revenge game for iPhone, which <a href="http://blog.anscamobile.com/2010/04/lua-the-lingua-franca-of-iphone-games/" title="Lua, the lingua franca of iPhone games">reportedly uses Lua</a>. The backslash was too big to ignore, making Apple revise the agreement again. This time section 3.3.2 was changed from</p>
<blockquote>
<p>3.3.2 &#8211; No interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple’s Documented APIs and built-in interpreter(s).﻿</p>
</blockquote>
<p>to</p>
<blockquote>
<p>3.3.2 &#8211; Unless otherwise approved by Apple in writing, no interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple’s Documented APIs and built-in interpreter(s). Notwithstanding the foregoing, with Apple’s prior written consent, an Application may use embedded interpreted code in a limited way if such use is solely for providing minor features or functionality that are consistent with the intended and advertised purpose of the Application.﻿</p>
</blockquote>
<p>Although still requiring Apple&#8217;s prior written approval, it leaves the door open for the use of other programming languages on iOS devices. Apple Outsider <a href="http://www.appleoutsider.com/2010/06/10/hello-lua/" title="Hello, Lua">believes</a> this is all about Lua, and he may be right. But of course Lua is not the only game in town.</p>
<p>I always thought <a href="http://www.artisancoder.com/2009/10/scheme-hits-the-app-store/" title="Scheme hits the App Store">my use of Scheme</a> in Reverso was ok with the previous version of the license agreement. No code is ever downloaded, and not interpreted either; Gambit-C compiles Scheme code to C which is compiled with Apple&#8217;s official tools to create a native library. But this changed with the new 3.3.1 section because my code was not originally written in one of the approved languages. <a href="http://jlongster.posterous.com/" title="jlongster’s posterous">James Long</a>, who first compiled Gambit-C for the iPhone, claimed that <a href="http://jlongster.com/blog/2010/04/09/scheme-dead-iphone/" title="Scheme is also dead on the iPhone">Scheme was dead on the iPhone</a>. But then Apple relented and changed section 3.3.2. What about now?</p>
<p>I believe that makes Scheme usable again, if used just like in Reverso: as a library. The application is written in Objective-C, but uses Scheme code (compiled to C) to only add features &#8220;that are consistent with the intended and advertised purpose of the Application&#8221;. Albeit it can be claimed that the code is not interpreted, this use follows the spirit of the law, even if it does not follow its letter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artisancoder.com/2010/06/apple-relaxes-restriction-on-interpreted-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Lua Programming Gems out!</title>
		<link>http://www.artisancoder.com/2008/12/lua-programming-gems-out/</link>
		<comments>http://www.artisancoder.com/2008/12/lua-programming-gems-out/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 22:08:22 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=71</guid>
		<description><![CDATA[Hot from the presses, the book is finally here. The table of contents, the front matter and the free chapter 2 are in the book homepage.]]></description>
			<content:encoded><![CDATA[<p>Hot from the presses, the book is finally here. The table of contents, the front matter and the free chapter 2 are in the <a href="http://www.lua.org/gems/" title="Lua Programming Gems">book homepage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artisancoder.com/2008/12/lua-programming-gems-out/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bibliography of Programming Languages Implementation</title>
		<link>http://www.artisancoder.com/2008/07/bibliography-of-programming-languages-implementation/</link>
		<comments>http://www.artisancoder.com/2008/07/bibliography-of-programming-languages-implementation/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 14:54:56 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=14</guid>
		<description><![CDATA[Doing some research about compilers, interpreters and virtual machines, I have gathered some bibliography from several resources. Here it is, in no particular order: Essentials of Programming Languages, by Daniel P. Friedman, Mitchell Wand and Christopher T. Haynes Programming Language Pragmatics, by Michael L. Scott Smalltalk-80: The Language and Its Implementation, by Adele Goldberg and [...]]]></description>
			<content:encoded><![CDATA[<p>Doing some research about compilers, interpreters and virtual machines, I have gathered some bibliography from several resources. Here it is, in no particular order:</p>
<ul>
<li><a href="http://www.cs.indiana.edu/eopl/" title="Essentials of Programming Languages">Essentials of Programming Languages</a>, by <a href="http://www.cs.indiana.edu/hyplan/dfried.html" title="Daniel P. Friedman">Daniel P. Friedman</a>, <a href="http://www.ccs.neu.edu/home/wand" title="Mitchell Wand">Mitchell Wand</a> and <a href="http://www.cs.indiana.edu/hyplan/chaynes.html" title="Christopher T. Haynes">Christopher T. Haynes</a></li>
<li><a href="http://www.cs.rochester.edu/~scott/pragmatics/" title="Programming Language Pragmatics">Programming Language Pragmatics</a>, by Michael L. Scott</li>
<li><a href="http://users.ipa.net/~dwighth/smalltalk/bluebook/bluebook_imp_toc.html" title="Smalltalk-80: The Language and Its Implementation">Smalltalk-80: The Language and Its Implementation</a>, by Adele Goldberg and David Robson</li>
<li><a href="http://portal.acm.org/citation.cfm?coll=GUIDE&#038;dl=GUIDE&#038;id=525376" title="Writing Compilers and Interpreters: An Applied Approach Using C++">Writing Compilers and Interpreters: An Applied Approach Using C++</a>, by <a href="http://portal.acm.org/author_page.cfm?id=81100175907&#038;coll=GUIDE&#038;dl=GUIDE&#038;trk=0&#038;CFID=35005474&#038;CFTOKEN=42269298" title="Ronald L. Mak">Ronald L. Mak</a></li>
<li><a href="http://www.cs.princeton.edu/~appel/modern/ml/" title="Modern Compiler Implementation in ML">Modern Compiler Implementation in ML</a>, by <a href="http://www.cs.princeton.edu/~appel" title="Andrew W. Appel">Andrew W. Appel</a></li>
<li><a href="http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html" title="Lisp in Small Pieces">Lisp in Small Pieces</a>, by <a href="http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/Queinnec.html" title="Christian Queinnec">Christian Queinnec</a></li>
<li><a href="http://lambda-the-ultimate.org/node/1752" title="An Incremental Approach to Compiler Construction">An Incremental Approach to Compiler Construction</a>, by Abdulaziz Ghuloum</li>
<li><a href="http://compilers.iecc.com/crenshaw/" title="Let's Build a Compiler">Let&#8217;s Build a Compiler</a>, by Jack Crenshaw</li>
<li><a href="http://mitpress.mit.edu/sicp/" title="Structure and Interpretation of Computer Programs">Structure and Interpretation of Computer Programs</a>, by Harold Abelson and Gerald Jay Sussman, with Julie Sussman</li>
<li><a href="http://www.elsevier.com/wps/find/bookdescription.cws_home/677874/description#description" title="Advanced Compiler Design and Implementation">Advanced Compiler Design and Implementation</a>, by Steven Muchnick</li>
<li><a href="http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html" title="The 90 Minute Scheme to C compiler">The 90 Minute Scheme to C compiler</a>, by Marc Feeley</li>
<li><a href="http://dragonbook.stanford.edu/" title="Compilers: Principles, Techniques, and Tools">Compilers: Principles, Techniques, and Tools</a>, by Aho, Lam, Sethi and Ulman (the &#8220;Dragon Book&#8221;)</li>
<li><a href="http://www.elsevierdirect.com/product.jsp?isbn=155860698x&#038;" title="Engineering a Compiler">Engineering a Compiler</a>, by Keith Cooper and Linda Torczon</li>
<li><a href="http://www.reddit.com/info/63hth/comments/c02pxbp" title="Mike Pall's guide to the Lua source code">Mike Pall&#8217;s guide to the Lua source code</a></li>
<li><a href="http://liinwww.ira.uka.de/csbib/Compiler/Inst.Computersprachen.TUWien?query=Ertl&#038;partial=off&#038;case=on&#038;maxnum=200&#038;sort=year" title="Anton Ertl's papers">Anton Ertl&#8217;s papers</a></li>
<li><a href="https://www.cs.tcd.ie/David.Gregg/pubs.html" title="David Gregg's papers">David Gregg&#8217;s papers</a></li>
<li><a href="http://www.ics.uci.edu/%7Efranz/Site/publications.html" title="Michael Franz's papers">Michael Franz&#8217;s papers</a></li>
<li><a href="http://www.cs.kent.ac.uk/people/staff/rej/gcbook/gcbook.html" title="Garbage Collection: Algorithms for Automatic Dynamic Memory Management">Garbage Collection: Algorithms for Automatic Dynamic Memory Management</a>, by <a href="http://www.cs.kent.ac.uk/people/staff/rej/" title="Richard Jones">Richard Jones</a> and Rafael D Lins</li>
<li><a href="http://www.norvig.com/paip.html" title="Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp">Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp</a>, by <a href="http://www.norvig.com/index.html" title="Peter Norvig">Peter Norvig</a></li>
<li><a href="http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-453.pdf" title="The Art of the Interpreter of, the Modularity Complex (Parts Zero, One, and Two)">The Art of the Interpreter of, the Modularity Complex (Parts Zero, One, and Two)</a>, by Guy Lewis Steele, Jr. and Gerald Jay Sussman</li>
<li><a href="http://library.readscheme.org/page8.html" title="Compiler section on readscheme.org">Compiler section on readscheme.org</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.artisancoder.com/2008/07/bibliography-of-programming-languages-implementation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Toy Scheme interpreter in Lua</title>
		<link>http://www.artisancoder.com/2008/06/toy-scheme-interpreter-in-lua/</link>
		<comments>http://www.artisancoder.com/2008/06/toy-scheme-interpreter-in-lua/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 22:20:37 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[scheme]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=11</guid>
		<description><![CDATA[As part of my Lisp studies, I have implemented a toy Scheme interpreter in roughly 1000 lines of Lua. It is here. It supports tail-call optimisation, lexical scope for closures, and first-class continuations via call/cc. I have departed from the traditional approach of implementing a Scheme interpreter in Scheme itself because I wanted to avoid [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my Lisp studies, I have implemented a toy Scheme interpreter in roughly 1000 lines of <a href="http://www.lua.org/" title="Lua">Lua</a>. It is <a href="http://www.artisancoder.com/files/" title="artisancoder.com files">here</a>. It supports <a href="http://en.wikipedia.org/wiki/Tail_recursion">tail-call optimisation</a>, lexical scope for closures, and first-class <a href="http://en.wikipedia.org/wiki/Continuation">continuations</a> via <tt>call/cc</tt>.</p>
<p>I have departed from the traditional approach of implementing a Scheme interpreter in Scheme itself because I wanted to avoid possible confusions between the defined language and the defining language. This has made a lot of the concepts clearer. The evaluator is written in <a href="http://en.wikipedia.org/wiki/Continuation_passing_style">continuation-passing style</a>, which is easily done in Lua because the latter has tail-call optimisations. This way it is easier to reify continuations to first-class values.</p>
<p>I have also added a few primitives to allow me to run some examples, as the factorial and fibonacci functions. More primitives can be easily added if desired.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artisancoder.com/2008/06/toy-scheme-interpreter-in-lua/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
