tags:

views:

96

answers:

2

I'm working on a new toy language that will be statically compiled to .NET's IL code.

Off hand I can think of the following to actually generate the IL, but I'm open to alternatives:

  • Cecil
  • ILASM
+1  A: 

You can write your own language using this compiler generator. I used it. Its really easy to use and to understand.

CoCo/R

http://en.wikipedia.org/wiki/Coco/R

Gabriel McAdams
While certainly an interesting idea for parsing, I'm looking for advice on actually generating the IL itself after it has already been parsed.
Jonathan Allen
Sorry. With that, I can't help you.
Gabriel McAdams
+2  A: 

There is also the Common Compiler Infrastructure (AST/Code, Metadata), and of course the venerable Reflection.Emit. I don't have any experience of CCI myself, but this page seems a good starting point for the IL translation side of things.

itowlson
Reflection.Emit does look promising.
Jonathan Allen
Drat. Looks like it has some serious limitations.http://blogs.msdn.com/lucian/archive/2009/11/29/the-limitations-of-reflection-emit.aspx
Jonathan Allen
You might find IKVM.Reflection/IKVM.Reflection.Emit a feasible replacement too.
Matt Enright