<?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>Pure Danger Tech</title>
	<atom:link href="http://tech.puredanger.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.puredanger.com</link>
	<description>Alex Miller&#039;s technical blog</description>
	<lastBuildDate>Sun, 05 Feb 2012 19:45:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Clojure values</title>
		<link>http://tech.puredanger.com/2012/02/05/clojure-values/</link>
		<comments>http://tech.puredanger.com/2012/02/05/clojure-values/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 19:38:36 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Clojure]]></category>

		<guid isPermaLink="false">http://tech.puredanger.com/?p=1210</guid>
		<description><![CDATA[About a week ago I put up a poll asked questions about what people in the Clojure community valued. In particular, this was a series of questions that said, &#8220;We value X over Y&#8221;. I was trying to capture the same notion from the agile manifesto where they say that while there is value in [...]]]></description>
			<content:encoded><![CDATA[<p>About a week ago I put up a poll asked questions about what people in the Clojure community valued.  In particular, this was a series of questions that said, &#8220;We value X over Y&#8221;.  I was trying to capture the same notion from the <a href="http://www.agilemanifesto.org/">agile manifesto</a> where they say that while there is value in the thing on the right, we value the thing on the left more.  </p>
<p>By the way fellow Clojure enthusiast: <a href="http://clojurewest.org/schedule">Clojure/West</a> is coming up March 16-17th in San Jose, CA including keynotes by Rich Hickey and Stuart Halloway!  Regular registration rates end Feb 17th.</p>
<p>Here&#8217;s the raw data:</p>
<table border="1">
<tr>
<th>Value</th>
<th>Emphatic yes</th>
<th>Yes</th>
<th>No</th>
<th>Just the opposite</th>
<th>Votes</th>
<th>Score</th>
<th>Scaled score</th>
</tr>
<tr>
<td>Simple over easy</td>
<td>46</td>
<td>30</td>
<td>3</td>
<td>0</td>
<td>79</td>
<td>119</td>
<td>1.51</td>
</tr>
<tr>
<td>Values over variables</td>
<td>47</td>
<td>27</td>
<td>5</td>
<td>0</td>
<td>79</td>
<td>116</td>
<td>1.47</td>
</tr>
<tr>
<td>Clarity over terseness</td>
<td>24</td>
<td>32</td>
<td>6</td>
<td>0</td>
<td>62</td>
<td>74</td>
<td>1.19</td>
</tr>
<tr>
<td>Practical over promising</td>
<td>15</td>
<td>41</td>
<td>6</td>
<td>0</td>
<td>62</td>
<td>65</td>
<td>1.05</td>
</tr>
<tr>
<td>Thinking over tests</td>
<td>22</td>
<td>44</td>
<td>11</td>
<td>2</td>
<td>79</td>
<td>73</td>
<td>0.92</td>
</tr>
<tr>
<td>Public over private</td>
<td>17</td>
<td>49</td>
<td>13</td>
<td>0</td>
<td>79</td>
<td>70</td>
<td>0.89</td>
</tr>
<tr>
<td>Explicit over implicit</td>
<td>14</td>
<td>36</td>
<td>12</td>
<td>0</td>
<td>62</td>
<td>52</td>
<td>0.84</td>
</tr>
<tr>
<td>Data over interfaces</td>
<td>20</td>
<td>43</td>
<td>14</td>
<td>2</td>
<td>79</td>
<td>65</td>
<td>0.82</td>
</tr>
<tr>
<td>Accessibility over encapsulation</td>
<td>23</td>
<td>38</td>
<td>17</td>
<td>1</td>
<td>79</td>
<td>65</td>
<td>0.82</td>
</tr>
<tr>
<td>Eggs over easy</td>
<td>21</td>
<td>14</td>
<td>24</td>
<td>20</td>
<td>79</td>
<td>-8</td>
<td>-0.10</td>
</tr>
<tr>
<td>Code over ideas</td>
<td>5</td>
<td>29</td>
<td>24</td>
<td>21</td>
<td>79</td>
<td>-27</td>
<td>-0.34</td>
</tr>
</table>
<p></p>
<p>The first 4 columns above are the actual votes.  Votes was the number of votes cast (I added a couple after the start).  Score is my own concoction: +2 points for emphatic yes, +1 point yes, -1 point for no, and -2 points for opposite.  That yields a score, which I scaled by the number of votes in the last column.  I then sorted by the last column.  All data <a href="https://docs.google.com/a/puredanger.com/spreadsheet/gform?key=0AnZHlwd57njAdFpleU1QbVRyLWVXVElRMmJpQlpoYWc&#038;hl=en_US&#038;gridId=0#chart">here</a>.</p>
<p>So, glean from this what you will.  Some other suggestions that did not make it into the poll:</p>
<ul>
<li>Pure functions over procedures</li>
<li>Declarative over steps [me: imperative?]</li>
<li>Semantic clarity over syntactic clarity</li>
<li>Simplicity over complexity</li>
<li>Open over closed</li>
<li>Malleability over rigidity</li>
<li>Transparency over secrecy</li>
<li>Contribution over consumption</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tech.puredanger.com/2012/02/05/clojure-values/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>St. Louis Startup Scene</title>
		<link>http://tech.puredanger.com/2012/01/24/st-louis-startup-scene/</link>
		<comments>http://tech.puredanger.com/2012/01/24/st-louis-startup-scene/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 15:45:12 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[st. louis]]></category>
		<category><![CDATA[startups]]></category>

		<guid isPermaLink="false">http://tech.puredanger.com/?p=1206</guid>
		<description><![CDATA[Lots of new resources coming in to promote a St. Louis startup scene. Tying together some threads: Arch Grants is a new program to give $50k grants to create startups in St. Louis! Cool program. Here&#8217;s a story about it. Startup Weekend is coming to St. Louis this weekend (Jan 27-29th) &#8211; it&#8217;s a great [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of new resources coming in to promote a St. Louis startup scene.  Tying together some threads:</p>
<p><a href="http://archgrants.org/">Arch Grants</a> is a new program to give $50k grants to create startups in St. Louis!  Cool program.  Here&#8217;s <a href="http://bit.ly/zDOutQ">a story about it</a>.</p>
<p><a href="http://stlouis.startupweekend.org/">Startup Weekend</a> is coming to St. Louis this weekend (Jan 27-29th) &#8211; it&#8217;s a great opportunity to find others interested in creating companies.</p>
<p>And finally, the new <a href="http://startupmo.org/">Startup Missouri</a> program is <a href="http://startupmolaunch-eorg.eventbrite.com/">launching on Jan 31st</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.puredanger.com/2012/01/24/st-louis-startup-scene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strange Loop: The Plan</title>
		<link>http://tech.puredanger.com/2012/01/01/strange-loop-the-plan/</link>
		<comments>http://tech.puredanger.com/2012/01/01/strange-loop-the-plan/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 07:31:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[conference]]></category>
		<category><![CDATA[Strange Loop]]></category>

		<guid isPermaLink="false">http://tech.puredanger.com/?p=1201</guid>
		<description><![CDATA[Some musings on previous Strange Loop years and the plan for 2012. Strange Loop 2009 I started Strange Loop in 2009 with the thought that I could put together a local conference and surely I could find (heck probably knew myself) a couple hundred people in St. Louis that would go to a one day [...]]]></description>
			<content:encoded><![CDATA[<p>Some musings on previous <a href="http://thestrangeloop.com">Strange Loop</a> years and the plan for 2012.</p>
<h3>Strange Loop 2009</h3>
<p>I started Strange Loop in 2009 with the thought that I could put together a local conference and surely I could find (heck probably knew myself) a couple hundred people in St. Louis that would go to a one day developer conference. I planned it in one of my favorite movie theaters in one of my favorite areas of St. Louis &#8211; the Loop.  We ended up expanding by a half day and selling out with 300 attendees.  The whole experience was terrifying from beginning to end.  The event itself was an a/v nightmare although I muddled through and people still seemed to like it.  The 2009 event had a few edgy topics but also tread some of the same ground as other conferences.</p>
<h3>Strange Loop 2010</h3>
<p>In 2010 I significantly expanded, planning for 500 people.  With the increased size, there were few real choices in the Loop and I ended up at the Pageant (which I love) with extra meeting rooms at the Moonrise Hotel and the Regional Arts Commission across the street.  Guy Steele did a keynote.  NoSQL was a big focus of the conference.  We recorded many of the talks and released them on InfoQ.  We sold out again at 600 people.  It was not quite as terrifying but I was stretched to the breaking point in the months leading up to the conference.</p>
<h3>Strange Loop 2011</h3>
<p>A year ago I knew what I wanted to do with the conference but I knew I couldn&#8217;t do it alone.  I recruited and found a great group of people &#8211; Mario Aquino, Ryan Senior, Scott Delap, and Nick Cowan came into the fold.  I signed much larger contracts for scary amounts of money (all before a single speaker had been contacted).  </p>
<p>We planned for 700 with a max of 800 attendees.  We moved out of the loop into the Hilton downtown.  I don&#8217;t know what the magic number is, but I crossed some threshold between 600 and 800 people.  Things were different &#8211; sponsors came out of nowhere, some economies of scale kicked in, and Strange Loop all of a sudden seemed like a business, not a conference.  Things were not terrifying, merely very very busy.  </p>
<p>We sold out all 800 tickets two months before the conference.  I worked feverishly with the hotel to find some way to let more people attend and we were eventually able to bump the total up to 900 (and sold out again).  </p>
<p>I had many many great experiences this year &#8211; I don&#8217;t get to see many of the talks during the conference but I thoroughly enjoyed all of the keynotes and several other sessions I got to see. Probably my personal highlight was just getting to know Gerry and Julie Sussman &#8211; they were both phenomenal before, during, and after the conference. Gerry didn&#8217;t just do <a href="http://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute">his keynote</a>, he went to the Haskell workshop, they both attended sessions and the trivia event, they gave out pocket protectors.  Total inspiration.  Rich Hickey brought down the house at the end with a <a href="http://www.infoq.com/presentations/Simple-Made-Easy">great talk</a> that has already gotten more than 50,000 views on InfoQ. I got to talk type systems with Daniel Spiewak well after midnight and have great conversations with more people than I can remember.  The speaker dinner was a blast &#8211; it felt like my wedding reception to drift through the tables and see so many people I knew and got to meet.  </p>
<p>At the same time, I was not happy being at a hotel. The conference felt more like other big conferences &#8211; loss of intimate spaces, the typical blah vibe you get from any hotel conference space, generally crappy views for screens in the big room (inevitable given the shape of big hotel conference spaces), etc etc. </p>
<p>Strange Loop is too awesome to be constrained in such a space.  </p>
<h3>Strange Loop 2012</h3>
<p>This year I was determined to find a venue that would be awesome to see talks yet still accommodate enough people.  Strange Loop will probably grow a little this year, but I think it&#8217;s basically at it&#8217;s limit for retaining the feel I want.  We had looked at the new <a href="http://peabodyoperahouse.com">Peabody Opera House</a> last year but they were targeting an August open date at the time and I just didn&#8217;t trust that to be solid enough for 2011, but now they&#8217;re open so we&#8217;re doing it!  </p>
<p>The main hall is sweet &#8211; it is a similar feel to the Fox Theater (if you&#8217;re from St. Louis), but a bit smaller and more intimate.  I have asked the A/V guys to find the biggest damn screen they can get and they have a multi-million dollar sound system.  Seeing talks in the main theater is going to be remarkable.  In addition, the four side theaters are also perfectly sized for sessions.  They have high ceilings and 3 of them have built-in stages &#8211; these let us put screens and speakers up higher and have a great viewing experience.  Every one of these rooms is just simply better than what you can find in a hotel.  </p>
<p>There is a truly phenomenal set of speakers I talked to last year that just couldn&#8217;t make it.  I can&#8217;t wait to get started putting together this year&#8217;s program. There will still be an open call but I expect competition to be fierce. I&#8217;m convinced that we&#8217;re going to have a conference line-up like nothing you&#8217;ve seen anywhere.</p>
<p>That&#8217;s just the start &#8211; we&#8217;re working to make the optional pre-conference day better (I&#8217;m really glad the Emerging Languages Camp will be part of Strange Loop!), great night-time events, free-flow beverages throughout the day, better snack options, simplified parking, etc. Everything is going to be just better.</p>
<p>When I started Strange Loop my goal was to have a low-cost conference, in comparison to conferences that cost $1000+, don&#8217;t pay speakers, and sell keynote slots to people you don&#8217;t care about.  My views on this have changed over the years &#8211; I would now say that I want Strange Loop to be a *great value* and I think we&#8217;ve hit that goal for sure.  Some of the improvements above cost money.  As such, Strange Loop will cost more in 2012 ($400+) but I still think this is very competitively priced and offers tremendous value. </p>
<p>Some of these changes are also going to consume more time.  I spent a lot of time this year thinking about how to keep doing Strange Loop in a way that makes me happy.  I have a full-time job at Revelytix and have been running Strange Loop by spending every evening and a lot of weekends for half the year working on it.  Adding the additional guys to the team in 2011 made it possible &#8211; they were a huge help.  But really it merely kept my work level flat.</p>
<p>With this year&#8217;s success, it&#8217;s clear that it&#8217;s possible to make some money doing Strange Loop, maybe even enough (with a couple additional other conferences) for me to do it full time.  I&#8217;m not ready to make that leap yet but in 2012 I have worked out an agreement with Revelytix to reduce my hours so that I can spend 20% of my time on conference work.  My hope is that this will allow me to both do better work on Strange Loop (and the new <a href="http://clojurewest.org">Clojure/West</a>) and also reclaim some of my life back so I can spend it with my kids and wife (who has been very supportive throughout).  Many companies would not be so flexible and I really owe a huge debt to the owner of Revelytix, Michael Lang, and my boss, Bob Scanlon, for giving me this leeway.  </p>
<p>2012 is going to be great!  I hope you can make it to Strange Loop.  Join the <a href="http://eepurl.com/dG_X-/">mailing list</a> or track it on <a href="http://lanyrd.com/2012/strange-loop">Lanyrd</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.puredanger.com/2012/01/01/strange-loop-the-plan/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Language criticism</title>
		<link>http://tech.puredanger.com/2011/11/29/language-criticism/</link>
		<comments>http://tech.puredanger.com/2011/11/29/language-criticism/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 03:49:04 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://tech.puredanger.com/?p=1194</guid>
		<description><![CDATA[I read @codahale&#8217;s &#8220;leaked&#8221; assessment of Yammer moving some code from Scala back to Java with great interest today. I post about it somewhat hesitantly because it is a private thing that became public but I have lots of thoughts and I need to dump them somewhere. I am going to write this quickly and [...]]]></description>
			<content:encoded><![CDATA[<p>I read @codahale&#8217;s <a href="http://codahale.com/the-rest-of-the-story/">&#8220;leaked&#8221;</a> <a href="https://gist.github.com/1406238">assessment</a> of Yammer moving some code from Scala back to Java with great interest today. I post about it somewhat hesitantly because it is a private thing that became public but I have lots of thoughts and I need to dump them somewhere.  I am going to write this quickly and it will likely be twice as long as it should be. Sorry.</p>
<p>First, I think there is a great temptation to point at this particular note and use it as evidence that &#8220;Scala is bad&#8221; or whatever.  While I know and respect Stephen Colebourne a tremendous amount, I have not particularly enjoyed the tone of his recent Scala criticism (which is not to say that I don&#8217;t think he makes valid points in some cases). I winced to see him <a href="http://blog.joda.org/2011/11/real-life-scala-feedback-from-yammer.html">waving the flag</a> in this way.    </p>
<p>I would say instead that this is an incredibly valuable evaluation of a young and promising language and I hope and believe that it will be taken that way by Odersky, etc.  It is easy to find drive-by criticism of a language but much rarer to find someone that has lived in it for a long time and is able to deliver precise, detailed feedback of where the pain was greater than the value.  I found Coda&#8217;s criticism to be exactly that and also written in a highly respectful tone. </p>
<p>I am unabashedly a fan of Clojure (if you follow this blog, my tweets, my conference talks, my nascent <a href="http://clojurewest.org">Clojure/West</a> conference, this is no surprise).  I believe some people might perceive Scala and Clojure as enemies and thus suspect that the Clojure community likes seeing Scala bashing.  </p>
<p>Much the opposite.  We all want the same thing &#8211; a way to write programs that allows us to be more productive, make fast flexible systems, and write cool stuff.  I find much to respect and envy in Scala and its ecosystem.  I see some of the smartest programmers I know loving Scala and finding it productive.  I believe that Clojure and Scala (and all the other languages I&#8217;m not talking about) want a better way to do programming.  In that, I see allies, not enemies. </p>
<p>Going back to Coda&#8217;s gist, he is honestly evaluating his choices and deciding where his team can do their best work *right now*.  In the end, you&#8217;re balancing forces of time-to-market, performance, quality, future maintenance debt, on-ramping new people, etc.  I don&#8217;t hear Coda saying &#8220;Scala is bad&#8221;; I hear him saying &#8220;Scala is not the best balance of our needs at this time&#8221;.  Other people will make a different choice.  They will make different choices at other times.  That&#8217;s just being smart at running your business.  Being able to coherently say &#8220;&#8230;because X, Y, Z&#8221; is very helpful so the language can evolve.  </p>
<p>I saw some questions floating around about whether people using Clojure have hit this part of the hype cycle.  Since we&#8217;ve been doing Clojure full-time at Revelytix for a couple years now and have hired people, done maintenance, etc, I think we&#8217;re as qualified as anyone to judge that.  In general, I&#8217;d say that we certainly have encountered painful aspects of the language or the tools &#8211; when you are using tools in anger, you find things that suck.  We have hit serious pain around AOT (ahead-of-time) compilation.  We&#8217;ve seen some nasty classloader problems (linked to AOT).  We&#8217;re having a more painful time than I expected moving from Clojure 1.2 to 1.3. Debugging sometimes sucks due to laziness, large stack traces, confusing error messages, etc.  I yearn for refactoring tools as good as what I had in Eclipse with Java.  Sometimes I want a static type. :)</p>
<p>On balance, we are not clamoring to change back to Java (or anything else) though.   All of the painful things above are things we have worked through.  By choosing a young language, you are implicitly accepting consequences like immature tooling or buggy libraries.  I think we&#8217;ve tried to hit a good balance of powering through issues and giving back fixes or filing bugs where appropriate.  Clojure is such a dynamic language that there is almost always a way to address a problem (even in the core libraries or the language) from your own code.  Encapsulation (of data or code) is not held in particularly high regard in Clojure.  The upside is that the engine is laid bare if you need to swap out a piston or something.  In general, we have found our resulting code to be vastly preferable to what we could do in Java.  Clojure gives you a set of composable tools that allow you to build systems to talk at the level of your problem and that is what I want in any language.  For us, right now, Clojure is still a big win in that set of forces.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.puredanger.com/2011/11/29/language-criticism/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Clojure and Processing</title>
		<link>http://tech.puredanger.com/2011/11/17/clojure-and-processing/</link>
		<comments>http://tech.puredanger.com/2011/11/17/clojure-and-processing/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 22:14:43 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://tech.puredanger.com/?p=1186</guid>
		<description><![CDATA[I had a great time at Devoxx this week &#8211; many thanks to Stephan and crew and whoever is making all this delicious beer here in Belgium. During the end of my Cracking Clojure talk I showed a screencast I did where I progressively build up a solution to Conway&#8217;s Life in Clojure. The end [...]]]></description>
			<content:encoded><![CDATA[<p>I had a great time at <a href="http://devoxx.com">Devoxx</a> this week &#8211; many thanks to Stephan and crew and whoever is making all this delicious beer here in Belgium.  </p>
<p>During the end of my <a href="http://www.slideshare.net/alexmiller/cracking-clojure">Cracking Clojure</a> talk I showed a <a href="http://www.screencast.com/users/puredanger/folders/Default/media/f5ec255f-f236-42cd-9532-831e06ca263c">screencast</a> I did where I progressively build up a solution to Conway&#8217;s Life in Clojure.  </p>
<p>The end solution is completely stolen from <a href="http://clj-me.cgrand.net/2011/08/19/conways-game-of-life/">Christophe Grand</a>&#8216;s elegant solution &#8211; I just filled in the work leading up to it (and refactored slightly).  My end result from the &#8216;cast:</p>
<pre>
(defn neighbors [[x y]]
  (for [dx [-1 0 1]
        dy (if (zero? dx)
             [-1 1]
             [-1 0 1])]
    [(+ dx x) (+ dy y)]))

(defn live [n alive?]
  (or (= n 3)
      (and (= n 2) alive?)))

(defn step [world]
  (set
   (for [[cell n] (frequencies (mapcat neighbors world))
         :when (live n (world cell))]
     cell)))

(defn life [initial-world]
  (iterate step initial-world))</pre>
<p>Note that the final function <code>life</code> will return you an infinite sequence of steps in the game of life starting from an initial world (a set of cells).  </p>
<p>When I went to Vaclav Pech&#8217;s talk on GPars on Tuesday he did a Groovy life implementation in <a href="http://www.jroller.com/vaclav/entry/parallel_game_of_life">GPars with dataflow</a> which was pretty slick and had a real gui.  So, in the keynote before my talk I whipped up a ui of my own using <a href="http://processing.org">Processing</a> and the clj-processing wrappers.  My code is gross, especially in comparison to the life impl but it wraps a ref around the infinite sequence, then peels off the next item (in <code>do-step</code>) each time draw is called (on <code>draw</code>) by Processing and writes it to the screen.</p>
<p>To add clj-processing to you project.clj, use:</p>
<pre> [org.clojars.automata/rosado.processing "1.1.0"]</pre>
<p>It appears to only play nice with Clojure 1.2.x right now due to a dynamic var in the applet.</p>
<pre>
(ns demo.lifeui
  (:use [demo.life]
        [rosado.processing]
        [rosado.processing.applet]))

(def glider #{[0 1] [1 2] [2 0] [2 1] [2 2]})
(def blinker #{[3 3] [3 4] [3 5]})
(def worlds (ref (life glider)))

(defn setup []
  (background-int 0)
  (stroke-int 255)
  (framerate 4))

(defn do-step []
  (dosync
   (let [next-world (first @worlds)]
     (alter worlds #(drop 1 %))
     next-world)))

(defn grid [rows cols cells]
  (let [cellw (/ (width) cols)
        cellh (/ (height) cols)]
    (doseq [x (range rows)
            y (range cols)]
      (if (contains? cells [x y])
        (fill-float 250 50 50)
        (fill-float 0))
      (rect (* x cellw) (* y cellh) cellw cellh))))

(defn draw []
  (background 0)
  (grid 32 32 (do-step)))

(defapplet lifeui
  :title "Life"
  :setup setup
  :draw draw
  :size [800 600])

(run lifeui)
</pre>
<p>One key problem with this whole impl is that it ignores boundary wrapping so please feel free to fix that as an exercise for the reader.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.puredanger.com/2011/11/17/clojure-and-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

