Compiler Construction with Ruby and Racc at RubyConf

RubyConf 2012 logoWell hey there, buddy!

As you may remember from my previous post, I’m a bit of a programming language nerd wannabe. That hasn’t changed, but I wanted to share with you a nice little tool for messing around with compiler construction in Ruby.

I write lots of little toy, throwaway compilers. It’s a sort of sick hobby. Anyway, a few months ago I decided that I was tired of fighting with C, Flex and Bison every time I decided to try something new. I’m not quite sure if it was the crappy string handling, the memory management, the fact that I usually found myself writing Python code to generate my C AST, the Makefiles … whatever it was, something in my little geek brain snapped.

So I went looking for something that would provide me with a way to work with EBNF-ish grammars without the baggage that comes with C & Flex/Bison. Ultimately, that “something” was Racc. I kind of fell in love with it as a way to really just thrash around with crazy little ideas. Better still, it wasn’t so far removed from Bison/Yacc that if I decided I did want to make something more of it (FSM forbid) it would likely be a relatively easy port.

Now I hope to impose my hobbyisms upon you, dear victim reader / RubyConf attendee! Come along to my presentation Rapid Programming Language Prototypes with Ruby and Racc on Saturday 3rd @ 3:30pm in Room C, and be dazzled by the awesome of Ruby and Racc. 🙂

tom@newrelic.com'

View posts by .

Interested in writing for New Relic Blog? Send us a pitch!