Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 6,026 | Comments: 44,842

filter by tags archive

DSLs in Boo, and a look back

time to read 2 min | 268 words

About 6 years ago, I started writing the DSLs in Boo book, it came out in 2010, and today I got an email saying that this is now officially out of print. It was never a hugely popular book, so I’m not really surprised, but it really got me thinking.

I got to build several DSLs for production during the time I was writing this book, but afterward, I pretty much pivoted hard to RavenDB, and didn’t do much with DSLs since. However, the knowledge acquired during the writing of this book has actually been quite helpful when writing RavenDB itself.

I’m not talking about the design aspects of writing a DSLs, or the business decisions that are involved with that, although that is certainly a factor. I’m talking about the actual technical details of working with a language, a parser, etc.

In fact, you won’t see that, probably, but RavenDB indexes and transformers are actually DSLs, and they use a lot of the techniques that I talk about in the book. We start with something that looks like a C# code, but what ends up running is actually something that is far different. The Linq provider, too, rely heavily on those same techniques. We show you one thing but actually do something quite different under the cover.

It is interesting to see how the actual design of RavenDB was influenced by what my own history and the choices I made in various places. If I wasn’t well versed with abusing a language, I would probably have to go with something like CouchDB’s views, for example.



This book was a great inspiration for me, I have been using Boo for a long time but only after reading DSLs in Boo I have realized the potential of Boo and its flexible compiler. I've created tens of DSLs since that time and when approaching a new task I frequently start with imagining a DSL for it first. However, I'm quite worried about the Boo project, it's not very active and interest in it seems to be diminishing. Which is quite strange because it's imho one of the most valuable .Net tools.


It would be really great if you had included some actual examples of what you were talking about. Maybe in future posts?

Ayende Rahien

Josh, I gave the example of Linq indexes and DSLs. Others are the safety limits, to avoid production issues. The internal structure of RavenDB, etc.


I'm just starting a new DSL and pulled this book off my shelf last week to refresh my memory. Thanks for writing a great reference.


@Rafal, do you have any IT related blog or Twitter account where you share your thoughts? If so, can I receive it? :)


@Rafal, do you have any IT related blog or Twitter account where you share your thoughts? If so, can I receive it? :)

Pop Catalin

Great Book, thanks for that!. It helped me allot to get started implementing a DSL for a large project using Boo. And Boo itself it's a language that is decades ahead of mainstream languages like C#.

João Bragança

If you hard to start fresh tomorrow on a DSL engine for the CLR, would you base it on Boo or something else?

Ayende Rahien

João, I would probably go with Boo to start with, because I really like the syntax. Alternatively, I might create my own syntax & parser, then plug this into a Roslyn AST and generate code that way.

Howard van Rooijen

I thoroughly enjoyed "DSLs in Boo"; it made me think about using code in an entirely different way than I had used it before. I'd be fascinated to know you thoughts on how you could use Roslyn to achieve the same sort of functionality achieved with Boo.

Ayende Rahien

Howard, Basically, that depend on the kind of language you want. If you are willing to go to the bother of either C#'s like language, or build your own parser, that is quite easy. You need to build the actual Roslyn AST tree, then just compile it.

Comment preview

Comments have been closed on this topic.


No future posts left, oh my!


  1. Technical observations from my wife (3):
    13 Nov 2015 - Production issues
  2. Production postmortem (13):
    13 Nov 2015 - The case of the “it is slow on that machine (only)”
  3. Speaking (5):
    09 Nov 2015 - Community talk in Kiev, Ukraine–What does it take to be a good developer
  4. Find the bug (5):
    11 Sep 2015 - The concurrent memory buster
  5. Buffer allocation strategies (3):
    09 Sep 2015 - Bad usage patterns
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats