<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Communicatively Speaking</title>
 <link href="http://sam.aaron.name/atom.xml" rel="self"/>
 <link href="http://sam.aaron.name"/>
 <updated>2010-07-20T10:13:42+00:00</updated>
 <id>http://sam.aaron.name</id>
 <author>
   <name>Sam Aaron</name>
   <email>sam.aaron@acm.org</email>
 </author>

 
 <entry>
   <title>Conway's Game of Life in Ioke</title>
   <link href="http://sam.aaron.name/2010/03/29/conway-s-game-of-life-in-ioke.html"/>
   <updated>2010-03-29T00:00:00+00:00</updated>
   <id>http://sam.aaron.name/2010/03/29/conway-s-game-of-life-in-ioke</id>
   <content type="html">&lt;p&gt;A good friend of mine, &lt;a href='http://jexp.de/blog/'&gt;Michael Hunger&lt;/a&gt;, is planning on describing a number of differing implementations of &lt;a href='http://en.wikipedia.org/wiki/Conway&amp;apos;s_Game_of_Life'&gt;Conway&amp;#8217;s Game of Life&lt;/a&gt; in an upcoming keynote. In pursuit of this, he recently emailed me requesting an &lt;em&gt;&amp;#8216;idiomatic&amp;#8217;&lt;/em&gt; version in the exciting yet really rather experimental programming language &lt;a href='http://ioke.org'&gt;Ioke&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This left me with an interesting question floating in my mind: &lt;em&gt;&amp;#8220;What on earth is idiomatic Ioke?&amp;#8221;&lt;/em&gt;. In fact, how can the notion idiomatic even exist in any fledgling medium?&lt;/p&gt;

&lt;p&gt;However, I was undeterred and resolved on attempting to try my best to build something that at least I was happy with. After much writing and re-writing, polishing and folding I finally settled on the the notation I&amp;#8217;ll explain in this post. Please note, you&amp;#8217;ll need the latest edge build of Ioke to interpret it.&lt;/p&gt;

&lt;p&gt;As a quick sidenote, if you haven&amp;#8217;t previously looked at the GoL, I encourage you to take a quick peak at the &lt;a href='http://en.wikipedia.org/wiki/Conway&amp;apos;s_Game_of_Life'&gt;Wikipedia entry&lt;/a&gt; before you continue with this article - it&amp;#8217;s fun and interesting stuff. Rather than rewriting the description here&amp;#8217;s an excerpt from the article itself:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which
is in one of two possible states, live or dead. Every cell interacts with its eight neighbors, which are the
cells that are directly horizontally, vertically, or diagonally adjacent. At each step in time, the following
transitions occur:

1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
2. Any live cell with more than three live neighbours dies, as if by overcrowding.
3. Any live cell with two or three live neighbours lives on to the next generation.
4. Any dead cell with exactly three live neighbours becomes a live cell.

The initial pattern constitutes the seed of the system. The first generation is created by applying the above
rules simultaneously to every cell in the seed — births and deaths happen simultaneously, and the discrete
moment at which this happens is sometimes called a tick (in other words, each generation is a pure function
of the one before). The rules continue to be applied repeatedly to create further generations.
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I tackled the problem by considering the perspectives of the interface and implementation. For the interface I created a runner script, and for the implementation I created a &lt;code&gt;GameOfLife&lt;/code&gt; object.&lt;/p&gt;

&lt;h2 id='game_of_life_runner'&gt;Game of Life Runner&lt;/h2&gt;

&lt;p&gt;A generic GoL runner might consist of the following three phases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firstly, the initialisation of a life environment - this requires a grid size to be specified in terms of the number of rows and columns,&lt;/li&gt;

&lt;li&gt;Secondly for certain cells in the environment&amp;#8217;s grid to be manually spawned - this is the seed of the pattern,&lt;/li&gt;

&lt;li&gt;Finally for a number of evolutions to be initiated with the possibility of displaying the state of the current evolution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this I created the following runner script:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='c'&gt;#!/usr/bin/env ioke&lt;/span&gt;
&lt;span class='c'&gt;;gol_runner.ik&lt;/span&gt;
&lt;span class='kr'&gt;use&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;gol&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='c'&gt;;read in from the program arguments the number of evolutions to initiate&lt;/span&gt;
&lt;span class='nv'&gt;numTimes&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;System&lt;/span&gt; &lt;span class='n'&gt;programArguments&lt;/span&gt; &lt;span class='n'&gt;first&lt;/span&gt; &lt;span class='n'&gt;toRational&lt;/span&gt;

&lt;span class='c'&gt;;Phase 1: create the environment&lt;/span&gt;
&lt;span class='nv'&gt;life&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nc'&gt;GameOfLife&lt;/span&gt; &lt;span class='k'&gt;mimic&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sx'&gt;rows:&lt;/span&gt; &lt;span class='mf'&gt;5&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='sx'&gt;columns:&lt;/span&gt; &lt;span class='mf'&gt;6&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='c'&gt;;Phase 2: Manually Spawn cells&lt;/span&gt;
&lt;span class='p'&gt;[[&lt;/span&gt;&lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;2&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;3&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;4&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;5&lt;/span&gt;&lt;span class='p'&gt;]]&lt;/span&gt; &lt;span class='n'&gt;each&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;coords&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
  &lt;span class='n'&gt;life&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;spawnCell&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;*&lt;/span&gt;&lt;span class='n'&gt;coords&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

&lt;span class='c'&gt;;Phase 3: Evolve the environment the requested number of times&lt;/span&gt;
&lt;span class='c'&gt;;the current state which counts as the first evolution&lt;/span&gt;
&lt;span class='n'&gt;life&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='k'&gt;asText&lt;/span&gt; &lt;span class='k'&gt;println&lt;/span&gt;

&lt;span class='c'&gt;;initiate the following n-1 evolutions&lt;/span&gt;
&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numTimes&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;times&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;life&lt;/span&gt; &lt;span class='n'&gt;evolve&lt;/span&gt; &lt;span class='k'&gt;asText&lt;/span&gt; &lt;span class='k'&gt;println&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Note that I&amp;#8217;m also reading in the number of iterations to initiate from the program arguments. It might seem strange that I&amp;#8217;m calling the method &lt;code&gt;toRational&lt;/code&gt; on the first argument (which comes in as text), however this is currently the only way of converting text to an integer in Ioke at the moment. &lt;a href='http://groups.google.com/group/ioke-language/browse_thread/thread/1a01e129de2048e5'&gt;Ola has said that this is something he&amp;#8217;s looking into improving.&lt;/a&gt;&lt;/p&gt;

&lt;h2 id='running_the_runner'&gt;Running the Runner&lt;/h2&gt;

&lt;p&gt;Now, if we assume the presence of a functioning GoL implementation within &amp;#8220;gol.ik&amp;#8221;, We can run this and see life evolving before our very eyes:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;∴ /Users/sam/Development/gol
λ ./gol_runner.ik 8

+-------------+
|             |
| * * * * * * |
|             |
|             |
|             |
+-------------+

+-------------+
|   * * * *   |
|   * * * *   |
|   * * * *   |
|             |
|             |
+-------------+

+-------------+
|   *     *   |
| *         * |
|   *     *   |
|     * *     |
|             |
+-------------+

+-------------+
|             |
| * *     * * |
|   * * * *   |
|     * *     |
|             |
+-------------+

+-------------+
|             |
| * *     * * |
| *         * |
|   *     *   |
|             |
+-------------+

+-------------+
|             |
| * *     * * |
| *         * |
|             |
|             |
+-------------+

+-------------+
|             |
| * *     * * |
| * *     * * |
|             |
|             |
+-------------+

+-------------+
|             |
| * *     * * |
| * *     * * |
|             |
|             |
+-------------+
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;How lovely. I do hope that you appreciate ASCII-art as much as me! OK, so now for the actual implementation. For this I decomposed GoL into the following three objects: &lt;code&gt;GameOfLife&lt;/code&gt;, &lt;code&gt;Grid&lt;/code&gt; and &lt;code&gt;CellData&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id='celldata'&gt;CellData&lt;/h2&gt;

&lt;p&gt;This is a very basic object which is essentially a nice package of useful cell information such as its liveliness, coordinates and number of live neighbours. Think of it as a basic struct of information. This object is generated by the &lt;code&gt;Grid&lt;/code&gt; and used for the evolution process within the &lt;code&gt;GameOfLife&lt;/code&gt; object.&lt;/p&gt;

&lt;h2 id='gameoflife'&gt;GameOfLife&lt;/h2&gt;

&lt;p&gt;This is the environment, the containing object that is used by the runner. It describes the three phases described above, &lt;em&gt;initialisation&lt;/em&gt;, &lt;em&gt;spawning&lt;/em&gt; and &lt;em&gt;evolving&lt;/em&gt;, each realised by a corresponding method. The source for this, which I will deconstruct below, is as follows:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='ni'&gt;GameOfLife&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;Origin&lt;/span&gt; &lt;span class='k'&gt;mimic&lt;/span&gt; &lt;span class='kr'&gt;do&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
  &lt;span class='nv'&gt;initialize&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sx'&gt;rows:&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='sx'&gt;columns:&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='p'&gt;@&lt;/span&gt;&lt;span class='nv'&gt;grid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nc'&gt;Grid&lt;/span&gt; &lt;span class='n'&gt;withDimensions&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;spawnCell&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;spawnCell&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;evolve&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
    &lt;span class='nv'&gt;nextGrid&lt;/span&gt;       &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;blankGrid&lt;/span&gt;
    &lt;span class='nv'&gt;survivingCells&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;live?&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numLiveNeighbours&lt;/span&gt; &lt;span class='k'&gt;in?&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;2..3&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
    &lt;span class='nv'&gt;newCells&lt;/span&gt;       &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;reject&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;live?&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numLiveNeighbours&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mf'&gt;3&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

    &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;newCells&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;survivingCells&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;each&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;cellData&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='n'&gt;nextGrid&lt;/span&gt; &lt;span class='n'&gt;spawnCell&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;cellData&lt;/span&gt; &lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;cellData&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

    &lt;span class='p'&gt;@&lt;/span&gt;&lt;span class='nv'&gt;grid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;nextGrid&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;initialize&lt;/strong&gt;&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='nv'&gt;initialize&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sx'&gt;rows:&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='sx'&gt;columns:&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
  &lt;span class='p'&gt;@&lt;/span&gt;&lt;span class='nv'&gt;grid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nc'&gt;Grid&lt;/span&gt; &lt;span class='n'&gt;withDimensions&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This is the standard Ioke initialisation hook method. This gets called when the containing object is mimiced (the only way in Ioke to create new objects). In this case we create a new &lt;code&gt;Grid&lt;/code&gt; with the requested dimensions and assign it to a local cell called &lt;code&gt;grid&lt;/code&gt;. Note that &lt;code&gt;@grid&lt;/code&gt; is just shorthand for &lt;code&gt;self grid&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;spawnCell&lt;/strong&gt;&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='nv'&gt;spawnCell&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
  &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;spawnCell&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Here we essentially palm-off the logic to the grid object (explained below). I hope that one day Ioke will get the ability to delegate methods in a much more elegant fashion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;evolve&lt;/strong&gt;&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='nv'&gt;evolve&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
  &lt;span class='nv'&gt;nextGrid&lt;/span&gt;       &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;blankGrid&lt;/span&gt;
  &lt;span class='nv'&gt;survivingCells&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;live?&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numLiveNeighbours&lt;/span&gt; &lt;span class='k'&gt;in?&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;2..3&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
  &lt;span class='nv'&gt;newCells&lt;/span&gt;       &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;reject&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;live?&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numLiveNeighbours&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mf'&gt;3&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

  &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;newCells&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;survivingCells&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;each&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;cellData&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='n'&gt;nextGrid&lt;/span&gt; &lt;span class='n'&gt;spawnCell&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;cellData&lt;/span&gt; &lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;cellData&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='p'&gt;@&lt;/span&gt;&lt;span class='nv'&gt;grid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;nextGrid&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Here we essentially have all the logic for Conway&amp;#8217;s Game of Life expressed in a very small number of succinct lines. We also get to see some of Ioke&amp;#8217;s lovely sequence facilities in action.&lt;/p&gt;

&lt;p&gt;Firstly, we create a new grid which is essentially the current grid, but with all the cells reset to the default state (empty). This is the grid we will populate for the next evolution; consider it a blank slate. Next we collect the set of cells which should survive from the current generation and also which cells will be spawned as a resultant of the correct number of live neighbour cells. As described above, the GoL rules state that a cell is spawned if it has exactly 3 live neighbours. Here we can see that Ioke makes expressing this remarkably elegant and readable:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='nv'&gt;newCells&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;reject&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;live?&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numLiveNeighbours&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mf'&gt;3&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Here we take all the cells in the grid and reject the ones which are live (i.e. have &lt;code&gt;live?&lt;/code&gt; set to a non-true value), we then filter again based on which cells have 3 live neighbours. How beautiful is that!&lt;/p&gt;

&lt;p&gt;Finally, we combine the newly spawned cells and the surviving sells and we spawn a corresonding cell in the next grid which we then use to replace the current grid. Job done.&lt;/p&gt;

&lt;h2 id='grid'&gt;Grid&lt;/h2&gt;

&lt;p&gt;This is the grid of cells. Rather than using the standard &lt;code&gt;initialize&lt;/code&gt; method hook I decided to write my own constructor-style method which has a slightly more intention-revealing name: &lt;code&gt;withDimensions&lt;/code&gt;. This is implemented as follows:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='nv'&gt;withDimensions&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='kr'&gt;with&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
      &lt;span class='sx'&gt;state:&lt;/span&gt; &lt;span class='nb'&gt;Dict&lt;/span&gt; &lt;span class='n'&gt;withDefault&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
      &lt;span class='sx'&gt;numCols:&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='sx'&gt;maxRowIdx:&lt;/span&gt; &lt;span class='n'&gt;rows&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='sx'&gt;maxColIdx:&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Here we initiate the new &lt;code&gt;Grid&lt;/code&gt; object with some default cells representing dimensional information for the grid and also the state of the grid. This state is stored in a Dict which is a dictionary, or a hash in other languages. The state stores a value for each coordinate of the grid, where the value is either 0 for an empty cell and 1 for a live cell. The default for this dictionary is 0. The &lt;code&gt;spawnCell&lt;/code&gt; method essentially sets this bit to 1 to indicate that the given cell is alive. The main reason for using the integers 0 and 1 to represent the liveliness of the cells is that they lend themselves very well for counting. This property is taken advantage of in &lt;code&gt;countLiveNeighbouts&lt;/code&gt;:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='nv'&gt;countLiveNeighbours&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Counts the number of live neighbours for a given set of cell coordinates&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nv'&gt;neighbourCoords&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;permutations&lt;/span&gt;&lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='mf'&gt;-1..1&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;-1..1&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='p'&gt;[(&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;)]&lt;/span&gt;
    &lt;span class='n'&gt;neighbourCoords&lt;/span&gt; &lt;span class='n'&gt;inject&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;r_mod&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;c_mod&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt; &lt;span class='n'&gt;state&lt;/span&gt;&lt;span class='p'&gt;[[&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;r_mod&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;c_mod&lt;/span&gt;&lt;span class='p'&gt;]]&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This method essentially iterates through all the possible neighbour coordinates relative to the current cell and sums the number of live cells. Here we get a good feel for how Ioke allows functional style programming in a slightly more elegant manner than Ruby. Also note that Ioke allows you to pass in a documentation string as the first parameter to any method. This documentation string essentially acts as both an inline source comment and also is available to the runtime which makes it accessible from the repl and also by documentation generation tools such as DokGen.&lt;/p&gt;

&lt;p&gt;One of the nicer Ioke features is its Rubyesque mixins. In this source I use the &lt;code&gt;Sequenced&lt;/code&gt; mixin to give the Grid object a sequence interface:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='k'&gt;mimic!&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nb'&gt;Mixins&lt;/span&gt; &lt;span class='nc'&gt;Sequenced&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This gives it the nice filter method for free which is used in the evolve method described above. To achieve this I just need to mimic the Sequenced mixin and implement a &lt;code&gt;seq&lt;/code&gt; method. In this case &lt;code&gt;Grid&lt;/code&gt;&amp;#8217;s &lt;code&gt;seq&lt;/code&gt; method piggybacks on the &lt;code&gt;seq&lt;/code&gt; method of the list of all cells returned by &lt;code&gt;allCells&lt;/code&gt; which is is a list of &lt;code&gt;CellData&lt;/code&gt; objects:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='nv'&gt;seq&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;allCells&lt;/span&gt; &lt;span class='n'&gt;seq&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Finally, there are a couple of methods which are used to display the current state. The main method for this used by the runner is &lt;code&gt;asText&lt;/code&gt; which generates a nice pretty ASCII representation of a given grid.&lt;/p&gt;

&lt;h2 id='complete_source'&gt;Complete Source&lt;/h2&gt;

&lt;p&gt;OK, I realise that I haven&amp;#8217;t covered everything in detail, but hopefully I&amp;#8217;ve described enough to give you a taste of Ioke and left enough for you to work through and discover yourself. One thing to note is that this is probably the slowest GoL implementation (that wasn&amp;#8217;t specifically written to be slow) that you&amp;#8217;ll ever see. &lt;em&gt;It&amp;#8217;s so slow it&amp;#8217;s painful&lt;/em&gt;. However, performance isn&amp;#8217;t the main purpose of objective of Ioke - it&amp;#8217;s an experiment in expressiveness. Hopefully this example illustrates this for you.&lt;/p&gt;

&lt;p&gt;As a parting gift, here is the complete source of my GoL implementation. I&amp;#8217;d love it if any of you would like to send me some feedback regarding this approach. This is my first GoL implementation, so I&amp;#8217;m positive I have much to learn.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='ni'&gt;GameOfLife&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;Origin&lt;/span&gt; &lt;span class='k'&gt;mimic&lt;/span&gt; &lt;span class='kr'&gt;do&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
  &lt;span class='nv'&gt;initialize&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sx'&gt;rows:&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='sx'&gt;columns:&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='p'&gt;@&lt;/span&gt;&lt;span class='nv'&gt;grid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nc'&gt;Grid&lt;/span&gt; &lt;span class='n'&gt;withDimensions&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;spawnCell&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;spawnCell&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;evolve&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
    &lt;span class='nv'&gt;nextGrid&lt;/span&gt;       &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;blankGrid&lt;/span&gt;
    &lt;span class='nv'&gt;survivingCells&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;live?&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numLiveNeighbours&lt;/span&gt; &lt;span class='k'&gt;in?&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;2..3&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
    &lt;span class='nv'&gt;newCells&lt;/span&gt;       &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;grid&lt;/span&gt; &lt;span class='n'&gt;reject&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;live?&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;filter&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numLiveNeighbours&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mf'&gt;3&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

    &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;newCells&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;survivingCells&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;each&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;cellData&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='n'&gt;nextGrid&lt;/span&gt; &lt;span class='n'&gt;spawnCell&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;cellData&lt;/span&gt; &lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;cellData&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

    &lt;span class='p'&gt;@&lt;/span&gt;&lt;span class='nv'&gt;grid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;nextGrid&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='nc'&gt;GameOfLife&lt;/span&gt; &lt;span class='ni'&gt;Grid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;Origin&lt;/span&gt; &lt;span class='k'&gt;mimic&lt;/span&gt; &lt;span class='kr'&gt;do&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
  &lt;span class='k'&gt;mimic!&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nb'&gt;Mixins&lt;/span&gt; &lt;span class='nc'&gt;Sequenced&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

  &lt;span class='ni'&gt;CellData&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nb'&gt;Origin&lt;/span&gt; &lt;span class='k'&gt;mimic&lt;/span&gt; &lt;span class='kr'&gt;do&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
    &lt;span class='nv'&gt;row&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;coords&lt;/span&gt; &lt;span class='n'&gt;first&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='nv'&gt;col&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;coords&lt;/span&gt; &lt;span class='n'&gt;second&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;withDimensions&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;rows&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='kr'&gt;with&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
      &lt;span class='sx'&gt;state:&lt;/span&gt; &lt;span class='nb'&gt;Dict&lt;/span&gt; &lt;span class='n'&gt;withDefault&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
      &lt;span class='sx'&gt;numCols:&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='sx'&gt;maxRowIdx:&lt;/span&gt; &lt;span class='n'&gt;rows&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
      &lt;span class='sx'&gt;maxColIdx:&lt;/span&gt; &lt;span class='n'&gt;columns&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;blankGrid&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Resets the grid&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kr'&gt;with&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sx'&gt;state:&lt;/span&gt; &lt;span class='nb'&gt;Dict&lt;/span&gt; &lt;span class='n'&gt;withDefault&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;)))&lt;/span&gt;
  &lt;span class='nv'&gt;spawnCell&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Animates a given cell&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;state&lt;/span&gt;&lt;span class='p'&gt;[[&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;]]&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

  &lt;span class='c'&gt;;internal methods&lt;/span&gt;
  &lt;span class='nv'&gt;seq&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;allCells&lt;/span&gt; &lt;span class='n'&gt;seq&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
  &lt;span class='nv'&gt;permutations&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;a&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;b&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;a&lt;/span&gt; &lt;span class='n'&gt;flatMap&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;b&lt;/span&gt; &lt;span class='n'&gt;map&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;j&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;j&lt;/span&gt;&lt;span class='p'&gt;))))&lt;/span&gt;

  &lt;span class='nv'&gt;countLiveNeighbours&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Counts the number of live neighbours for a given set of cell coordinates&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nv'&gt;neighbourCoords&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;permutations&lt;/span&gt;&lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='mf'&gt;-1..1&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;-1..1&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='p'&gt;[(&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;)]&lt;/span&gt;
    &lt;span class='n'&gt;neighbourCoords&lt;/span&gt; &lt;span class='n'&gt;inject&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;r_mod&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;c_mod&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt; &lt;span class='n'&gt;state&lt;/span&gt;&lt;span class='p'&gt;[[&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;r_mod&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;c_mod&lt;/span&gt;&lt;span class='p'&gt;]]&lt;/span&gt; &lt;span class='o'&gt;+&lt;/span&gt; &lt;span class='n'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;allCellCoords&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Generates a list of tuples representing the coordinates of all the cells&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='n'&gt;permutations&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;0.&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='n'&gt;maxRowIdx&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='mf'&gt;0.&lt;/span&gt;&lt;span class='p'&gt;.&lt;/span&gt;&lt;span class='n'&gt;maxColIdx&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;

  &lt;span class='nv'&gt;allCells&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Generates a list of all the cells in the Grid with associated metadata&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='n'&gt;allCellCoords&lt;/span&gt; &lt;span class='n'&gt;map&lt;/span&gt;&lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
      &lt;span class='nc'&gt;CellData&lt;/span&gt; &lt;span class='kr'&gt;with&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sx'&gt;coords:&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
                    &lt;span class='sx'&gt;numLiveNeighbours:&lt;/span&gt; &lt;span class='n'&gt;countLiveNeighbours&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
                    &lt;span class='sx'&gt;live?:&lt;/span&gt; &lt;span class='n'&gt;state&lt;/span&gt;&lt;span class='p'&gt;[[&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;]]&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mf'&gt;1&lt;/span&gt;&lt;span class='p'&gt;)))&lt;/span&gt;

  &lt;span class='c'&gt;;for output purposes&lt;/span&gt;
  &lt;span class='nv'&gt;asList&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Returns the list of cells as a list of 0s and 1s, with 1 representing a live cell&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nv'&gt;rowsOfCoords&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;allCellCoords&lt;/span&gt; &lt;span class='n'&gt;seq&lt;/span&gt; &lt;span class='n'&gt;sliced&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numCols&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='nv'&gt;cellList&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[]&lt;/span&gt;
    &lt;span class='kr'&gt;while&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;rowsOfCoords&lt;/span&gt; &lt;span class='n'&gt;next?&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;cellList&lt;/span&gt; &lt;span class='o'&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;rowsOfCoords&lt;/span&gt; &lt;span class='n'&gt;next&lt;/span&gt; &lt;span class='n'&gt;map&lt;/span&gt;&lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt; &lt;span class='n'&gt;state&lt;/span&gt;&lt;span class='p'&gt;[[&lt;/span&gt;&lt;span class='n'&gt;row&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;col&lt;/span&gt;&lt;span class='p'&gt;]]))))&lt;/span&gt;

  &lt;span class='nv'&gt;asText&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Returns the list of cells in a pretty ascii art representation&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='nv'&gt;gridContents&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;asList&lt;/span&gt; &lt;span class='n'&gt;map&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;map&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='kr'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mf'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;  &amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='s'&gt;&amp;quot;* &amp;quot;&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt; &lt;span class='n'&gt;join&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='s'&gt;&amp;quot;&lt;/span&gt;&lt;span class='se'&gt;\n&lt;/span&gt;&lt;span class='s'&gt;+-&lt;/span&gt;&lt;span class='p'&gt;#{&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;--&amp;quot;&lt;/span&gt; &lt;span class='o'&gt;*&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numCols&lt;/span&gt;&lt;span class='p'&gt;)}&lt;/span&gt;&lt;span class='s'&gt;+&lt;/span&gt;&lt;span class='se'&gt;\n&lt;/span&gt;&lt;span class='s'&gt;| &lt;/span&gt;&lt;span class='p'&gt;#{&lt;/span&gt;&lt;span class='n'&gt;gridContents&lt;/span&gt; &lt;span class='n'&gt;join&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;|&lt;/span&gt;&lt;span class='se'&gt;\n&lt;/span&gt;&lt;span class='s'&gt;| &amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)}&lt;/span&gt;&lt;span class='s'&gt;|&lt;/span&gt;&lt;span class='se'&gt;\n&lt;/span&gt;&lt;span class='s'&gt;+-&lt;/span&gt;&lt;span class='p'&gt;#{&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;--&amp;quot;&lt;/span&gt; &lt;span class='o'&gt;*&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;numCols&lt;/span&gt;&lt;span class='p'&gt;)}&lt;/span&gt;&lt;span class='s'&gt;+&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Hooking SuperCollider up to Emacs on OS X</title>
   <link href="http://sam.aaron.name/2010/02/09/hooking-supercollider-up-to-emacs-on-os-x.html"/>
   <updated>2010-02-09T00:00:00+00:00</updated>
   <id>http://sam.aaron.name/2010/02/09/hooking-supercollider-up-to-emacs-on-os-x</id>
   <content type="html">&lt;p&gt;I think that &lt;a href='http://supercollider.sourceforge.net/'&gt;SuperCollider&lt;/a&gt; is one of the most exciting music technologies currently available. It&amp;#8217;s super powerful, Open Source, and has even got a separate server and language runtime giving everyone the opportunity to experiment with different approaches. I&amp;#8217;m &lt;a href='http://github.com/rosejn/overtone'&gt;very excited to see where we go with it&lt;/a&gt;, and how I can utilise it with my &lt;a href='http://sam.aaron.name/projects/polynome.html'&gt;Polynome&lt;/a&gt; project.&lt;/p&gt;

&lt;p&gt;However, despite the fact that it comes shipping with a very nice live-coding enabled interface, I use &lt;a href='http://www.gnu.org/software/emacs/'&gt;Emacs&lt;/a&gt;, and well, I love using Emacs for editing text of all kinds. I therefore wanted to have the convenience of the live editing with the powerful text manipulation features that Emacs offers. Luckily there&amp;#8217;s an Emacs mode for SuperCollider and I just finished hooking it all up. Unfortunately I couldn&amp;#8217;t find a nice tutorial for doing it, but I did manage to piece together a process that finally worked for me. It wasn&amp;#8217;t a fun time, so I&amp;#8217;m documenting it here in the hope that someone else might benefit from my pain.&lt;/p&gt;

&lt;h2 id='caveat_and_context'&gt;Caveat and Context&lt;/h2&gt;

&lt;p&gt;Now, I need to issue a major caveat: there&amp;#8217;s lots of moving parts in this situation, and your parts might not even be the same as mine. So, just to be clear - this might not work for you, but hopefully it&amp;#8217;ll get you a major part of the distance. The more similar our setups, the more likely this will help, so for clarity I&amp;#8217;m using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cocoa Emacs 23.1.50 Git 2010-02-09 (the &lt;a href='http://atomized.org/wp-content/cocoa-emacs-nightly/'&gt;latest nightly build&lt;/a&gt; at the time of writing)&lt;/li&gt;

&lt;li&gt;SuperCollider 3.3.1 (the &lt;a href='http://supercollider.sourceforge.net//downloads/'&gt;Mac version&lt;/a&gt;)&lt;/li&gt;

&lt;li&gt;OS X 10.6&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&amp;#8217;m also assuming that you have already installed Emacs and SuperCollider and that you have a basic working knowledge of Emacs configuration, and general UNIX hockery pokery&lt;sup id='fnref:1'&gt;&lt;a href='#fn:1' rel='footnote'&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;h2 id='update_your_path_unixstyle'&gt;Update your Path (UNIX-style)&lt;/h2&gt;

&lt;p&gt;First up open your shell config file (&lt;code&gt;~/.zshrc&lt;/code&gt; in my case) with your favourite editor&lt;sup id='fnref:2'&gt;&lt;a href='#fn:2' rel='footnote'&gt;2&lt;/a&gt;&lt;/sup&gt; and append &lt;code&gt;/Applications/SuperCollider&lt;/code&gt; to your &lt;code&gt;PATH&lt;/code&gt;. Check to see if it worked:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;λ sclang -h
Usage:
   sclang [options] [file..] [-]

Options:
   -d &amp;lt;path&amp;gt;                      Set runtime directory
   -D                             Enter daemon mode (no input)
   -g &amp;lt;memory-growth&amp;gt;[km]         Set heap growth (default 256k)
   -h                             Display this message and exit
   -l &amp;lt;path&amp;gt;                      Set library configuration file
   -m &amp;lt;memory-space&amp;gt;[km]          Set initial heap size (default 2m)
   -r                             Call Main.run on startup
   -s                             Call Main.stop on shutdown
   -u &amp;lt;network-port-number&amp;gt;       Set UDP listening port (default 57120)&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='update_your_path_cocoaemacsstyle'&gt;Update your Path (Cocoa-Emacs-style)&lt;/h2&gt;

&lt;p&gt;Ok, you can do a few things here, particularly because &lt;a href='http://olabini.com/blog/2009/12/path-problem-with-emacs-on-mac-os-x/'&gt;Emacs on OS X does very funky things with the &lt;code&gt;PATH&lt;/code&gt; variable&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In a fresh terminal update the OS X plist version of the &lt;code&gt;PATH&lt;/code&gt; to match your newly updated version: &lt;code&gt;defaults write $HOME/.MacOSX/environment PATH &amp;quot;$PATH&amp;quot;&lt;/code&gt; and restart your machine.&lt;/li&gt;

&lt;li&gt;In your emacs config explicitly create a &lt;code&gt;PATH&lt;/code&gt; variable: &lt;code&gt;(setq path &amp;quot;/Applications/SuperCollider:/rest/of/PATH&amp;quot;)(setenv &amp;quot;PATH&amp;quot; path)&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;Again, in your Emacs config, add SuperCollider to your exec-path: &lt;code&gt;(push &amp;quot;/Applications/SuperCollider&amp;quot; exec-path)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not all of these may be necessary; I did the the last two.&lt;/p&gt;

&lt;h2 id='creating_a_fresh_scclasslibrary'&gt;Creating a Fresh SCClassLibrary&lt;/h2&gt;

&lt;p&gt;Create a new place for a fresh copy of SCClassLibrary:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; mkdir ~/.sclang&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Copy the SCClassLibrary from your SuperCollider install into this new place:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; cp -R /Applications/SuperCollider/SCClassLibrary ~/.sclang&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Also, copy across the plugins directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; cp -R /Applications/SuperCollider/plugins ~/.sclang&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, copy across the scsynth binary (needed to boot the server and make actual sounds):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cp /Applications/SuperCollider/scsynth ~/.sclang&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;/Applications/SuperCollider/README\ SCLang\ OSX&lt;/code&gt; advises you to edit the startup method in &lt;code&gt;~/.sclang/SCClassLibrary/Platform/osx/OSXPlatform.sc&lt;/code&gt;. Open it up and find the startup method. Delete everything from &lt;code&gt;startup {&lt;/code&gt; to the closing &lt;code&gt;}&lt;/code&gt; and replace it with the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;startup {
            if ( this.hasFeature( \emacs ) ) {
                            Document.implementationClass.startup;
            };
            this.loadStartupFiles;
}&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='grab_a_copy_of_scel'&gt;Grab a copy of scel&lt;/h2&gt;

&lt;p&gt;Now we&amp;#8217;re ready to power up Emacs with SuperCollider goodness. I found a &lt;span&gt;copy of scel&lt;/span&gt; on github that contained a few issues that I ironed out in &lt;a href='http://github.com/samaaron/scel'&gt;my own clone&lt;/a&gt;&lt;sup id='fnref:3'&gt;&lt;a href='#fn:3' rel='footnote'&gt;3&lt;/a&gt;&lt;/sup&gt;. Feel free to grab it and add it to your own emacs config. That might be as simple as &lt;a href='http://github.com/samaaron/scel/tarball/master'&gt;downloading the tarball&lt;/a&gt;, or if you manage your config with git (which, by the way, is a great idea) then you could just add it as a submodule. I happen to have based &lt;a href='http://github.com/samaaron/emacs-starter-kit'&gt;my config&lt;/a&gt; on &lt;a href='http://technomancy.us/'&gt;Phil Hagelberg&amp;#8217;s&lt;/a&gt; wonderful &lt;a href='http://github.com/technomancy/emacs-starter-kit'&gt;emacs starter kit&lt;/a&gt;. So this can be as simple as:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd ~/.emacs.d
git init #unless you already manage your .emacs.d with git
git submodule add git://github.com/samaaron/scel.git vendor/supercollider&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='copy_scels_sc_files_to_your_new_scclasslibrary'&gt;Copy scel&amp;#8217;s sc files to your new SCClassLibrary&lt;/h2&gt;

&lt;p&gt;For scel to work correctly it has a number of SC Class files that need to be compiled and loaded when sclang is started. In order to achieve this copy the sc files from scel&amp;#8217;s sc directory into your new SCClassLibrary:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cp -R ~/.emacs.d/vendor/supercollider/sc ~/.sclang/SCClassLibrary/Common/Emacs&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='configure_emacs'&gt;Configure Emacs&lt;/h2&gt;

&lt;p&gt;Now you need to teach emacs about the presence of scel. In your emacs config add the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(add-to-list &amp;#39;load-path &amp;quot;~/.emacs.d/vendor/supercollider/el&amp;quot;)
(require &amp;#39;sclang)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, you need to tell it where to find your SCClassLibrary and other bits and bobs. scel advises you to use &lt;code&gt;M-x sclang-customize&lt;/code&gt;, however I just set the variables by hand:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(custom-set-variables
&amp;#39;(sclang-auto-scroll-post-buffer t)
&amp;#39;(sclang-eval-line-forward nil)
&amp;#39;(sclang-help-path (quote (&amp;quot;/Applications/SuperCollider/Help&amp;quot;)))
&amp;#39;(sclang-runtime-directory &amp;quot;~/.sclang/&amp;quot;))&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='start_up_the_emacs_sc_workbench'&gt;Start up the Emacs SC Workbench&lt;/h2&gt;

&lt;p&gt;OK, well done for making it so far. I&amp;#8217;m praying for you that things went hunky-dory. At this stage I simply restarted Emacs and hit &lt;code&gt;M-x sclang-start&lt;/code&gt; and BOOM entered the SC Workbench. If this seems to work, and you see two buffers, a workbench and a log, try typing &lt;code&gt;&amp;quot;Hello from Emacs&amp;quot;.postln;&lt;/code&gt; in the buffer and with the cursor over it hit &lt;code&gt;M-x
sclang-eval-line&lt;/code&gt;. You should see the message pop up in the log. Finally, try booting the server with &lt;code&gt;M-x sclang-server-start&lt;/code&gt;. You should be good to go.&lt;/p&gt;

&lt;p&gt;Go grab a cup of tea, you&amp;#8217;ve earned it.&lt;/p&gt;
&lt;div class='footnotes'&gt;&lt;hr /&gt;&lt;ol&gt;&lt;li id='fn:1'&gt;
&lt;p&gt;Please note that not all these steps may be necessary. It&amp;#8217;s possible I accidentally slipped in some cargo-culting along the way. Please feel free to let me know if there are smarter and wiser ways of getting this to work!_&lt;/p&gt;
&lt;a href='#fnref:1' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;li id='fn:2'&gt;
&lt;p&gt;Obviously, that&amp;#8217;s Emacs ;-)&lt;/p&gt;
&lt;a href='#fnref:2' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;li id='fn:3'&gt;
&lt;p&gt;I still can&amp;#8217;t faithfully communicate how absolutely amazing github is. The fact that it enabled this process (find library, clone library, fix library, share library) in such a frictionless manner is outstanding.&lt;/p&gt;
&lt;a href='#fnref:3' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Pygmentising Ioke</title>
   <link href="http://sam.aaron.name/2009/12/23/pygmentising-ioke.html"/>
   <updated>2009-12-23T00:00:00+00:00</updated>
   <id>http://sam.aaron.name/2009/12/23/pygmentising-ioke</id>
   <content type="html">&lt;h2 id='introducing_the_iokelexer'&gt;Introducing the IokeLexer&lt;/h2&gt;

&lt;p&gt;It seems I just can&amp;#8217;t stop writing syntax highlighters for &lt;a href='http://ioke.org'&gt;Ioke&lt;/a&gt;. I started with adding support for &lt;a href='http://macromates.com/'&gt;TextMate&lt;/a&gt;, and then basic support for &lt;a href='http://qbnz.com/highlighter/'&gt;Geshi&lt;/a&gt;. Now, as a present for its &lt;a href='http://olabini.com/blog/2009/12/ioke-p-released/'&gt;P release&lt;/a&gt;&lt;sup id='fnref:1'&gt;&lt;a href='#fn:1' rel='footnote'&gt;1&lt;/a&gt;&lt;/sup&gt; I&amp;#8217;ve added &lt;a href='http://pygments.org'&gt;Pygments&lt;/a&gt; to the list:&lt;/p&gt;
&lt;a href='http://github.com/samaaron/ioke/tree/pygments'&gt;
   &lt;img src='/images/posts/pygments/ioke_pygments.png' /&gt;
   &lt;h4&gt;Pygments IokeLexer&lt;/h4&gt;
&lt;/a&gt;
&lt;p&gt;One of the things that has bugged me since Ioke&amp;#8217;s birth is that its incubator, &lt;a href='http://github.com/'&gt;GitHub&lt;/a&gt; has not been able to do the honourable thing and highlight it appropriately. Instead, one of the most exciting languages around at the moment has been treated like dirty plain text.&lt;/p&gt;

&lt;p&gt;Well, hopefully this can change soon. GitHub happens to use Pygments to highlight its source. Therefore I just need to throw my IokeLexer at the Pocoo chaps, hope they include it in the next version of Pygments and then wait for GitHub to upgrade. At least someone doing the hard work of writing the lexer won&amp;#8217;t be the blocker any more&amp;#8230;&lt;/p&gt;

&lt;p&gt;Just to show its glory&lt;sup id='fnref:2'&gt;&lt;a href='#fn:2' rel='footnote'&gt;2&lt;/a&gt;&lt;/sup&gt;, here&amp;#8217;s the introduction example from &lt;a href='http://ioke.org'&gt;http://ioke.org&lt;/a&gt;&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;span class='c'&gt;#!/usr/bin/ioke&lt;/span&gt;

&lt;span class='nv'&gt;Ioke&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nc'&gt;LanguageExperiment&lt;/span&gt; &lt;span class='kr'&gt;with&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
  &lt;span class='sx'&gt;goal:&lt;/span&gt; &lt;span class='ss'&gt;:expressiveness&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
  &lt;span class='sx'&gt;data:&lt;/span&gt; &lt;span class='n'&gt;as&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;code&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
  &lt;span class='sx'&gt;code:&lt;/span&gt; &lt;span class='n'&gt;as&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;data&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
  &lt;span class='sx'&gt;features:&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;
    &lt;span class='ss'&gt;:dynamic&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='ss'&gt;:object_oriented&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='ss'&gt;:prototype_based&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='ss'&gt;:homoiconic&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
    &lt;span class='ss'&gt;:macros&lt;/span&gt;
  &lt;span class='p'&gt;],&lt;/span&gt;
  &lt;span class='sx'&gt;runtimes:&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nc'&gt;JVM&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nc'&gt;CLR&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
  &lt;span class='sx'&gt;inspirations:&lt;/span&gt; &lt;span class='kr'&gt;set&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='nc'&gt;Io&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nc'&gt;Smalltalk&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nc'&gt;Ruby&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='nc'&gt;Lisp&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='nv'&gt;hello&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='nf'&gt;method&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='sd'&gt;&amp;quot;Every example needs a hello world!&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
  &lt;span class='n'&gt;name&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
  &lt;span class='s'&gt;&amp;quot;hello, &lt;/span&gt;&lt;span class='p'&gt;#{&lt;/span&gt;&lt;span class='n'&gt;name&lt;/span&gt;&lt;span class='p'&gt;}&lt;/span&gt;&lt;span class='s'&gt;!&amp;quot;&lt;/span&gt; &lt;span class='k'&gt;println&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='nc'&gt;Ioke&lt;/span&gt; &lt;span class='n'&gt;inspirations&lt;/span&gt; &lt;span class='n'&gt;select&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
  &lt;span class='n'&gt;features&lt;/span&gt; &lt;span class='n'&gt;include?&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='ss'&gt;:object_oriented&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='n'&gt;each&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;x&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;hello&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;x&lt;/span&gt; &lt;span class='n'&gt;name&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 id='lessons_learned'&gt;Lessons Learned&lt;/h2&gt;

&lt;p&gt;OK, so apart from a fairly high number of hours battling with Python regular expressions and Ioke syntax, here&amp;#8217;s a summary of the lessons I learned from this experience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can get pretty far with plain regexps.&lt;/li&gt;

&lt;li&gt;You can get a long way with regexps and stackable contexts.&lt;/li&gt;

&lt;li&gt;Writing approximately correct lexers with regexps can be fun.&lt;/li&gt;

&lt;li&gt;Writing accurate lexers with regexps is for &lt;em&gt;masochists&lt;/em&gt;, seriously.&lt;/li&gt;

&lt;li&gt;Look ahead and behind regexp matchers are truly wonderful.&lt;/li&gt;

&lt;li&gt;Writing a regexp lexer really helps you to hone your regexp skills.&lt;/li&gt;

&lt;li&gt;Pygments is nice software.&lt;/li&gt;

&lt;li&gt;Python people can be a little curt yet are very helpful nevertheless.&lt;/li&gt;

&lt;li&gt;Nothing beats a real lexer for lexing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, there really should be a standard syntax for this kind of thing so when the next syntax highlighting engine comes around we don&amp;#8217;t have to continue to re-invent the wheel.&lt;/p&gt;
&lt;div class='footnotes'&gt;&lt;hr /&gt;&lt;ol&gt;&lt;li id='fn:1'&gt;
&lt;p&gt;Perhaps the P in the strange Ioke version naming scheme stands for Pygments? ;-)&lt;/p&gt;
&lt;a href='#fnref:1' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;li id='fn:2'&gt;
&lt;p&gt;This blog also happens to currently use Pygments to highlight its source.&lt;/p&gt;
&lt;a href='#fnref:2' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Hand Shadows as an Analogy for Understanding Communicative Programming</title>
   <link href="http://sam.aaron.name/2009/11/24/hand-shadows-as-an-analogy-for-understanding-communicative-programming.html"/>
   <updated>2009-11-24T00:00:00+00:00</updated>
   <id>http://sam.aaron.name/2009/11/24/hand-shadows-as-an-analogy-for-understanding-communicative-programming</id>
   <content type="html">&lt;div class='image'&gt;&lt;img src='/images/posts/perception_language_context/tortoise.gif' /&gt;&lt;p&gt;Figure 1. A tortoise hand shadow from Henry Bursill&amp;#8217;s &lt;a href='http://www.gutenberg.org/files/12962/12962-h/12962-h.htm'&gt;Hand Shadows To Be Thrown Upon The Wall.&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Any discussion of &lt;em&gt;communicative programming&lt;/em&gt; requires us to be able to appreciate the individual notions of programming and communication; in fact, we need to be able to consider these notions both separately and in conjunction. However, although there is clearly plentiful discussion within software communities of what constitutes programming, I don’t feel that enough attention is paid to the notion of communication. I believe this is because defining, understanding and discussing the notion of programming as a form of communication is actually really hard.&lt;/p&gt;

&lt;p&gt;So, what do programmers do with hard problems? Divide and conquer! This post is therefore one such attempt to divide the concept of communication into four smaller, more specific concepts: &lt;em&gt;perception&lt;/em&gt;, &lt;em&gt;language&lt;/em&gt;, &lt;em&gt;context&lt;/em&gt; and &lt;em&gt;perspective&lt;/em&gt;&lt;sup id='fnref:1'&gt;&lt;a href='#fn:1' rel='footnote'&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;In order to help me think and reason about these constituent concepts, particularly in relation to programming, I find it very useful to consider the analogy of hand shadows. Let&amp;#8217;s walk through it&amp;#8230;&lt;/p&gt;

&lt;h2 id='perception_the_shadow'&gt;Perception: The Shadow&lt;/h2&gt;

&lt;p&gt;With hand shadows, the objective is to cast a shadow of a particular artefact. For example, consider the example illustrated in Figure 1. The artefact that is perceived in this case is a tortoise. When we communicate, the goal can be seen to transfer information in such a way that the correct perceptions are made clear to your audience. If you want them to perceive a tortoise, then clearly you have to achieve the equivalent of casting a shadow of a tortoise.&lt;/p&gt;
&lt;div class='image'&gt;&lt;img src='/images/posts/perception_language_context/fright.gif' /&gt;&lt;p&gt;Figure 2. A man with a frightful expression.&lt;/p&gt;&lt;/div&gt;
&lt;h2 id='language_the_hand_formation'&gt;Language: The Hand Formation&lt;/h2&gt;

&lt;p&gt;Hand shadows are created by manipulating your hands into a specific shape. You form a three dimensional object which has a specific two dimensional plane which projects a shadow of a given form (which is then perceived as described above).&lt;/p&gt;

&lt;p&gt;In this case, your hands can be seen as language. Note that the relationship between the language and the shadow isn&amp;#8217;t always particularly obvious and clear. In the case of the tortoise in Figure 1 the hand shape is pretty similar to the shadow. However, consider the hand shape used to project the frightful expression in Figure 2, the relationship between hand and shadow isn&amp;#8217;t so obvious in this case.&lt;/p&gt;

&lt;p&gt;Clearly, different combinations of twists and overlaps produce different shapes just like different combinations of syntactic elements produce different sentences.&lt;/p&gt;

&lt;h2 id='shared_context_the_surface'&gt;Shared Context: The Surface&lt;/h2&gt;

&lt;p&gt;The surface is the area onto which the shadow is projected. Usually this surface is a flat wall. However, this need not be the case; the shape and properties of the surface will affect the shadow&amp;#8217;s form. Imagine the same shadow projected onto a wall, then a sphere, how about onto curtains which are fluttering in the wind?&lt;/p&gt;

&lt;p&gt;The surface is the context of the communication; it is the element that is consistent for a given hand shadow show&lt;sup id='fnref:2'&gt;&lt;a href='#fn:2' rel='footnote'&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;h2 id='individual_perspective_the_light_source'&gt;Individual Perspective: The Light Source&lt;/h2&gt;

&lt;p&gt;The fourth component of the analogy is probably the most subtle; it&amp;#8217;s so evasive it&amp;#8217;s not even visible in the illustrations. It&amp;#8217;s the light source which generates the shadows.&lt;/p&gt;

&lt;p&gt;Usually when we create hand shadows we use a fixed light source such as a ceiling-mounted projector. However, this also need not be the case. If our light source is a torch and we start to shine it from different locations, we see a potentially profound effect on the shadow produced given a constant hand formation language; the shadow will stretch and distort. Given the right hand formation or language we might even construct a man that winks if we are to move the light source along a particular path&lt;sup id='fnref:3'&gt;&lt;a href='#fn:3' rel='footnote'&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;In this analogy the light source can be seen as an individual&amp;#8217;s perspective. Each individual that you&amp;#8217;re communicating with will have his or her own unique perspective which will cast it&amp;#8217;s own different shadow given the same hand formation and surface. Understanding that each individual has their own unique perspective which will cause them to have different perceptions of the same language and context is key to understanding Communicative Programming.&lt;/p&gt;

&lt;h2 id='communicative_programming'&gt;Communicative Programming&lt;/h2&gt;

&lt;p&gt;OK, so how does all this relate to programming? To me, one of the clearest messages I get when I spend time considering this analogy is that we shouldn&amp;#8217;t just focus on the code we write. We need to understand that programming is really just another form of communication, albeit a much more formal and process oriented one. It&amp;#8217;s fair to say that predominantly the audience of our communication has been the computer, but we&amp;#8217;re starting to see a growing need to communicate with a wider audience that includes real people - even people that have no knowledge of formal notation of process.&lt;/p&gt;

&lt;p&gt;We need to start off by exploring the domain of the project in order to determine our context. The context contains many things such as shared vocabulary, concepts, ways of expression. Another way to consider it is a set of sensible defaults - a base or foundation from which to start from. If we can get a good grasp of the context and understand the surface we&amp;#8217;re projecting onto, it can reduce the amount of contortion and manipulation we have to do with our language to achieve the desired result. We can start to let the context do some of the work for us.&lt;/p&gt;

&lt;p&gt;Also, once we have understood who our audience is we can then start to understand their perspectives. Having some kind of insight into this will drastically increase our chance of casting the right shadows with our code in the given context so that they we can start to generate a common perception.&lt;/p&gt;

&lt;p&gt;If we manage to get a common perception, all kinds of magic takes place. We are much more capable of having lucid and accurate conversations about the project that all participants are more confident about with much reduced overhead. This is what I refer to as conceptual efficiency. This is the holy grail.&lt;/p&gt;
&lt;div class='footnotes'&gt;&lt;hr /&gt;&lt;ol&gt;&lt;li id='fn:1'&gt;
&lt;p&gt;Now, this decomposition isn&amp;#8217;t perfect and as soon as you start mentioning notions such as perception and perspective you very quickly start sinking deep into a linguistic quagmire and before you know it you&amp;#8217;re drowning in a debate that rapidly tends towards the abstractly absurd. However, if we briefly forgo the pursuit of philosophical perfection and settle on pragmatic usefulness I think that this particular division has didactic value.&lt;/p&gt;
&lt;a href='#fnref:1' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;li id='fn:2'&gt;
&lt;p&gt;Clearly, the context isn&amp;#8217;t a constant and is very much subject to change. However, for the purpose of this analogy it&amp;#8217;s useful to consider that it&amp;#8217;s relatively constant for a given communication exchange.&lt;/p&gt;
&lt;a href='#fnref:2' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;li id='fn:3'&gt;
&lt;p&gt;Ok, my American brethren, you&amp;#8217;re probably already imagining me holding aloft a hot and dangerous burning torch which most certainly would cause an organic animation of the shadows.&lt;/p&gt;
&lt;a href='#fnref:3' rev='footnote'&gt;&amp;#8617;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Cambridge</title>
   <link href="http://sam.aaron.name/2009/11/11/cambridge.html"/>
   <updated>2009-11-11T00:00:00+00:00</updated>
   <id>http://sam.aaron.name/2009/11/11/cambridge</id>
   <content type="html">&lt;p&gt;As some of you may know, Susanna, my wife, has recently started a Ph.D. in Bioethics at Cambridge in the &lt;a href='http://www.ppsis.cam.ac.uk/CFR/'&gt;Centre For Family Research&lt;/a&gt;. I&amp;#8217;m so wonderfully proud of her and it&amp;#8217;s fantastic to see her applying her mind to something that&amp;#8217;s both interesting and challenging for her, yet ultimately valuable for us all as a society in times ravaged by technological progress. However, it was very difficult to deal with the fact that we would be reduced to fleeting weekend visits; islands of togetherness in a silent ocean of isolation.&lt;/p&gt;

&lt;p&gt;So very luckily, &lt;a href='http://innovationfactory.eu'&gt;Innovation Factory&lt;/a&gt; the company I work for, are fantastically understanding about this and have agreed to let me work remotely one week a month from Cambridge. I really feel proud to have such caring colleagues to support me with this arrangement.&lt;/p&gt;

&lt;p&gt;All of this means I spent last week living and working back in England from the (then remarkably pleasant) climes of Cambridge.&lt;/p&gt;

&lt;p&gt;I have only ever briefly visited Cambridge before this stay, so only managed to get a glimpse of the condensed beauty it offers. Even compared to Amsterdam it is a tiny city, and like Amsterdam it offers wonderful architecture, a rich cultural history and an affinity for cycling. Although don&amp;#8217;t get your hopes up too much - this is still strictly an English city and its cycling offerings are only relatively better than those available elsewhere in England - &lt;a href='http://homepage.ntlworld.com/pete.meg/wcc/facility-of-the-month/'&gt;all of which pale in comparison&lt;/a&gt; to the &lt;a href='http://www.hembrow.eu/cycling/photos.html'&gt;facilities here in the Netherlands&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, what I hadn&amp;#8217;t experienced until last week&amp;#8217;s visit were the people Cambridge attracts. Having trained as an academic, I have certainly met my fair share of interesting people endeavouring in a wide range of exciting studies. Cambridge has a wealth of such endeavours. Yet, what sets those I met in Cambridge apart is that they&amp;#8217;re not only &lt;em&gt;interesting&lt;/em&gt;, they&amp;#8217;re &lt;em&gt;interested&lt;/em&gt;. I have some strange and obscure ideas about the communication of process especially when I apply them to the context of music, yet I found no shortage of people readily wanting to listen and discuss them with me. I found this overwhelmingly powerful. Here there were people not only capable of working in their own field but also free and willing to explore other areas and able to combine and contrast concepts from wildly different contexts.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m really looking forward to my next visit and if anyone reading this happens to also be in Cambridge, I&amp;#8217;d love to meet you for a coffee one morning.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Welcome Back</title>
   <link href="http://sam.aaron.name/2009/11/09/welcome-back.html"/>
   <updated>2009-11-09T00:00:00+00:00</updated>
   <id>http://sam.aaron.name/2009/11/09/welcome-back</id>
   <content type="html">&lt;p&gt;For those that have noticed the recent lull in postings, you will be pleased to hear that a normal service will shortly be resumed. I&amp;#8217;ve been very busy working hard on a number of interesting projects that I&amp;#8217;m looking forward to sharing with everyone.&lt;/p&gt;

&lt;p&gt;The theme of this blog will also focus more on my research interests, namely matters concerned with &lt;em&gt;Communicative Programming&lt;/em&gt; - seeing programming as a form of communication. Therefore I&amp;#8217;ll be using this space to explore my ideas on concepts such as &lt;em&gt;Domain Specific Languages&lt;/em&gt;, &lt;em&gt;Polyglot Programming&lt;/em&gt;, &lt;em&gt;Conceptual Efficiency&lt;/em&gt;, and important notions such as perspective, intention context and time.&lt;/p&gt;

&lt;p&gt;You might also note that this blog no longer contains a comments form. This is partly due to technical reasons and mostly due to the huge personal benefits I gain by not having to deal with spam filters and all that paraphernalia. The technical aspects are down to me choosing a static site generator tool (&lt;a href='http://github.com/mojombo/jekyll/'&gt;Jekyll&lt;/a&gt; in this case) which allows me to completely bypass any web site authentication and interfaces, and focus purely on writing text in &lt;a href='http://daringfireball.net/projects/markdown/'&gt;Markdown&lt;/a&gt; with &lt;a href='http://www.gnu.org/software/emacs/'&gt;Emacs&lt;/a&gt; and pushing updates with &lt;a href='http://git-scm.org/'&gt;Git&lt;/a&gt;. Things like this really soothe my mind.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m really looking forward to getting some more of my ideas out and sharing them with you all. Although there is no comment form, I will be accepting comments via email and if I think they&amp;#8217;re helpful and relevant will happily append them to the post they&amp;#8217;re related to. Hopefully the small amount of effort of emailing a comment will help to increase each comment&amp;#8217;s quality - a win for everyone!&lt;/p&gt;

&lt;p&gt;See you back here soon&amp;#8230;&lt;/p&gt;</content>
 </entry>
 

</feed>