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,125 | Comments: 45,486

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.


  1. The design of RavenDB 4.0: Physically segregating collections - one day from now
  2. RavenDB 3.5 Whirlwind tour: I need to be free to explore my data - about one day from now
  3. RavenDB 3.5 whirl wind tour: I'll have the 3+1 goodies to go, please - 5 days from now
  4. The design of RavenDB 4.0: Voron has a one track mind - 6 days from now
  5. RavenDB 3.5 whirl wind tour: Digging deep into the internals - 7 days from now

And 12 more posts are pending...

There are posts all the way to May 30, 2016


  1. The design of RavenDB 4.0 (14):
    03 May 2016 - Making Lucene reliable
  2. RavenDB 3.5 whirl wind tour (14):
    04 May 2016 - I’ll find who is taking my I/O bandwidth and they SHALL pay
  3. Tasks for the new comer (2):
    15 Apr 2016 - Quartz.NET with RavenDB
  4. Code through the looking glass (5):
    18 Mar 2016 - And a linear search to rule them
  5. Find the bug (8):
    29 Feb 2016 - When you can't rely on your own identity
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats