<?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/"
	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>programming musings</title>
	<atom:link href="http://programming-musings.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://programming-musings.org</link>
	<description>random thoughts on programming and programming languages</description>
	<lastBuildDate>Wed, 30 Dec 2009 22:24:11 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='programming-musings.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/96e228f74ade6fea169f685d59bdfb0b?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>programming musings</title>
		<link>http://programming-musings.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://programming-musings.org/osd.xml" title="programming musings" />
		<item>
		<title>SICP distilled</title>
		<link>http://programming-musings.org/2009/12/29/sicp-distilled/</link>
		<comments>http://programming-musings.org/2009/12/29/sicp-distilled/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 02:36:40 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=330</guid>
		<description><![CDATA[If you&#8217;re still thinking about reading SICP, here&#8217;s an article, written by Abelson and Sussman shortly after publishing the first edition of the book, that may dispel your doubts: Lisp: A language for stratified design. It&#8217;s a quick distillation of some of the central themes discussed at length in SICP, with accompanying code. Some of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=330&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you&#8217;re still thinking about reading SICP, here&#8217;s an article, written by Abelson and Sussman shortly after publishing the first edition of the book, that may dispel your doubts: <a href="http://dspace.mit.edu/bitstream/1721.1/6064/2/AIM-986.pdf">Lisp: A language for stratified design</a>. It&#8217;s a quick distillation of some of the central themes discussed at length in SICP, with accompanying code. Some of them may seem old hat these days (the article was published in 1987), but they&#8217;re as relevant as they were back in the day, and it&#8217;s difficult to find them exposed in as good (let alone a better) a way. Its dozen pages are full of quotable pearls of wisdom. For instance, right from the start:</p>
<blockquote><p>
Just as every day thoughts are expressed in natural language, and formal deductions are expressed in mathematical language, methodological thoughts are expressed in programming languages. A programming language is a method for communicating methods, not just a means for getting a computer to perform operations&#8211;programs are written for people to read as much as they are written for machines to execute.
</p></blockquote>
<p>and later on</p>
<blockquote><p>
[...]if a methodology is to be robust, it must have more generality than is needed for the particular application. The means for combining the parts must allow for after-the-fact changes in the design plan as bugs are discovered and as requirements change. It must be easy to substitute parts for one another and to vary the arrangement by which parts are combined
</p></blockquote>
<p>The examples include Henderson&#8217;s <a href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-15.html#%_sec_2.2.4">picture language</a>, which motivates a discussion of metalinguistic abstraction (or DSLs, as rediscovered these days):</p>
<blockquote><p>
Part of the wonder of computation is that we have the freedom to change the framework by which the descriptions of processes are combined. If we can precisely describe a system in any well-defined notation, then we can build an interpreter to executed programs expressed in the new notation, or we can build a compiler to translate programs expressed in the new notation into any other programming language.
</p></blockquote>
<p>There&#8217;s also a synopsis of the implementation, in Scheme, of a rule language geared at simplifying algebraic expressions, and the accompanying interpreter. The conclusion is that you want to write languages and interpreters, in <a href="http://www.lisperati.com/landoflisp/panel01.html">a variety of paradigms</a>; and that you probably want to write them using Lisp:</p>
<blockquote><p>
The truth is that Lisp is not the right language for any particular problem. Rather, Lisp encourages one to attack a new problem by implementing new languages tailored to that problem. Such a language might embody an alternative computational paradigm [...] A linguistic approach to design is an essential aspect not only of programming but of engineering design in general. Perhaps that is why Lisp [...] still seems new and adaptable, and continues to accommodate current ideas about programming methodology.
</p></blockquote>
<p>As true today as it was twenty odd years ago, if you ask me.</p>
Posted in Lisp, Programming, Scheme  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=330&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/12/29/sicp-distilled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>
	</item>
		<item>
		<title>Scheme lectures, mostly</title>
		<link>http://programming-musings.org/2009/12/23/scheme-lectures-mostly/</link>
		<comments>http://programming-musings.org/2009/12/23/scheme-lectures-mostly/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 23:32:24 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=295</guid>
		<description><![CDATA[Here&#8217;s a list of (mostly) scheme video lectures, based on the links posted in this thread of the PLT mailing list, with some extra bits taken from my own collection:

SICP lectures by Abelson and Sussman (see also here for more lightweight versions), still my all-time favourite lecture series on any field.

Also based on SICP, Brian [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=295&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s a list of (mostly) scheme video lectures, based on the links posted in <a href="http://groups.google.com/group/plt-scheme/browse_thread/thread/eea3b96bd0fd397a">this thread</a> of the PLT mailing list, with some extra bits taken from my own collection:</p>
<ul>
<li><a href="http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/">SICP lectures</a> by Abelson and Sussman (see also <a href="http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/VideoLectures/index.htm">here</a> for more lightweight versions), still my all-time favourite lecture series on any field.
</li>
<li>Also based on SICP, <a href="http://webcast.berkeley.edu/course_details_new.php?seriesid=2009-D-26266&amp;semesterid=2009-D">Brian Harvey&#8217;s course on UCB</a> is quite fun (and, while you&#8217;re at it, you may find interesting <a href="http://webcast.berkeley.edu/courses.php">other UCB courses</a> too). And <a href="http://aduni.org/courses/sicp/index.php?view=cw">the ADU course</a> comes with lots of additional notes and materials, although i&#8217;ve only skimmed over it and i don&#8217;t really know how good it is. But let me tell you that, if it&#8217;s as good as <a href="http://web.stonehill.edu/compsci/shai.htm">Shai Simonson</a>&#8217;s course on <a href="http://aduni.org/courses/theory/index.php?view=cw">Theory of computation</a>, it&#8217;s probably worth your time.
<li>All videos from this year&#8217;s ICFP are <a href="http://www.vimeo.com/album/126865">available online</a>. Among them, one can find Jay McCarthy&#8217;s talk on <a href="http://www.vimeo.com/6627041">RESTful webapps in Scheme</a> using serializable continuations; Matthew Flatt on PLT&#8217;s <a href="http://www.vimeo.com/6630691">Scribble documentation system</a>; Matthias Felleisen on how he and his collaborators are <a href="http://www.vimeo.com/6631514">using purely functional programming</a> for teaching kids and making them have fun; and Ralf Hinze&#8217;s <a href="http://www.vimeo.com/6653485">La Tour D’Hanoï</a>, which is not about scheme but is a pearl anyway (as is Ryan Newton&#8217;s report on how he used functional programming to <a href="http://www.vimeo.com/6654466">implement an embedded bird detector</a> via a parallel DSL with some metaprogramming for a good measure).
<li>During the latest <a href="http://www.gnu.org/ghm/2009/">GNU Hackers meeting</a>, <a href="http://wingolog.org">Andy Wingo</a> talked about <a href="http://www.gnu.org/ghm/2009/torrents/ghm2009-wingo-small.ogg.torrent">recent developments on Guile</a> (bittorrent file).</li>
</li>
<li>Robby Findler on <em>Why macros matter</em> is a little nice introduction on how one can use macros not only in cases that lazy languages handle gracefully, but, more importantly, as a full-fledged language definition device.
<p><span style="text-align:center; display: block;"><a href="http://programming-musings.org/2009/12/23/scheme-lectures-mostly/"><img src="http://img.youtube.com/vi/GBpfOpk-ZBU/2.jpg" alt="" /></a></span>
</li>
<li>A <a>clip</a> featuring <a href="http://www.cs.brown.edu/~sk/">Shriram Khrisnamurthi</a>,  where he introduces <a href="http://www.wescheme.org">WeScheme</a>, a pretty interesting <em>scheme-in-a-browser</em> environment based on PLT&#8217;s Moby platform, which Shriram <a href="http://www.international-lisp-conference.org/2009/speakers#krishnamurthi_shriram"> presented</a> at the latest ILC; although there&#8217;s no video of that talk available, you can get the slides and a sound recording <a href="http://www.cs.brown.edu/~sk/Publications/Talks/Moby-Bootstrap/">here</a> (as is usually the case with Shriram, definitely worth your time).
</li>
<li>A talk by Matthias Felleisen on the evolution of Northeastern University&#8217;s CS curriculum, where scheme plays a central role.
<p><span style="text-align:center; display: block;"><a href="http://programming-musings.org/2009/12/23/scheme-lectures-mostly/"><img src="http://img.youtube.com/vi/efhh0Cf6sT8/2.jpg" alt="" /></a></span>
</li>
<li> The <a href="http://www.cs.indiana.edu/dfried_celebration.html">DanFest videos</a>, which i&#8217;ve  mentioned before <a href="http://programming-musings.org/2007/02/21/a-video-celebration/">one</a> or <a href="http://programming-musings.org/2007/02/25/scheme-loops/">two</a> times. Virtually all lectures in this series are worth watching, but, if Robby&#8217;s talk above picked your curiosity, don&#8217;t miss Ken Dyvbig&#8217;s <em>Macro Writer&#8217;s Bill of Rights</em> video and <a href="http://www.cs.indiana.edu/~chaynes/danfest/dyb.pdf">slides</a>.
<p><span style='text-align:center;display:block;'><object width='400' height='330' type='application/x-shockwave-flash' data='http://video.google.com/googleplayer.swf?docId=-6899972066795135270'><param name='allowScriptAccess' value='never' /><param name='movie' value='http://video.google.com/googleplayer.swf?docId=-6899972066795135270'/><param name='quality' value='best'/><param name='bgcolor' value='#ffffff' /><param name='scale' value='noScale' /><param name='wmode' value='window'/></object></span><br />
And i cannot help mentioning neither Gerry Sussman&#8217;s <em>The role of programming in the formulation of ideas</em></p>
<p><span style='text-align:center;display:block;'><object width='400' height='330' type='application/x-shockwave-flash' data='http://video.google.com/googleplayer.swf?docId=-2726904509434151616'><param name='allowScriptAccess' value='never' /><param name='movie' value='http://video.google.com/googleplayer.swf?docId=-2726904509434151616'/><param name='quality' value='best'/><param name='bgcolor' value='#ffffff' /><param name='scale' value='noScale' /><param name='wmode' value='window'/></object></span><br />
(and its <a href="http://dspace.mit.edu/bitstream/handle/1721.1/6707/AIM-2002-018.pdf?sequence=2">accompanying article</a>) nor Oleg Kiselyov&#8217;s <em>Normal-order syntax-rules and proving the fix-point of call/cc</em>:</p>
<p><span style='text-align:center;display:block;'><object width='400' height='330' type='application/x-shockwave-flash' data='http://video.google.com/googleplayer.swf?docId=-7990603720514207956'><param name='allowScriptAccess' value='never' /><param name='movie' value='http://video.google.com/googleplayer.swf?docId=-7990603720514207956'/><param name='quality' value='best'/><param name='bgcolor' value='#ffffff' /><param name='scale' value='noScale' /><param name='wmode' value='window'/></object></span>
</li>
<li>As an aside, if you like Gerry as much as i do, you might be interested in hearing him <a href="http://mitworld.mit.edu/video/126">sharing his enthusiasm for mechanical watches</a> for a change. Or, if insist staying (more or less) on topic, take a look at his <a href="http://aduni.org/colloquia/sussman/">The Legacy of Computer Science</a>, for Gerry&#8217;s take on how CS is making us smarter.
</li>
<li>Guy Steele&#8217;s <em>Designing by Accident</em> is a very interesting history on how Scheme came to life and its relationship with actors:
<p><span style='text-align:center;display:block;'><object width='400' height='330' type='application/x-shockwave-flash' data='http://video.google.com/googleplayer.swf?docId=2972857259372904575'><param name='allowScriptAccess' value='never' /><param name='movie' value='http://video.google.com/googleplayer.swf?docId=2972857259372904575'/><param name='quality' value='best'/><param name='bgcolor' value='#ffffff' /><param name='scale' value='noScale' /><param name='wmode' value='window'/></object></span><br />
for which you&#8217;ll need the <a href="http://research.sun.com/projects/plrg/JAOO-SchemeHistory-2006public.pdf">accompanying slides</a>. Although not specifically about Scheme, Steele&#8217;s <a href="http://video.google.com/videoplay?docid=-8860158196198824415">Growing a language</a> is also a must see.
</li>
<li>You will have to tell me how good Matthiew Flatt&#8217;s <a href="http://www.researchchannel.org/prog/displayevent.aspx?rID=3892">Processes without partitions</a> is, because it seems to be available only in formats that i cannot play on debian.
</li>
<li>In <em>The 90 minute Scheme to C compiler</em> talk Mark Feeley shows how closure conversion and CPS can be used to put together a Scheme compiler (ninety minutes being the time needed to <em>explain</em> it, mind you).
<p><span style='text-align:center;display:block;'><object width='400' height='330' type='application/x-shockwave-flash' data='http://video.google.com/googleplayer.swf?docId=-5325481895624358999'><param name='allowScriptAccess' value='never' /><param name='movie' value='http://video.google.com/googleplayer.swf?docId=-5325481895624358999'/><param name='quality' value='best'/><param name='bgcolor' value='#ffffff' /><param name='scale' value='noScale' /><param name='wmode' value='window'/></object></span>
</li>
<li>Those of you new to scheme and functional programming may enjoy this lecture by Jerry Cain, pertaining to Stanford&#8217;s course on Programming Paradigms, which discusses functional programming using Kawa scheme. Not stellar, but not bad as an introduction.
<p><span style="text-align:center; display: block;"><a href="http://programming-musings.org/2009/12/23/scheme-lectures-mostly/"><img src="http://img.youtube.com/vi/_cV8NWQCxnE/2.jpg" alt="" /></a></span>
</li>
<li>Finally (for now), some fun livecoding with <a href="http://www.pawfal.org/fluxus/">Fluxus</a>:
<p><span style="text-align:center; display: block;"><a href="http://programming-musings.org/2009/12/23/scheme-lectures-mostly/"><img src="http://img.youtube.com/vi/2O5DJTOy6EA/2.jpg" alt="" /></a></span><br />
And don&#8217;t miss <a href="http://impromptu.moso.com.au/gallery.html">this gallery</a> for some really beautiful ones.
</ul>
Posted in Scheme  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/295/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=295&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/12/23/scheme-lectures-mostly/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/GBpfOpk-ZBU/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/efhh0Cf6sT8/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/_cV8NWQCxnE/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/2O5DJTOy6EA/2.jpg" medium="image" />
	</item>
		<item>
		<title>Comprehensive Hutton</title>
		<link>http://programming-musings.org/2009/12/12/comprehensive-hutton/</link>
		<comments>http://programming-musings.org/2009/12/12/comprehensive-hutton/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 23:50:23 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=285</guid>
		<description><![CDATA[After yawning during the first 10 installments of the series, i&#8217;ve just watched a really beautiful talk (with accompanying slides and literate code) by guest star Graham Hutton in the C9 Lectures webcast [0]. Graham devotes it to show how to solve the countdown puzzle for numbers (find ways of combining n integers to obtain [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=285&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.cs.nott.ac.uk/~gmh/"><img class="alignright" title="Graham Hutton" src="http://www.cs.nott.ac.uk/~gmh/hutton.jpg" alt="" width="250" height="250"></a>After yawning during the first 10 installments of the series, i&#8217;ve just watched <a href="http://channel9.msdn.com/shows/GoingDeep/C9-Lectures-Dr-Graham-Hutton-Functional-Programming-Fundamentals-Chapter-11-of-13/">a really beautiful talk</a> (with <a href="http://docs.google.com/viewer?url=http://www.cs.nott.ac.uk/~gmh/chapter11.ppt">accompanying slides</a> and <a href="http://www.cs.nott.ac.uk/~gmh/countdown.lhs">literate code</a>) by guest star <a href="http://www.cs.nott.ac.uk/~gmh/">Graham Hutton</a> in the C9 Lectures webcast [0]. Graham devotes it to show how to solve the <a href="http://www.askoxford.com/wordgames/countdown/rules/?view=uk">countdown puzzle</a> for numbers (find ways of combining <em>n</em> integers to obtain a target one, using basic arithmetic operations) in Haskell. The lecture is a very nice show off of list comprehensions and how they allow the elegant expression of solutions to certain kind of problems (basically, tree searches in this case), without precluding incremental optimizations (pruning of the search space in the problem at hand). In addition, you&#8217;ll see a very simple, but enlightening, example of program fusion as a technique to boost performance. The code is beautiful and straightforward and, most notably, retains those qualities even after optimization. Hutton is a good speaker and teacher, and the lecture is accessible to anyone with a bare-bones knowledge of Haskell. And the fun doesn&#8217;t end with the video: there&#8217;s also an <a href="http://www.cs.nott.ac.uk/~gmh/bib.html#countdown">accompanying paper</a>, most aptly included in the <a href="http://www.haskell.org/haskellwiki/Research_papers/Functional_pearls">functional pearls series</a>, providing all the details, code and proofs. A discussion is also present in <a href="http://www.cs.nott.ac.uk/~gmh/book.html">Graham&#8217;s book</a>, which, to judge from the quality of the paper, must be an excellent way to introduce yourself to Haskell and functional programming.</p>
<p>&#8212;-<br />
[0] I keep reading praise for these lectures, and everybody seems to adore E. Meijer. Yet i must confess that i find these lectures incredibly bad: to my taste, the lecturer is dull, often misses the point, keeps drawing dubious parallelisms and, every now and then, just makes plain (and, i&#8217;m tempted to say, glaring) conceptual errors. At the risk of losing all my credibility, if any, i wholeheartedly recommend you <i>not</i> to spend any time in the first ten lectures of this series. I&#8217;d take any talk by SPJ any day: <em>that</em> is passion and insight. Or by Hutton, for that matter.</p>
Posted in Haskell  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=285&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/12/12/comprehensive-hutton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>

		<media:content url="http://www.cs.nott.ac.uk/~gmh/hutton.jpg" medium="image">
			<media:title type="html">Graham Hutton</media:title>
		</media:content>
	</item>
		<item>
		<title>The (PLT) future is here</title>
		<link>http://programming-musings.org/2009/12/07/the-plt-future-is-here/</link>
		<comments>http://programming-musings.org/2009/12/07/the-plt-future-is-here/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:13:12 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=269</guid>
		<description><![CDATA[James Swaine has just announced the availability of futures for mzscheme. Still work in progress, this is the first step in native-thread support for PLT Scheme, in the form of a parallelisation library. More concretely, we learn from the documentation that a future &#8220;API represents a best-effort attempt to execute an arbitrary segment of code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=269&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>James Swaine <a href="http://news.gmane.org/gmane.lisp.scheme.plt.devel">has just announced</a> the availability of <em>futures</em> for mzscheme. Still work in progress, this is the first step in native-thread support for PLT Scheme, in the form of a parallelisation library. More concretely, we learn from the <a href="http://pre.plt-scheme.org/docs/html/futures/">documentation</a> that a future &#8220;API represents a best-effort attempt to execute an arbitrary segment of code in parallel&#8221;. One creates a future by passing it a thunk, which starts immediately as a parallel process. Non-parallelisable procedures are detected, and cause the independent thread to block until the main thread <em>touches</em> it: one still needs to write some code to orchestrate the parallel gig. A bit rough, but this is just a pre-alpha release: i&#8217;m sure things will only get better and better!</p>
<p>As mentioned, this new functionality is only available for mzscheme, so you&#8217;ll need to checkout the code from svn and configure the tree with an incantation along the lines of:<br />
<code><br />
$ mkdir build<br />
$ cd build<br />
$ ../src/configure --enable-futures --disable-mred<br />
$ make &amp;&amp; make install<br />
</code></p>
<p>That worked for me. Afterwards, i wrote the CPU burner suggested by James:</p>
<pre>
#lang scheme

(require scheme/future)

(define (loop) (loop))
(define (run)
  (for-each
   touch
   (for/list ([i (in-range 0 (processor-count))])
             (future loop))))
(run)
</pre>
<p>and, lo and behold, <code>mzscheme cpu-burner.ss</code> is making my two little cores beat at top speed.</p>
<p>Of course, haskellers will be hardly moved: <a href="http://www.haskell.org/~simonmar/bib/multicore-ghc-09_abstract.html">runtime support for multicores</a> using <a href="http://www.haskell.org/ghc/docs/6.6/html/users_guide/lang-parallel.html">sparks</a> is already <a href="http://www.haskell.org/ghc/docs/6.6/html/users_guide/sec-using-smp.html">available in ghc</a>, with a more robust implementation.</p>
<p>Happy parallel hacking!</p>
Posted in Haskell, Scheme  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/269/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=269&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/12/07/the-plt-future-is-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>
	</item>
		<item>
		<title>Enjoying Haskell</title>
		<link>http://programming-musings.org/2009/12/03/enjoying-haskell/</link>
		<comments>http://programming-musings.org/2009/12/03/enjoying-haskell/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 18:14:35 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=256</guid>
		<description><![CDATA[I&#8217;ve been reading about Haskell quite a bit during the last months, writing some actual code, and liking the language more and more. After many years favouring dynamically typed languages, i&#8217;m beginning to really appreciate Haskell&#8217;s type system and the benefits it brings to the table. 
A common argument from the static typing camp is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=256&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been reading about Haskell quite a bit during the last months, writing some actual code, and liking the language more and more. After many years favouring dynamically typed languages, i&#8217;m beginning to really appreciate Haskell&#8217;s type system and the benefits it brings to the table. </p>
<p>A common argument from the static typing camp is that the compiler is catching a whole class of bugs for you, to which dynamic types answer that a good test suite (which you need anyway for any serious development) will catch those relatively trivial bugs for you. I tend to agree with the dynamic faction on this issue, but then i think that the strength of static typing (coupled with good type inference) is not at all about the compiler catching typing bugs but, rather, as enforcing useful constraints. When you write Haskell, you have to think hard about your data types and the functions using them; and the compiler will keep complaining and, most importantly, the code will feel awkward and somehow ad hoc until you find a good set of types to solve your problem. </p>
<p>The limits to your freedom imposed by the type system entail, in my experience, a boost in the amount of thought and imagination that i put in my design and implementation, in much the same way as the constraints imposed by metric and rhythm to poetic writing boost creativity and actually help producing a beautiful text. Or, in fact, in the same way as any kind of constraint in any creative endeavour helps (paradoxically, at first sight) in attaining beauty, or, at least, in having fun during the process. </p>
<p>In my experience, the process of writing a program or library in any language is always a struggle to find <i>the</i> right way of expressing the solution to a problem, as the culmination of a series of approximations. The code feels better, more expressive and easy-flowing with each rewrite, until something just clicks and i get this feeling that i&#8217;ve finally captured the essence of the problem (a litmus test being that then it&#8217;s natural to extend the solution to cases i hadn&#8217;t thought of when writing the solution, as if, somehow, the new solutions were already there, waiting for you to <i>discover</i> them). And i&#8217;m finding that the powerful type system offered by Haskell (think not only of vanilla Hindley-Milner, but also of extensions such as GADTs or type families) is helping me reaching the (local) optimum quicker, that satisfying constraints means i&#8217;m closer to the final solution when my code compiles for the first time. You often hear Haskell programmers saying something similar (&#8220;once my code compiles, it works&#8221;), and i think it&#8217;s mostly true, except that the real reason is not that the compiler is catching trivial typing bugs, but, rather, that the constraints imposed by the type system are making you think harder and find the right solution. Same thing with monads, and the clean separation they provide for stateful computations: again, you must think carefully about the right combination of monads and pure code to solve the problem, and most of the time your code will simply not type check if you don&#8217;t get the solution right.</p>
<p>There are two more ways that Haskell&#8217;s type system is helping me writing better programs. Two ways that are especially poignant when the code becomes sizeable enough. The first one is self-documentation: seeing the type of my functions (or asking the interpreter for them) instantly informs me of almost everything i need to know to use them; in fact, when writing in dynamic languages i keep annotating function signatures with this same information, only that there i&#8217;m all by myself to ensure that this information is right. PLT contract system is but a recognition of the usefulness of typing in this regard, although i much prefer the terseness and notational elegance of Haskell&#8217;s type signatures over the much more verbose and, to my eyes, somewhat clunky notation used by PLT (which is not really PLT&#8217;s fault, being as it is a very schemish notation). Let me stress here that having a REPL such as ghci is a god-send (and, to me, a necessity for really enjoying the language): it will tell me the type of an expression in much the same way as decent Lisp or Scheme environments will report a function&#8217;s signature.</p>
<p>The second way Haskell&#8217;s lending a helping hand with non-trivial code base is refactoring. As i mentioned above, i rewrite my programs several times as a rule, and rewrites almost always involve modifying data structures or adding new ones. As i grow older, i find it more and more difficult to keep in my head all the places and ways a given data structure is used in my programs, and with dynamic languages i&#8217;m often falling back to grepping the source code to find them. And again, their plasticity often works against me, in that they let me use those data structures in crooked ways, or forget to take into account new fields or constructors for a modified data type. Haskell&#8217;s compiler has proved an invaluable ally to my refactorings and, by comparison, modifying and maintaining my bigger dynamic programs is not as fun as it used to be.</p>
<p>As an aside, types are not the only thing i&#8217;m finding enjoyable about Haskell. Its astonishing capabilities to express very abstract problems with a remarkable economy of expression (due, in part, to its highly tuned syntax) are extremely useful. To my mind, they mimic the process by which in math we solve harder and harder problems by abstracting more and more, cramming together more relevant information in less space (some cognitive science writers will tell you that thought and even consciousness consists on our ability to compress information). That means that i can express my solutions by capturing them in very high level description: initially, that makes them harder to understand, but once i feel comfortable with the basic concepts and operations, they scale up much, much better than more verbose, less sophisticated ones. Using these new hard-earned concepts, i can solve much harder problems without adding to the complexity of the code in a significant way (one could say, using a loose analogy, that the solutions grow logarithmically with complexity instead of polynomically or exponentially). A direct consequence of this expressiveness is that some well-written Haskell programs are, hands down, the most beautiful pieces of code i&#8217;ve ever seen (just pick a random post at, say, <a href="http://blog.sigfpe.com/">a Neighbohood of Infinity</a> and you&#8217;ll see what i mean; or read Richard Bird&#8217;s <a href="http://www.cs.tufts.edu/~nr/comp150fp/archive/richard-bird/sudoku.pdf">Sodoku solver</a> and compare his solution with one written in your favourite programming language).</p>
<p>Finally, let me say that i find programming in Haskell more difficult than programming in any other language i&#8217;ve used, with perhaps the only exception of Prolog. Sometimes, considerably so. And that&#8217;s perfectly fine with me. For one thing, it makes it more interesting and rewarding. In addition, i&#8217;m convinced that that&#8217;s the price to pay for being able to solve harder problems. I take issue with the frequent pleas to the effect that programming should be effortless or trivial: writing good programs is hard, and mastering the tools for doing it well takes, as with any other engineering or scientific discipline, hard work (why, i don&#8217;t heard anyone complaining that building bridges or computing the effects of gravitational lensing is too difficult). There&#8217;s no silver bullet.</p>
<p>All that said, please don&#8217;t read the above as an apostasy letter announcing the embracement of a new religion. There&#8217;s still much to be said in favour of dynamic languages, specially those in the Lisp family, whose malleability (fostered by their macro systems) is also a strength, in that they allow you to replicate some of the virtues i&#8217;ve been extolling in this post. Haskell lacks the power of homoiconicity, its template mechanisms feeling all but cranky, and that&#8217;s a serious drawback in some contexts (i have yet to decide how serious, as i have yet to decide how much i&#8217;m missing in reflection capabilities). As always, it is a matter of trade-offs and, fortunately, nobody will charge you for high treason for using the language better fit to the problem at hand, or so i hope.</p>
Posted in Essays, Haskell  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/256/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=256&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/12/03/enjoying-haskell/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>
	</item>
		<item>
		<title>Here&#8217;s to Andy</title>
		<link>http://programming-musings.org/2009/06/20/heres-to-andy/</link>
		<comments>http://programming-musings.org/2009/06/20/heres-to-andy/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 00:20:30 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=249</guid>
		<description><![CDATA[Guile 1.9.0, the first in a series of alpha releases leading to 2.0 by the end of this year, has just been released. The number of improvements listed in the NEWS is impressive: you may well find that most, if not all, of your pet peeves against Guile are a thing of the past, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=249&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Guile 1.9.0, the first in a series of alpha releases leading to 2.0 by the end of this year, has just been released. The number of improvements listed in the <a href="http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=NEWS;hb=HEAD">NEWS</a> is impressive: you may well find that most, if not all, of your pet peeves against Guile are a thing of the past, and also relish one or three features that are hard to find in other schemes. As for me, after working with the development version for some months now, i&#8217;m sold. Here are some of my favourites goodies:</p>
<p>The new compiler and virtual machine:</p>
<blockquote>
<pre>
** Guile now can compile Scheme to bytecode for a custom virtual machine.

Compiled code loads much faster than Scheme source code, and runs around
3 or 4 times as fast, generating much less garbage in the process.
</pre>
</blockquote>
<p>which comes with automatic caching of object files, and provides a language tower that is beginning to fulfill Guile&#8217;s foundational goals:</p>
<blockquote>
<pre>
** New language: ECMAScript

Guile now ships with one other high-level language supported,
ECMAScript. The goal is to support all of version 3.1 of the standard,
but not all of the libraries are there yet. This support is not yet
documented; ask on the mailing list if you are interested.
</pre>
</blockquote>
<p>Yes, Guile has now multi-language support and, what&#8217;s more important, a clearly defined way of adding new languages to the mix (full Elisp support comming).</p>
<p>What must be the most infamous Guile misfeature is over:</p>
<blockquote>
<pre>
** The psyntax expander is now hygienic with respect to modules.

Free variables in a macro are scoped in the module that the macro was
defined in, not in the module the macro is used in. For example, code
like this works now:

   (define-module (foo) #:export (bar))
   (define (helper x) ...)
   (define-syntax bar
     (syntax-rules () ((_ x) (helper x))))

   (define-module (baz) #:use-module (foo))
   (bar qux)

It used to be you had to export `helper' from `(foo)' as well.
Thankfully, this has been fixed.
</pre>
</blockquote>
<p>thanks (thanks, thanks!) to the new psyntax:</p>
<blockquote>
<pre>
** psyntax is now the default expander

Scheme code is now expanded by default by the psyntax hygienic macro
expander. Expansion is performed completely before compilation or
interpretation.

Notably, syntax errors will be signalled before interpretation begins.
In the past, many syntax errors were only detected at runtime if the
code in question was memoized.
</pre>
</blockquote>
<p>with such additional niceties as allowing docstrings in macros (docstrings is problably the Guile extension over standard scheme that i like most). Note also that now Guile knows about syntax-case and syntax-rules by default, no need to import additional modules to get that.</p>
<p>And, to finish my laundry list, some new modules for good measure:</p>
<blockquote>
<pre>
* New modules (see the manual for details)

** `(srfi srfi-18)', more sophisticated multithreading support
** `(ice-9 i18n)', internationalization support
** `(rnrs bytevector)', the R6RS bytevector API
** `(rnrs io ports)', a subset of the R6RS I/O port API
** `(system xref)', a cross-referencing facility
</pre>
</blockquote>
<p>The last one, in particular, being put to good use in Geiser. And, by the way, &#8216;multithreading&#8217; here means <i>native</i> multithreading.</p>
<p>While it&#8217;s true that there are still some bugs and rough edges to be smoothed, the future looks bright for Guile, and 2.0 will be a landmark in its history. All these goodies are the result of the combined effort of several hackers, but, without meaning to belittle any of them, i must bow to the amazing hacking powers of <a href="http://wingolog.org">Andy Wingo</a>. During this last year, almost single-handedly, he has brought us the compiler and virtual machine, the ECMAScript language, and the psyntax expander. I must remember to introduce myself as &#8220;Andy&#8217;s coworker&#8221; more often!</p>
<p>Happy hacking!</p>
Posted in Scheme  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=249&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/06/20/heres-to-andy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>
	</item>
		<item>
		<title>A merry gang</title>
		<link>http://programming-musings.org/2009/06/19/a-merry-gang/</link>
		<comments>http://programming-musings.org/2009/06/19/a-merry-gang/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 09:17:09 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scheme]]></category>
		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=242</guid>
		<description><![CDATA[Last Wednesday, FLIB&#8217;s kick-off meeting took place at Oblong&#8217;s Barcelona lab, with a dozen deliciously crazy people attending. 
Due to lack of time and seriousness on my side, the main talk was given by Jos, who gave us an overview of his work with PLT Redex to model lambda calculus. Redex provides an embedded DSL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=242&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last Wednesday, FLIB&#8217;s kick-off meeting took place at Oblong&#8217;s Barcelona lab, with a dozen deliciously crazy people attending. </p>
<p>Due to lack of time and seriousness on my side, the main talk was given by Jos, who gave us an overview of his work with <a href="http://redex.plt-scheme.org/">PLT Redex</a> to model lambda calculus. <a href="http://redex.plt-scheme.org/why-redex.html">Redex</a> provides an embedded DSL to create context-sensitive term-rewriting systems, if you&#8217;ll pardon my buzzwording. In a hand-waving nutshell, term-rewriting systems are syntax-rules on steroids: one specifies a set of rules for transforming (rewriting, or reducing) terms to other terms according to their structure, possibly depending on context. Jos has a very nice example of such a system taken from <a href="http://en.wikipedia.org/wiki/G%C3%B6del,_Escher,_Bach">GEB</a> (Best. Book. Ever.), the <a href="http://everything2.com/title/MIU%2520system">MIU formal system</a>, whose formal rules can be expressed in Redex as:</p>
<pre>
  (--&gt; (‹symbol›  ... I) (‹symbol› ... I U))
  (--&gt; (M ‹symbol› ..) (M ‹symbol› ... ‹symbol› ...))
  (--&gt; (‹symbol›_0 ... I I I ‹symbol›_1 ...) (‹symbol›_0 ... U ‹symbol›_1 ...))
</pre>
<p>that is, if you find a trailing I, you can append U; if you find M, you can duplicate the rest of the string; and three consecutive Is can be reduced to a single U. Now, you can start with a given string (or axiom) and apply the rules to produce new ones (theorems). Note how the rules are contextual, and how there&#8217;s in general more than one that is applicable. Redex will do that for you, creating a tree with all possible reductions.</p>
<p><img src="http://jaortega.files.wordpress.com/2009/06/miu.png?w=630&#038;h=502" alt="MIU reductions in Redex" title="MIU reductions in Redex" width="630" height="502" class="aligncenter size-full wp-image-243" /></p>
<p>Of course, there&#8217;s more to Redex than this simple example. For instance, it&#8217;s been used to provide an operational semantics for R6RS. Jos&#8217; work is somewhere in the middle: while the reduction rules in lambda calculus are even simpler than in MIU, issues of scope quickly complicate things; moreover, Jos explores classical topics in lambda calculus, such as reduction to normal form, fixed point combinators or Church numerals to name a few, always using Redex (the staggering conceptual richness embodied by the humble premises of lambda calculus always amazes me). All in all, a beautiful 32-pages long paper, with accompanying code, that serves as a nice hands-on introduction to both lambda calculus and Redex, and which you can get at <a href="http://telefonica.net/web2/koot/">Jos homepage</a>.</p>
<p>After the presentation, we devoted some time to talk about the future of FLIB. Monthly presentations, lightning talks on demand and a reading group. I like the latter a lot, because having a physical meeting among readers every month is an excellent way of keeping reading groups alive. We&#8217;re still deciding on our first book, but PLAI followed by LiSP seems to be gaining momentum right now. Another nice thing about the reading group is that it opens the possibility for people not able to come to the meetings to participate: just subscribe to our <a href="http://groups.google.com/group/flibug">mailing list</a> and join the discussions about the book du jour.</p>
<p>And then we just sat down around a table with some beer and snacks, and start talking about life and programming languages. I found it very stimulating because of the varied people&#8217;s backgrounds: we had guys from academia and industry; ones just starting their graduate courses, others with twenty years of teaching under their belts; people from several different countries; schemers obsessed with call/cc, smalltalkers, python experts, C++ loathers and programmers who secretly enjoy it, perlmongers and ruby or haskell aficionados. But, they all, people with a passion for programming: i think everybody was happy to have found a bunch of keen souls. </p>
<p>Perhaps it was inevitable that much of the discussion gravitated around our frustrations as programmers and teachers, given the sad state of computer science in both industry and academia, and the insurmountable barriers for adoption faced by the kind of languages we like. But, with that out of the way, here&#8217;s hope (as expressed by Andy after the meeting) that future meetings will concentrate on brighter fields.</p>
<p>A great evening, and no mistake. I hope you&#8217;ll join the fun next July 22nd!</p>
Posted in Lisp, Programming, Scheme, Smalltalk  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=242&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/06/19/a-merry-gang/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>

		<media:content url="http://jaortega.files.wordpress.com/2009/06/miu.png" medium="image">
			<media:title type="html">MIU reductions in Redex</media:title>
		</media:content>
	</item>
		<item>
		<title>flib</title>
		<link>http://programming-musings.org/2009/05/25/flib/</link>
		<comments>http://programming-musings.org/2009/05/25/flib/#comments</comments>
		<pubDate>Mon, 25 May 2009 19:20:31 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Common Lisp]]></category>
		<category><![CDATA[Elisp]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Prolog]]></category>
		<category><![CDATA[Scheme]]></category>
		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=229</guid>
		<description><![CDATA[Update We&#8217;ve moved the date of our first meeting to June 17th, so you&#8217;re still in time to join us! If you want to follow our adventures, you can also ask for an invitation to our mailing list.
The other day, Andy and I met Jos, an experienced schemer who lives near Barcelona, with the idea [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=229&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Update</strong> We&#8217;ve moved the date of our first meeting to June 17th, so you&#8217;re still in time to join us! If you want to follow our adventures, you can also ask for an invitation to our <a href="http://groups.google.com/group/flibug">mailing list</a>.</p>
<p>The other day, Andy and I met Jos, an experienced schemer who lives near Barcelona, with the idea of having lunch, talking about Scheme, and create a Scheme Users Group. After a bit of discussion, we agreed on widen the group&#8217;s scope, and start what we&#8217;re calling <i>Fringe Languages In Barcelona</i> (FLIB). The plan is to conduct periodic meetings with a main presentation followed by some <i>lightning</i> talks (the latter were a complete success at ILC, and we&#8217;d like to try and see how they work for us), with as much discussion interleaved as we see fit. We&#8217;ll have some refreshments available and, since we&#8217;re meeting in the very center of the old city, visits to pubs or a restaurant for dinner and further socializing are to be expected.</p>
<p>As i said, we&#8217;re expecting much discussion about Scheme and Lisp, but we&#8217;re not ruling out by any means other fine languages. For instance, the talk for the inaugural session (scheduled June <del datetime="2009-06-09T23:04:13+00:00">10th</del>17th, 7:30 pm) is entitled <i>The implementation of FUEL, Factor&#8217;s Ultimate Emacs Library</i>, and it will include a short introduction to Factor (yes, i am the <del datetime="2009-June 10 2009 at 7.30 PM05-25T16:10:35+00:00">victim</del> speaker). Jos will come next, the same day, with a lightning talk about PLT Redex. We have free slots for more lighting talks: <i>you</i> are invited not only to come, but to give one if you&#8217;re so inclined. This being our first meeting, there will be also some time for logistics and organisation.</p>
<p>So, if you&#8217;re near here by then, by all means, come in and join the fun:</p>
<blockquote><p>
<a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=carrer+del+pi+3,+08002+barcelona&amp;sll=41.499798,1.930208&amp;sspn=0.007409,0.010772&amp;ie=UTF8&amp;z=17&amp;iwloc=A">Calle del Pi 3</a> Principal Interior (first floor)<br />
Barcelona
</p></blockquote>
<p>Not really needed, but if you&#8217;re thinking about coming, sending me a mail beforehand will help us to be sure that we&#8217;ve got enough food and drinks.</p>
<p>We&#8217;re looking forward to getting FLIB started, and we&#8217;re sure that at least <a href="http://foldoc.org/grix">grix</a> more fringers are coming! Don&#8217;t miss it!</p>
Posted in Common Lisp, Elisp, Erlang, Haskell, Lisp, Programming, Prolog, Scheme, Smalltalk  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=229&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/05/25/flib/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>
	</item>
		<item>
		<title>Geiser</title>
		<link>http://programming-musings.org/2009/05/14/geiser/</link>
		<comments>http://programming-musings.org/2009/05/14/geiser/#comments</comments>
		<pubDate>Wed, 13 May 2009 23:41:20 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=217</guid>
		<description><![CDATA[I hope you&#8217;ll pardon a shameless plug of one of my latest hacks, Geiser, a new Emacs-Scheme interaction mode.
After having lots of fun implementing Fuel, i was left with a lot of Elisp code that, i realized, could be easily reused for languages other than Factor. I also decided that it was high time to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=217&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I hope you&#8217;ll pardon a shameless plug of one of my latest hacks, Geiser, a new Emacs-Scheme interaction mode.</p>
<p>After having lots of fun implementing <a href="http://factor-language.blogspot.com/2009/01/screencast-editing-factor-code-with.html">Fuel</a>, i was left with a lot of Elisp code that, i realized, could be easily reused for languages other than Factor. I also decided that it was high time to stop whining about Scheme environments not being dynamic enough and do something about it. As they say, talk is cheap.</p>
<p>Thusly, <a href="http://gitorious.org/geiser">Geiser</a> was born, and today it came of <del datetime="2009-05-14T11:09:53+00:00">0.0.1</del> 0.0.2 age, as per the git tag in its <a href="http://gitorious.org/geiser/mainline/trees/master">repository</a>.</p>
<p>If you know Slime or Fuel, you know what Geiser aims at: a pleasant, live interaction with Scheme without leaving Emacs. This first release is by no means there yet, but you&#8217;ll already find some joy using it: module-aware and incremental evaluation, jumping to definitions, dynamic symbol completion and automatic signature display in the echo area are the highlights.</p>
<p>Currently, Geiser supports two Scheme implementations: Guile and PLT. Yeah, i like both (and several others). It&#8217;s been really fun discovering how to tweak them to obtain the metadata i wanted, and their developers and users have been helpful, kind and patient to no end. A big thanks to them (you know who you are), and my promise that i&#8217;ll keep nagging.</p>
<p>Both Guile and PLT have given me many pleasant surprises. Guile is the most common-lispy Scheme around, and the recent hard work and improvements by the likes of Andy Wingo is making much of the criticism it memetically receives just moot. And PLT is by no means the rigid system i thought it was, while retaining all the great features i knew it had. Try any of them, with or without Geiser: they&#8217;re real fun.</p>
<p>Back to Geiser, this being an alpha release, there&#8217;s no screencasts or real documentation&#8230; the code just escaped leaving a blood trail, you know. Maybe one day it&#8217;ll have a webpage, a mailing list and even users. In the meantime, if you&#8217;re brave enough, the <a href="http://git.hacks-galore.org/gitweb/jao?p=geiser.git;a=blob_plain;f=README;hb=HEAD">README</a> will hopefully do; and, of course, the code:</p>
<pre>
  git clone git://gitorious.org/geiser/mainline.git
</pre>
<p>(If you&#8217;re not brave enough, but curious, the code is browsable <a href="http://gitorious.org/geiser/mainline/trees/master">here</a>.)</p>
<p>Needless to say, all kinds of comments, criticisms and laundry lists are welcome and, actually, encouraged.</p>
<p>Happy scheming!</p>
Posted in Emacs, Hacks, Scheme  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/217/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=217&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/05/14/geiser/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>
	</item>
		<item>
		<title>From my cold, dead hands</title>
		<link>http://programming-musings.org/2009/03/29/from-my-cold-prying-hands/</link>
		<comments>http://programming-musings.org/2009/03/29/from-my-cold-prying-hands/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 21:55:53 +0000</pubDate>
		<dc:creator>jao</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://programming-musings.org/?p=210</guid>
		<description><![CDATA[Back at the PLT Scheme blog, Matthias Felleisen has just posted an entry on the rationale behind the limitations imposed to DrScheme&#8217;s REPL, namely, the inability to evaluate individual expressions. If you&#8217;ve read this blog before, you won&#8217;t be surprised to know that, as much as i respect Matthias, i totally disagree with his rationale. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=210&subd=jaortega&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Back at the PLT Scheme blog, Matthias Felleisen has just posted <a href="http://blog.plt-scheme.org/2009/03/drscheme-repl-isnt-lisp.html">an entry</a> on the rationale behind the limitations imposed to DrScheme&#8217;s REPL, namely, the inability to evaluate individual expressions. If you&#8217;ve read this blog before, you won&#8217;t be surprised to know that, as much as i respect Matthias, i totally disagree with his rationale. Well, not totally: let me explain. Matthias&#8217; point is that allowing on the go redefinitions often leads to inconsistent states of the running image, which in turn leads to confusion and much head scratching, even when that head belongs to, say, Dan Friedman (let alone Matthias&#8217; students&#8217; heads, or mine, for that matter). Therefore, we&#8217;d better ban the offending feature from the development environment, right?</p>
<p>I&#8217;m willing to concede that evaluation of individual expressions is as dangerous as Matthias&#8217; experience suggests, or even demonstrates. But i strongly take issue with his conclusion. Incremental development might be dangerous, but it&#8217;s also a powerful tool, and incredibly fun (all three come together most of the time, don&#8217;t they?) as any  Common Lisp, Factor, Smaltalk, Scheme48 or Guile (to mention a few) hacker will tell you. As yours truly has been telling you since this blog started. Or PLT hackers, for that matter: Matthias&#8217; post originates in <a href="http://comments.gmane.org/gmane.lisp.scheme.plt/31954">this interesting email exchange</a>, with people giving good reasons on behalf of an incremental REPL (think, for instance, of <a href="http://permalink.gmane.org/gmane.lisp.scheme.plt/31961">manipulating large chunks of intermediate data</a>). I want this power. I want the fun. I&#8217;m willing to take the risk.</p>
<p>In my opinion, this is a good illustration of one of the points that Gerry Sussman <a href="http://programming-musings.org/2009/03/29/sussmaniana/">was making</a> in his talk on robust systems at ILC. For instance, injudicious use of generic functions will quickly paint you into a corner; but, at the same time, this sharp knife will cut for you beauties such as the scmutils library used in <a href="http://mitpress.mit.edu/SICM/">SICM</a>, or help you in taming evolving requirements. Should we be deprived of generics for our own good?</p>
<p>Now, don&#8217;t take me wrong. I immensely appreciate the warnings and advice of people who, as Matthias, have much more experience and knowledge under their belts than i&#8217;ll ever have. I&#8217;m willing (eager, even) to learn from them. But i don&#8217;t understand why warnings should become prohibitions. I&#8217;m not dissing the work of Robby implementing DrScheme&#8217;s &#8216;restart-the-world&#8217; functionality: it&#8217;s great to have it there (in fact, having it there as a safety net is yet another reason for allowing the incremental REPL variety). And i would have no objection if not having an incremental REPL were due to technical implementation details. What i fail to see is why undercutting the functionality of my tools in the name of  &#8216;my own good&#8217; is the right thing to do. I hated it when my parents did that to me ;-).</p>
Posted in Programming, Scheme  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaortega.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaortega.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaortega.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaortega.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaortega.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaortega.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaortega.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaortega.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaortega.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaortega.wordpress.com/210/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programming-musings.org&blog=59048&post=210&subd=jaortega&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://programming-musings.org/2009/03/29/from-my-cold-prying-hands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c022bc33898f25040a60cc441561c25?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">jaortega</media:title>
		</media:content>
	</item>
	</channel>
</rss>