Archive for August 13th, 2007

Parser Combinators, Scala, Haskell

Monday, August 13th, 2007

Earlier today, thanks to Itay, I was introduced to the idea of parser combinators in conjunction with a discussion we were having. From what I understood (hence not misrepresenting anyone), he knew of parser combinators from Scala, where they are a part of the standard library, of course my customary Google search of new terms led me to documentation for the Haskell Parser Generator, which in itself is mildly different from the Scala equivalent, understandably so seeing how the principles behind both languages differ. I have been trying to get a better grasp of both languages for a while, and though I have been doing this for widely divergent reasons (Haskell - strong links to math, the cool factor, reading a decent paper on monads on the recommendation of a couple of people, and not knowing how to use it, Scala - lots of chatter about it coming my way from Itay, the entire actor model, a bunch of interesting documentation), I have been failing miserably, since while I know what both involve to a first approximation, not writing any large chunk of code in either implies not being used to the idiosyncrasies of either, and not being able to parse the language well in one's head (it took me a 40 minute train ride home to figure out to a first approximation what some of the code in here means). So I am going to try learning parser combinators in one of the languages (possibly Scala since it would gel with something I am doing with Itay), and then eventually convert what I learn in one into the other, and hope that works. Either ways from what little I read of parser combinators they seem like an interesting model for parsers, at least the scala implementation seems to be fairly nifty in terms of being literally readable as a grammar.

Panda

STM, Topology

Monday, August 13th, 2007

This is one of two or three short posts I will be making today, and will as such probably never be seen as a result of not actually having visible text for very long. A casual glance through programming.reddit.com will show a recent surge in interest in Software Transactional Memory. Having missed most of the concurrency train (I still have to read the Erlang book), I am pretty amused by what all this concurrency means. I think the processes themselves are fairly interesting, but I claim to be entirely inept at it, I understand what STM means, what it entails, I haven't used it. However what does interest me about STM is a couple of papers written by Herlihy (there are others, I just happened to run across these while going through what Brown professors did) relating concurrency to topology. The papers are freely available on the website, and while I am still working on actually reading them, I am hoping posting here will shame me into actually completing this eventually. On the positive side, trying to parse the papers has meant having to read and understand a book on point set topology, one of the things I did in the hazy days of my sophomore year and have forgotten fairly successfully. Of course seeing as parsing math texts themselves takes a while, and paper and pen, this is slow going.

Panda