Journal of a software dev

October 21, 2008

Easier log4net configuration is here

Filed under: boo, dsl, log4net, log4net-altconf — Tags: , , , — Michael Cromwell @ 11:28 am

I have just released a version of a new project I have been working on after being inspired by Ayende’s ‘Building Domain Specific Languages in Boo‘ e-book, the project is aimed at making log4net configuration easier by using a DSL instead of XML it’s called log4net-altconf and is hosted on google code you can grab the source using a SVN client, I would recommend TortoiseSVN.

It’s early days so some of the syntax will need to be ironed out and there will no doubt be other things that need to be looked at, hopefully someone with better knowledge with this type of thing can give some pointers :)

I could probably have had this done a few days back however I was wrestling with NUnit’s addin’s in order to have a set of test DSL’s to test the main DSL that set me back quite a bit!

If you have any comments please feel free to post them here.

October 11, 2008

Macro Woes with DSL in Boo

Filed under: boo, dsl — Tags: , , — Michael Cromwell @ 8:20 pm

Lately I have been working my way through Ayende’s Building Domain Specific Languages in Boo, it’s a really good read and would recommend it to anyone wanting to put together their own DSL and also to learn about the meta programming that Boo has to offer.

Anyway this afternoon I spent a long time trying to get a macro to work for my DSL using Rhino DSL, in the end I think it was a number of issues, so here is a list of things to check if your macro is not working:

  1. Make sure that the namespace of where the macro is declared is passed thorugh to the ImplicitBaseClassCompilerStep, this can be done in the constructor, which takes a string array of namespaces.
  2. When you name the macro it must be in pascal case, I was falling foul because in my DSL I was referring to it as add_foo so named it add_fooMacro, this doesn’t work it must be Add_fooMacro.
  3. If the macro is declared in a seperate assembly to the rest of your DSL classes you will need to add a reference to the assembly for the Boo compiler.
  4. This one is a general rule, don’t try to use macros inside macros (using, lock etc…) they ain’t gonna work!

As for the DSL project I’m working on… watch this space :o )

Blog at WordPress.com.