<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2899949359119303370</id><updated>2011-04-22T07:45:33.617+09:00</updated><category term='scala'/><category term='parsing'/><category term='research'/><category term='rant'/><category term='programming'/><title type='text'>Muted Alarm</title><subtitle type='html'>A blog for programming, design, and technical thought. Mostly in Scala.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mutedalarm.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mutedalarm.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Brian Burg</name><uri>http://www.blogger.com/profile/13128758853001011657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_s58rbD2_LAw/SMIur8cHEkI/AAAAAAAAAAM/TNzwwnjRl_s/S220/brick+profile.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2899949359119303370.post-13486561685074640</id><published>2009-04-10T17:14:00.004+09:00</published><updated>2009-04-10T17:38:43.677+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='parsing'/><category scheme='http://www.blogger.com/atom/ns#' term='scala'/><title type='text'>Exploring Parser Combinators in Scala</title><content type='html'>One of the nice features of Scala is that it has very flexible syntax. This is especially nice when implementing libraries with the desire to cut down on the syntactical noise that makes doing anything in Java painful on the hands.  The most simple example of this is infix operators.  Most operators are left associative, and are automatically translated into the corresponding method call. For example, 1 + 2 desugars into 1.+(2).&lt;br /&gt;&lt;br /&gt;This combines well with parser combinators, another nice feature of Scala which enables domain-specific languages to be syntactically designed in Scala as well as handled on the backend.  Parser combinators are theoretically underpinned by functional programming concepts, and are only possible in Scala due to its support of both functional and object-oriented language paradigms.  Also notable is that the parser combinator libraries are libraries; no special compiler support was added just for a parsing library (despite the terse syntax).&lt;br /&gt;&lt;br /&gt;Below are some blogs I've read with nice examples of languages cooked up with this functionality:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://blog.fogus.me/2009/03/26/baysick-a-scala-dsl-implementing-basic/"&gt;Baysick&lt;/a&gt; is a Scala DSL which approximates a small subset of BASIC.  It is not fully compliant due to a few limitations of Scala's syntax, but nevertheless it is visually impressive. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://debasishg.blogspot.com/2008/04/external-dsls-made-easy-with-scala.html"&gt;Debashish Ghosh implemented&lt;/a&gt; a simple buy/sell order language to demonstrate the simplication possible for not-so-savvy traders, or parsing a human-readable format.  What's more, his post also has good background on parser combinators themselves, and shows how to command the Scala-based parser to create POJO's (plain old Java objects) as a result of the parse, which can then be used by client Java applications.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Unfortunately the &lt;a href="http://www.scala-lang.org/docu/files/api/index.html"&gt;API documentation&lt;/a&gt; for Scala's parser combinators is difficult to traverse due to the complicated class/trait hierarchy.  I recommend the parser combinator technical report/mini-book written by Adriaan Moors. His &lt;a href="http://www.cs.kuleuven.be/%7Eadriaan/?q=sparsec"&gt;page for the report is here&lt;/a&gt;, but the document linked there does not seem to be available.  I was able to find &lt;a href="http://kinded-scala.googlecode.com/svn/trunk/papers/sparsec/sparsec.pdf"&gt;the same document here&lt;/a&gt; on a related Google Code page.&lt;br /&gt;&lt;br /&gt;Soon, I will relate my experiences of using the parser combinator library in my own project.  I doubt it will be as complicated as some examples in the guide mentioned above (won't need a Context or scannerless parser) but hopefully some lessons are learned anyway.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2899949359119303370-13486561685074640?l=mutedalarm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mutedalarm.blogspot.com/feeds/13486561685074640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mutedalarm.blogspot.com/2009/04/exploring-parser-combinators-in-scala.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/13486561685074640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/13486561685074640'/><link rel='alternate' type='text/html' href='http://mutedalarm.blogspot.com/2009/04/exploring-parser-combinators-in-scala.html' title='Exploring Parser Combinators in Scala'/><author><name>Brian Burg</name><uri>http://www.blogger.com/profile/13128758853001011657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_s58rbD2_LAw/SMIur8cHEkI/AAAAAAAAAAM/TNzwwnjRl_s/S220/brick+profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2899949359119303370.post-9149121132973773498</id><published>2009-04-07T11:11:00.000+09:00</published><updated>2009-04-10T15:00:18.992+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='scala'/><title type='text'>Who says static typing has to be ceremonious?</title><content type='html'>I refer you to a &lt;a href="http://ikaisays.com/2009/04/04/using-pattern-matching-with-regular-expressions-in-scala/"&gt;blog post by Ikai Lan&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;When you combine pattern matching, extractors, lazy file streams, and other sugar, things can get pretty silly pretty fast :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2899949359119303370-9149121132973773498?l=mutedalarm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mutedalarm.blogspot.com/feeds/9149121132973773498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mutedalarm.blogspot.com/2009/04/who-says-static-typing-has-to-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/9149121132973773498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/9149121132973773498'/><link rel='alternate' type='text/html' href='http://mutedalarm.blogspot.com/2009/04/who-says-static-typing-has-to-be.html' title='Who says static typing has to be ceremonious?'/><author><name>Brian Burg</name><uri>http://www.blogger.com/profile/13128758853001011657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_s58rbD2_LAw/SMIur8cHEkI/AAAAAAAAAAM/TNzwwnjRl_s/S220/brick+profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2899949359119303370.post-2196530137764662172</id><published>2009-04-03T09:24:00.000+09:00</published><updated>2009-04-10T15:00:18.992+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Types are to Python as animals are to ___</title><content type='html'>I'm thinking clouds in the sky in the above one.  Which is why the following &lt;a href="http://stackoverflow.com/questions/707674/how-to-compare-type-of-an-object-in-python"&gt;StackOverflow thread&lt;/a&gt; is infinitely ironic.  What it really comes down to is, the type of an object in Python may or may not correspond to the method interface it implements.&lt;br /&gt;&lt;br /&gt;When in Rome, do as the Romans.  Thus, when in Python you should only care about method interfaces.  If you need to know whether something is a duck and the quack isn't enough, you are doing something wrong (or expecting too much from the poor duck)!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2899949359119303370-2196530137764662172?l=mutedalarm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mutedalarm.blogspot.com/feeds/2196530137764662172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mutedalarm.blogspot.com/2009/04/types-are-to-python-as-animals-are-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/2196530137764662172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/2196530137764662172'/><link rel='alternate' type='text/html' href='http://mutedalarm.blogspot.com/2009/04/types-are-to-python-as-animals-are-to.html' title='Types are to Python as animals are to ___'/><author><name>Brian Burg</name><uri>http://www.blogger.com/profile/13128758853001011657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_s58rbD2_LAw/SMIur8cHEkI/AAAAAAAAAAM/TNzwwnjRl_s/S220/brick+profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2899949359119303370.post-5723515759957030420</id><published>2009-03-30T17:35:00.000+09:00</published><updated>2009-04-10T15:00:18.993+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='research'/><title type='text'>Making sense of the (functional) world</title><content type='html'>I stumbled across the original &lt;a href="http://library.readscheme.org/page1.html"&gt;"Lambda the Ultimate" papers by Sussman and Steele&lt;/a&gt; and the effect produced from reading them is profound. It is as if someone suddenly lit a huge halogen floodlight into an enormous black cavern. :)&lt;br /&gt;&lt;br /&gt;More seriously, several topics such as continuations, continuation-passing-style (CPS) and the compilation of functional languages make about 100 times more sense now.  Hopefully I can get back on track and read what I was *supposed* to be reading before the research meeting on Wednesday..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2899949359119303370-5723515759957030420?l=mutedalarm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mutedalarm.blogspot.com/feeds/5723515759957030420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mutedalarm.blogspot.com/2009/03/making-sense-of-functional-world.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/5723515759957030420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/5723515759957030420'/><link rel='alternate' type='text/html' href='http://mutedalarm.blogspot.com/2009/03/making-sense-of-functional-world.html' title='Making sense of the (functional) world'/><author><name>Brian Burg</name><uri>http://www.blogger.com/profile/13128758853001011657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_s58rbD2_LAw/SMIur8cHEkI/AAAAAAAAAAM/TNzwwnjRl_s/S220/brick+profile.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2899949359119303370.post-2973918350065466665</id><published>2008-11-26T14:29:00.000+09:00</published><updated>2009-04-10T15:02:56.243+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='research'/><title type='text'>Simple explanation of gradual typing</title><content type='html'>I found a page on Jeremy Siek's website that simply explains the basics of gradual type systems. So if you know just a little bit about programming, you can get an idea of what I may be working on in the next few months.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ece-www.colorado.edu/%7Esiek/gradualtyping.html"&gt;http://ece-www.colorado.edu/~siek/gradualtyping.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2899949359119303370-2973918350065466665?l=mutedalarm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mutedalarm.blogspot.com/feeds/2973918350065466665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mutedalarm.blogspot.com/2008/11/simple-explanation-of-gradual-typing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/2973918350065466665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2899949359119303370/posts/default/2973918350065466665'/><link rel='alternate' type='text/html' href='http://mutedalarm.blogspot.com/2008/11/simple-explanation-of-gradual-typing.html' title='Simple explanation of gradual typing'/><author><name>Brian Burg</name><uri>http://www.blogger.com/profile/13128758853001011657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_s58rbD2_LAw/SMIur8cHEkI/AAAAAAAAAAM/TNzwwnjRl_s/S220/brick+profile.jpg'/></author><thr:total>0</thr:total></entry></feed>
