Archive for the 'scala' Category

Parser Combinators, Scala, Haskell

Topic: monads, parser combinators, scala, haskell, CS| No Comments »

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