<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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" version="2.0">

<channel>
	<title>Ola Bini: Programming Language Synchronicity</title>
	
	<link>http://olabini.com/blog</link>
	<description>Ruby, Java, Lisp, Io, JRuby. Programming language archeology, creation and discovery.</description>
	<pubDate>Thu, 12 Nov 2009 09:23:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/olabini" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>QCon San Francisco, RubyConf and JRubyConf</title>
		<link>http://olabini.com/blog/2009/11/qcon-san-francisco-rubyconf-and-jrubyconf/</link>
		<comments>http://olabini.com/blog/2009/11/qcon-san-francisco-rubyconf-and-jrubyconf/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 09:23:34 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[jruby]]></category>

		<category><![CDATA[jrubyconf]]></category>

		<category><![CDATA[qcon]]></category>

		<category><![CDATA[qcon san francisco]]></category>

		<category><![CDATA[qconsf]]></category>

		<category><![CDATA[rubyconf]]></category>

		<category><![CDATA[san francisco]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=686</guid>
		<description><![CDATA[I&#8217;m gearing up for the next conference stretch. This time it&#8217;s San Francisco next week, and I really hope to see lots of people at these conferences - they are gearing up to be something special.
First QCon San Francisco. Except for JAOO, QCon is the best general developer conference I&#8217;ve ever been to. Go check [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m gearing up for the next conference stretch. This time it&#8217;s San Francisco next week, and I really hope to see lots of people at these conferences - they are gearing up to be something special.</p>
<p>First QCon San Francisco. Except for JAOO, QCon is the best general developer conference I&#8217;ve ever been to. Go check out the schedule at <a href="http://qconsf.com">http://qconsf.com</a>. This year I&#8217;m very excited about doing a full day tutorial about domain specific languages together with Martin Fowler.</p>
<p>I&#8217;m also in charge of the languages track, where I have five people who will talk about their experiences with different languages. This time there will not be much introduction to the languages, but instead experience reports, objective descriptions of what worked, what didn&#8217;t work and how you can improve your chances of success. The languages covered are Scala, Clojure, Ruby, Groovy and F#. Should be great fun.</p>
<p>Hopefully I will have lots of time to see other presentations too. There are many I would love to see. ThoughtWorks also happens to be a sponsor of QCon, so there will be a booth where it&#8217;s a big possibility you can find me or my colleagues.</p>
<p>I will do one day of RubyConf - the Saturday. Funnily enough I haven&#8217;t ever been to RubyConf, so I&#8217;m looking forward to this too.</p>
<p>Finally, the first ever JRubyConf will happen next Sunday. The program looks really interesting. I&#8217;m going to be talking about testing, and also be part of the ending JRuby Core Team panel.</p>
<p>I&#8217;m very excited about these conferences. Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/11/qcon-san-francisco-rubyconf-and-jrubyconf/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A week at Øredev</title>
		<link>http://olabini.com/blog/2009/11/a-week-at-oredev/</link>
		<comments>http://olabini.com/blog/2009/11/a-week-at-oredev/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 11:06:42 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[conferences]]></category>

		<category><![CDATA[malmö]]></category>

		<category><![CDATA[oredev]]></category>

		<category><![CDATA[presentations]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=684</guid>
		<description><![CDATA[I just came back from 10 days in Malmö, Sweden, for the Øredev conference. I&#8217;ve had a great time. Part of that was because I had Stella with me, and she got to meet all my conference-friends, so that was nice.
But a big part of it is basically just the fact that Øredev is an [...]]]></description>
			<content:encoded><![CDATA[<p>I just came back from 10 days in Malmö, Sweden, for the Øredev conference. I&#8217;ve had a great time. Part of that was because I had Stella with me, and she got to meet all my conference-friends, so that was nice.</p>
<p>But a big part of it is basically just the fact that Øredev is an outstanding conference.</p>
<p>Some of my impressions, things I learned and did in no specific order:</p>
<ul>
<li>Hadoop is really cool and I wish I had time to learn more about it. Alex Loddengaard from Cloudera did a very good job introducing this technology in his tutorial. We got to do way fun stuff!</li>
<li>People liked my talk about Ioke - and I was very happy with how it went too.</li>
<li>Stuart Halloway is really good at introducing Clojure - I&#8217;m looking forward to his talk at QCon SF even more now.</li>
<li>Me, Tyler Jennings, Neal Ford, Dan North and Stuart Halloway spent several hours of BoF time to create a new BDD framework for Clojure - this was way fun hacking, interesting from a group management and design perspective and just plain fun. There is a distinct possibility that me and Neal will give a talk at the TW US Away Day about this, if anyone is interested.</li>
<li>Ze Frank is amazing. Really great evening keynote/entertainment.</li>
<li>Niclas Nilsson and Hans Brattberg did a very accurate depiction of common problems and failure modes of pair programming. Good stuff.</li>
<li>Tyler Jennings gave an introduction to Software Craftsmanship. Glad I didn&#8217;t miss this presentation. Very nicely done.</li>
<li>Kevlin Henney did a great presentation about agile modeling. I enjoyed it a lot.</li>
<li>We did a very fun closing panel that was basically just six geeks disagreeing about lots of stuff. I hope everyone else enjoyed it as much as the panel members.</li>
</ul>
<p>Conclusion: Øredev was a great conference, I was honored to get the chance to speak there and I&#8217;ll definitely try to go back next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/11/a-week-at-oredev/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Should languages be multi-lingual?</title>
		<link>http://olabini.com/blog/2009/10/should-languages-be-multi-lingual/</link>
		<comments>http://olabini.com/blog/2009/10/should-languages-be-multi-lingual/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 04:36:22 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[ioke]]></category>

		<category><![CDATA[communication]]></category>

		<category><![CDATA[language]]></category>

		<category><![CDATA[programming language design]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=682</guid>
		<description><![CDATA[I&#8217;m currently sitting in the Beijing ThoughtWorks office, and for some reason language is on my mind&#8230; =)
One of the discussions related to DDD that have turned up several times the last few months at conferences
is how you handle ubiquitous language when your domain is not in English. Since most programming languages are based on [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently sitting in the Beijing ThoughtWorks office, and for some reason language is on my mind&#8230; =)</p>
<p>One of the discussions related to DDD that have turned up several times the last few months at conferences<br />
is how you handle ubiquitous language when your domain is not in English. Since most programming languages are based on English, you end up mixing English and Swedish for example, if you are working with a Swedish domain. Of course, the benefits of working with these concepts in Swedish are very hard to argue against. But the dichotomy between the programming language and the domain language is definitely something that hurts my eyes, so I&#8217;m generally not very fond of that approach.</p>
<p>In fact, I haven&#8217;t heard anyone come up with a good solution to this problem, and this post is not really a solution either.</p>
<p>One of the things I&#8217;ve proposed to make this situation better is to create an external DSL that is fully in the domain language. The implementation of that DSL can then be implemented in English. The main benefit is that there is a clear separation.between the domain language and the programming language. On the other hand, the overhead of creating the DSL and also the complexities involved in translating the domain concepts into programming language concepts can become problematic too.</p>
<p>One interesting idea in Cucumber is the idea that you can easily add new natural languages to write the features in. When it comes to user stories at the level of testing that Cucumber provides, it&#8217;s really important to use the right language. So it got me thinking, could you use the same kind of approach in a general programming language too?</p>
<p>As an experiment I took a small example program for Ioke, and translated it into Mandarin, with simplified Chinese characters. Of course I used Google Translate for this, so the translation is probably not very good, but the end result is still interesting. I&#8217;m not going to try to get this into my blog, so take a look at the file at github instead: <a href="http://github.com/olabini/ioke/blob/master/examples/chinese/account.ik">http://github.com/olabini/ioke/blob/master/examples/chinese/account.ik</a>. As you can see there is nothing in there that even reeks of English. If you don&#8217;t understand Chinese characters it is probably hard to see what&#8217;s happening here. Basically an Account object is created, with a &#8220;transfer&#8221; method and a &#8220;print&#8221; method. Further down, two instances of this Account object is created, some transfers are made, and then the objects are printed. But provided my translation is not too crappy, this code should make sense to someone reading Chinese.</p>
<p>Now, this is actually extremely simple to implement in Ioke, since it relies on several of the features Ioke handles very easily. That everything is a message really helps, and having everything be first class means I can alias methods and things like that without any worry. Obviously your language also need to handle non-ascii identifiers correctly, but that should be standard in this day and age.</p>
<p>When thinking about it, something similar to do this can be created in languages like Lisp, Smalltalk, Factor, Io and Haskell - but most other languages would struggle. If you have keywords in your language, it&#8217;s really a killer - you would need to branch your parser to make it happen.</p>
<p>Of course, this approach only works when you can simply translate from one word to another. If the writing system is right to left, or top to bottom, it&#8217;s much more tricky to create a good translation.</p>
<p>I&#8217;m also not sure if this is actually a really good idea or not. It might be. The other thing I&#8217;ve been thinking about is how to handle multilingual editing. What if you want to be able to switch back and forth between languages? How can you handle identifiers with more than one name. Would you want to?</p>
<p>Lots of unanswered questions here. But it&#8217;s still funny to think about. Communication is the main goal, as usual.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/10/should-languages-be-multi-lingual/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Plan to write big software - and you have already lost</title>
		<link>http://olabini.com/blog/2009/10/plan-to-write-big-software-and-you-have-already-lost/</link>
		<comments>http://olabini.com/blog/2009/10/plan-to-write-big-software-and-you-have-already-lost/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 11:06:22 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[architecture]]></category>

		<category><![CDATA[dynamic]]></category>

		<category><![CDATA[static]]></category>

		<category><![CDATA[typing]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=680</guid>
		<description><![CDATA[This idea came to me as a tweet, but was way too long for a tweet. As it turns out, it&#8217;s also something I&#8217;ve been saying a lot lately, since it&#8217;s the answer to one of the very common arguments against dynamic languages.
The argument usually goes like this: &#8220;Dynamically typed languages are fine for smaller [...]]]></description>
			<content:encoded><![CDATA[<p>This idea came to me as a tweet, but was way too long for a tweet. As it turns out, it&#8217;s also something I&#8217;ve been saying a lot lately, since it&#8217;s the answer to one of the very common arguments against dynamic languages.</p>
<p>The argument usually goes like this: &#8220;Dynamically typed languages are fine for smaller programs and simple web applications, but if you&#8217;re building something big, something that will be several millions of lines of code, you really need all the tools you can only get from a statically typed language&#8221;. Where the statically typed language mentioned is typically Java. The argument is still common enough without any specific language name mentioned though.</p>
<p>Interestingly, there are several problems and fallacies in this seemingly simple argument. I&#8217;m not going to tackle all of them here, but just focus on the beginning. Namely the idea that you are building something big. First of all, how do you know that? Have you done anything like it before? And how do you know it would be big in a different language? How do you know you can&#8217;t decouple the application in such a way you won&#8217;t have to build anything big? There are so many assumptions that can be questioned here. But at the end of the day, my glib answer that summarizes this usually goes something like this:</p>
<p>&#8220;Optimizing for your software project becoming big is the same as optimizing a car to hit a rock wall - you are optimizing for failure&#8221;</p>
<p>I firmly believe that becoming big is really failure. Once you have a big enough project you have lost. It might still work, but the cost will be extreme, and maintaining it will be a large burden too.</p>
<p>This is the reason I like agile. It emphasizes small, working pieces all the time. If you work with code this way, you can&#8217;t really become big. Instead, your project will be forced to be modularized and divided into smaller, more logical components that are highly cohesive and decoupled from each other.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/10/plan-to-write-big-software-and-you-have-already-lost/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ioke sequence support</title>
		<link>http://olabini.com/blog/2009/10/ioke-sequence-support/</link>
		<comments>http://olabini.com/blog/2009/10/ioke-sequence-support/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 15:59:59 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[ioke]]></category>

		<category><![CDATA[iterator]]></category>

		<category><![CDATA[sequence]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=678</guid>
		<description><![CDATA[The last two weeks I&#8217;ve been working on adding external iterators to Ioke. This work is now done and merged, so I thought I&#8217;d just describe it a bit.
But first, why do I need explicit iterators in Ioke? Ruby has gotten by without them for a long time, only implementing a Generator library using continuations, [...]]]></description>
			<content:encoded><![CDATA[<p>The last two weeks I&#8217;ve been working on adding external iterators to Ioke. This work is now done and merged, so I thought I&#8217;d just describe it a bit.</p>
<p>But first, why do I need explicit iterators in Ioke? Ruby has gotten by without them for a long time, only implementing a Generator library using continuations, in the standard library. It&#8217;s pretty nice, since you don&#8217;t really need to do anything explicit to get external iterators from internal ones. Of course, the problem is that it&#8217;s very inefficient to implement them like this. So I decided that Ioke should have an explicit protocol for external iterators. You can implement internal iterators using external ones efficiently, but not the other way around.</p>
<p>The two major objects for this in Ioke is called Sequence and Mixins Sequenced. Sequenced is the mixin that gives you access to several helper methods if you implement the &#8220;seq&#8221; method. If you implement &#8220;seq&#8221; and mixin Sequenced you will also get an &#8220;each&#8221; method and Enumerable. The &#8220;seq&#8221; method is expected to return something that mimics Sequence and has one &#8220;next&#8221; method, and one &#8220;next?&#8221; method. That&#8217;s all. The &#8220;next?&#8221; method returns true if there is another element in the sequence, and &#8220;next&#8221; returns the next one. The protocol is undefined if you call &#8220;next&#8221; when &#8220;next?&#8221; would have returned false.</p>
<p>Sequenced give you an &#8220;each&#8221; method that in addition to the regular each-protocol will also return the result of calling &#8220;seq&#8221; if you don&#8217;t give any arguments to &#8220;each&#8221;.</p>
<p>Except for that, you will get several methods that just call &#8220;seq&#8221; and calls the same method on the result of that. These methods are: &#8220;mapped&#8221;, &#8220;collected&#8221;, &#8220;filtered&#8221;, &#8220;selected&#8221;, &#8220;grepped&#8221;, &#8220;zipped&#8221;, &#8220;dropped&#8221;, &#8220;droppedWhile&#8221; and &#8220;rejected&#8221;. These methods are also the same as exist on Sequence. These methods return new sequences that implement the same behavior as the methods with similar names on Enumerable.</p>
<p>Finally, Sequence also mimics Mixin Enumerable. Once you call one of the Enumerable-methods, the whole sequence will be realized, or as much as is necessary to give an answer. A small example of how you could use it:</p>
<pre class="code">(1..100000000) mapped(x, x*x) filtered(x, x % 3 == 0) takeWhile( &lt; 10000 )</pre>
<p>This example creates a range from 1 to 100,000,000 and finds all the squares that are less than 10,000 an d that is evenly dividable by 3.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/10/ioke-sequence-support/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JAOO - A great week in Århus</title>
		<link>http://olabini.com/blog/2009/10/jaoo-a-great-week-in-arhus/</link>
		<comments>http://olabini.com/blog/2009/10/jaoo-a-great-week-in-arhus/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 09:54:16 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[aarhus]]></category>

		<category><![CDATA[conferences]]></category>

		<category><![CDATA[jaoo]]></category>

		<category><![CDATA[presentations]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=676</guid>
		<description><![CDATA[Late this Saturday I came home from a hard week in Århus, Denmark. Of course, it&#8217;s been a great week but it is definitely a change coming back home after it.
JAOO this year was great, just as you can always expect. What makes JAOO so fantastic is the combination of extraordinary presentations of all kinds, [...]]]></description>
			<content:encoded><![CDATA[<p>Late this Saturday I came home from a hard week in Århus, Denmark. Of course, it&#8217;s been a great week but it is definitely a change coming back home after it.</p>
<p>JAOO this year was great, just as you can always expect. What makes JAOO so fantastic is the combination of extraordinary presentations of all kinds, together with the socializing with all the fantastic speakers, and hanging out with the JAOO crew. All in all it&#8217;s a lovely time, and I never get enough sleep for some reason.</p>
<p>This year ThoughtWorks was there in force - we had about 12-14 people there, and 8 of us presenting. It&#8217;s always fun to be surrounded with TW people.</p>
<p>I&#8217;ll not go through the whole schedule, but I do want to share some of my favorites.</p>
<p>Rich Hickey was there, presenting about different aspects relating to Clojure and concurrency. As usual he was excellent, and I heard many good comments about both his presentations.</p>
<p>Intentional Software presented their Language Workbench, which I&#8217;ve been playing around with for some time. The presentation generated substantial shock-and-awe from the audience, which was fun to see.</p>
<p>The Tuesday featured the concurrency track, where I spent most my time. The whole track was very good, but it was capped off by Simon Peyton-Jones excellent talk about Nested Data Parallelism in Haskell, a very good presentation that meshed well with my interests. Simon is also a highly entertaining presenter. All in all, that presentation was definitely my favorite one this year.</p>
<p>On Wednesday the two presentations that stands out in my mind was Aino&#8217;s about design patterns - interspersed with dating design patterns. Very funny. And the other was by my colleague Richard Durnall, talking about lean.</p>
<p>Very nice stuff, all in all. Martin Fowler, Neal Ford and Rebecca Parsons gave another version of their DSL tutorial the following day. It&#8217;s amazing how much this tutorial have evolved since I first saw it.</p>
<p>On the Friday I saw parts of Sam Aaron&#8217;s Advanced Ruby tutorial; it&#8217;s good. I also gave my tutorial, which went fairly well too.</p>
<p>And that&#8217;s JAOO in a nutshell. A great week. It&#8217;s weird to come back after such an intense time.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/10/jaoo-a-great-week-in-arhus/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RubyFoo</title>
		<link>http://olabini.com/blog/2009/10/rubyfoo/</link>
		<comments>http://olabini.com/blog/2009/10/rubyfoo/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 00:57:41 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[conference]]></category>

		<category><![CDATA[london]]></category>

		<category><![CDATA[matz]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=674</guid>
		<description><![CDATA[I spent this Friday and Saturday in London at the RubyFoo conference, organized by Trifork. RubyFoo is a small pre-conference to the larger JAOO conference. As you might expect, it&#8217;s focused on Ruby, and it&#8217;s quite small. On the friday we were about 50 people, and on Saturday about 40. The small amount of people [...]]]></description>
			<content:encoded><![CDATA[<p>I spent this Friday and Saturday in London at the RubyFoo conference, organized by Trifork. RubyFoo is a small pre-conference to the larger JAOO conference. As you might expect, it&#8217;s focused on Ruby, and it&#8217;s quite small. On the friday we were about 50 people, and on Saturday about 40. The small amount of people and the fact that all presentations were in the same track made it much easier to network and communicate with people. I liked the focus this gave to the conference, and it was also an excellent opportunity to meet new people and get new ideas.</p>
<p>On the Friday there were five presentations, and on the Saturday it was an open spaces. The five presentations were all focused around the area of communicative programming. I talked about JRuby and did several demonstrations of how JRuby can be used to call out to different languages. My examples included talking to Clojure, Erlang and Haskell.</p>
<p>After me, Aslak Hellesøy talked about Cucumber and how Cucumber supports lots of different programming languages. Very cool. Aslak always give good presentations.</p>
<p>We then had lunch, and then Sam Aaron gave an interesting talk about communicative programming, and the essence of what we are doing. Very cerebral, definitely something that sparked lots of thoughts in peoples minds.</p>
<p>Adam Wiggins gave a talk about Heruko. I haven&#8217;t actually tried Heruko yet, but it looks very cool.</p>
<p>Finally, Matz gave a talk about the different styles of programming in Ruby, tied in with his history of creating Ruby and what the inspirations were. Very nice.</p>
<p>On the Saturday my colleague Dan North facilitated the open spaces discussions. I gave a 30 minute talk about Ioke - people seemed to enjoy it. After that Dan North, me, Aslak and a few others had a discussion about static versus dynamic typing.</p>
<p>After lunch I held a discussion about Ruby 1.9, getting some ideas why people weren&#8217;t using it, and what problems the people using it had encountered.</p>
<p>Finally, me, Aslak and Sam sat down to add Ioke support to Cucumber. This went really well - and I liked pairing with Aslak. Sadly I couldn&#8217;t stay until we were done, but Aslak and the others continued while I was heading out to the airport.</p>
<p>All in all, RubyFoo was a great conference, and I hope they can keep the same size the next time. 50 people were really a great size, and I liked the discussions we had.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/10/rubyfoo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A new parser for Ioke</title>
		<link>http://olabini.com/blog/2009/09/a-new-parser-for-ioke/</link>
		<comments>http://olabini.com/blog/2009/09/a-new-parser-for-ioke/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 09:32:00 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[ioke]]></category>

		<category><![CDATA[antlr]]></category>

		<category><![CDATA[parser generators]]></category>

		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=672</guid>
		<description><![CDATA[Last week I finally bit the bullet and rewrote the Ioke parser. I&#8217;m pretty happy about the end result actually, but it does involve moving away from Antlr&#8217;s as a parser generator. In fact, the new parser is handwritten - and as such goes against my general opinion to generate everything possible. I would like [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I finally bit the bullet and rewrote the Ioke parser. I&#8217;m pretty happy about the end result actually, but it does involve moving away from Antlr&#8217;s as a parser generator. In fact, the new parser is handwritten - and as such goes against my general opinion to generate everything possible. I would like to quickly take a look at the reasons for doing this and also what the new parser will give Ioke.</p>
<p>For reference, the way the parser used to work was that the Antlr generated lexer and parser gave the Ioke runtime an Antlr Tree structure. This tree structure was then walked and transformed into chained Message&#8217;s, which is the AST that Ioke uses internally. Several other things were also done at this stage, including separating message chains on comma-borders. Most significantly the processing to put together interpolated strings and regular expressions happened at this stage. Sadly, the code to handle all that was complex, ugly, slow and frail. After this stage, operator shuffling happened. That part is still the same.</p>
<p>There were several problems I wanted to solve, but the main one was the ugliness of the algorithm. It wasn&#8217;t clear from the parser how an interpolated expression mapped into the AST, and the generated code added several complications that frankly weren&#8217;t necessary.</p>
<p>Ioke is a language with an extremely simple base syntax. It is only slightly more complicated than the typical Lisp parser, and there is almost no parser-level productions needed. So the new parser does away with the lexer/parser distinction and does everything in one pass. There is no need for lookahead at the token level, so this turns out to be a clear win. The code is actually much simpler now, and the Message AST is created inline in the new parser. When it comes to interpolation, instead of the semantic predicates and global stacks I had to use in the Antlr parser, I just do the obvious recursive interpolation. The code is simple to understand and quite efficient too.</p>
<p>At the end of the day, I did expect to see some performance improvements too. They turned out to be substantial. Parsing is about 2.5 times faster, and startup speed has improved by about 30%. The distribution size will be substantially smaller since I don&#8217;t need to ship the Antlr runtime libraries. And building the project is also much faster.</p>
<p>But the real gain is actually in maintainability of the code. It will be much easier for me to extend the parser now. I can do nice things to make the syntax more open ended and more powerful in ways that would be very inconvenient in Antlr. The error messages are much better since I have control over all the error states. In fact, there are only 13 distinct error messages in the new parser, and they are all very clear on what has gone wrong - I never did the work in the old parser to support that, but I get that almost for free in the new one.</p>
<p>Another thing I&#8217;ve been considering is to add reader macros to Ioke - and that would also have been quite painful with the Antlr parser generator. So all in all I&#8217;m very happy about the new parser, and I think it will definitely make it easier for the project going forward.</p>
<p>This blog post is in no way saying that Antlr is bad in any way. I like Antlr a lot - it&#8217;s a great tool. But it just wasn&#8217;t the right tool for Ioke&#8217;s syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/09/a-new-parser-for-ioke/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ThoughtWorks Seminar and Tutorial in Stockholm</title>
		<link>http://olabini.com/blog/2009/09/thoughtworks-seminar-and-tutorial-in-stockholm/</link>
		<comments>http://olabini.com/blog/2009/09/thoughtworks-seminar-and-tutorial-in-stockholm/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 18:05:40 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[domain specific languages]]></category>

		<category><![CDATA[dsls]]></category>

		<category><![CDATA[martin fowler]]></category>

		<category><![CDATA[seminar]]></category>

		<category><![CDATA[stockholm]]></category>

		<category><![CDATA[thoughtworks]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=670</guid>
		<description><![CDATA[September 29th, ThoughtWorks will hold a day of seminars and a tutorial in Stockholm, Sweden. The seminars are free. I will talk about alternative languages, Martin Fowler will talk about software design in the 21st century, and another ThoughtWorks speaker will talk about DSLs for functional testing.
The tutorial is a half day tutorial given by [...]]]></description>
			<content:encoded><![CDATA[<p>September 29th, ThoughtWorks will hold a day of seminars and a tutorial in Stockholm, Sweden. The seminars are free. I will talk about alternative languages, Martin Fowler will talk about software design in the 21st century, and another ThoughtWorks speaker will talk about DSLs for functional testing.</p>
<p>The tutorial is a half day tutorial given by Martin Fowler and me. We will talk about domain specific languages.</p>
<p>If this sounds interesting, go in and find more information and register <a href="http://connect.thoughtworks.com/g/?K6FF7SJCYQ">here</a>. Hurry, though - places are limited!</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/09/thoughtworks-seminar-and-tutorial-in-stockholm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tutorial at JAOO about JRuby testing</title>
		<link>http://olabini.com/blog/2009/09/tutorial-at-jaoo-about-jruby-testing/</link>
		<comments>http://olabini.com/blog/2009/09/tutorial-at-jaoo-about-jruby-testing/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 15:18:20 +0000</pubDate>
		<dc:creator>Ola Bini</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[jaoo]]></category>

		<category><![CDATA[jruby]]></category>

		<category><![CDATA[testing]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://olabini.com/blog/?p=668</guid>
		<description><![CDATA[Just thought I&#8217;d mention it here - I&#8217;m at JAOO this year and will give a tutorial about testing Java with JRuby. I will be a great tutorial and I hope to see many of you there.
]]></description>
			<content:encoded><![CDATA[<p>Just thought I&#8217;d mention it here - I&#8217;m at JAOO this year and will give a tutorial about testing Java with JRuby. I will be a great tutorial and I hope to see many of you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://olabini.com/blog/2009/09/tutorial-at-jaoo-about-jruby-testing/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
