Ayende @ Rahien

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

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 5,972 | Comments: 44,508

filter by tags archive

DSLs in Boo, and a look back


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.


Comments

Rafal

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.

josh

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.

Ryan

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.

Scooletz

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

Scooletz

@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.

FUTURE POSTS

  1. Paying the rent online - 4 hours from now
  2. Reducing parsing costs in RavenDB - about one day from now

There are posts all the way to Aug 04, 2015

RECENT SERIES

  1. Production postmortem (5):
    29 Jul 2015 - The evil licensing code
  2. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
  3. API Design (7):
    20 Jul 2015 - We’ll let the users sort it out
  4. What is new in RavenDB 3.5 (3):
    15 Jul 2015 - Exploring data in the dark
  5. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats