Pittsburgh Ruby: Building a Compiler in JRuby
Tonight I attended the meeting of the Pittsburgh Ruby group at Vivisimo. It’s been a year now since I first discovered the Pittsburgh Ruby group and finally attended my first meeting as an initial non-Rubyist on November 4, 2010, at the encouragement of Bruce, who said it was a friendly group.
Chris Umbel gave a talk, “Building a compiler in JRuby”. Basically, he was inspired by Ian Dee’s work with a toy language Thnad at JRubyConf 2011 to illustrate writing a simple compiler, and decided to do similarly, inventing “sucklang”, a “language that sucks”.
The room was totally packed! Clearly there was great interest in this topic.
The main tools used were:
- Parslet, a parser combinator library for Ruby
- Bitescript, a Java bytecode generation library for Ruby
The interesting thing to me was how both these tools involved internal domain-specific languages (DSLs), really showcasing how easy it is to create internal DSLs for Ruby. The down side, of course, is that not having been familiar with these tools before the talk, I was totally bewildered as Chris sped through overviews of them! I did make a note to investigate the libraries later.
It is definitely cool that with these DSLs, you can get up and going quickly to implement a toy language.comments powered by Disqus