Ruby Training and Ruby on Rails Training exclusively

Using Ruby to Create Domain-Specific Languages


This talk, given to the Ann Arbor Computer Society (AACS) on August 6, 2008. It went about 100 minutes covering just over 100 slides.

Members of the AACS come from a wide variety of computing backgrounds. Polling the audience revealed that a couple members have actively programmed in Ruby and a few have dabbled with it. But for the majority this talk would serve as an introduction to the Ruby language.


Domain-specific languages (DSLs) are tailored to solve a particular problem. They're designed around a domain, focusing on abstractions specific to that domain, which makes them distinct from general purpose languages. Specifications written in a DSL can often be read, understood, and verified as correct by a domain expert who is not a programmer. And sometime DSLs are designed around the goal of enabling domain experts to write their own specifications.

In this talk we will look at the features of Ruby that lend themselves to the creation of domain-specific languages, some example DSLs, and examples of the underlying Ruby code.

Due to the varied background of the audience members, we start by focusing on the Ruby programming language, specifically those features that either set it apart from other programming languages or those that will appear in the DSL portion of the talk.