views:

202

answers:

2

I'm developing a compiler framework for .NET and want a flexible way of defining pipelines. I've considered the following options:

  • WWF
  • Custom XML pipeline description
  • Custom pipeline description in code (using Nemerle's macros to define syntax for it)
  • Other code-based description

Requirements:

  • Must not depend on functionality only in the later versions of .NET (3+) since it's intended to be cross-platform and be used on top of managed kernels, meaning semi-limited .NET functionality.
  • Must allow conditional pipeline building, so you can specify that certain command line options will correspond to certain elements and orders.

WWF would be nice, but doesn't meet the first requirement. The others would work but are less than optimal due to the work involved.

Does anyone know of a solution that will meet these goals with little to no modification?

+1  A: 

If you know Ruby then a solution is to write a simple internal DSL that can generate whatever pipeline data types and reader/writer code you need. Generating XML is a quick way to get started. You can always change the DSL to generate another format later if required.

You may also want to look at the Microsoft Phoenix compiler project for inspiration.

MB
This is similar to the use of Nemerle macros to define syntax for such pipelines, except that the macros would translate everything at compile-time. It's a nice solution from a usability standpoint, but it requires a lot of work to put it together.
Cody Brocious
A: 

I know Boo let you have fun with the compiler, not sure if it does in the manner you want.

pmlarocque