Thanks for your answer. So I should use ModuleBuilder.DefineType to create a new type?
I do not need the dynamic object features in the DLR (the language I'm creating is dynamically typed but method dispatch doesn't work like in Ruby/Python). I'm looking at using the DLR because the expression trees are very convenient. Once a data type is
defined it never changes (you cannot add additional attributes at run time). Is it possible to get the same speed as native .NET types (for example types defined in C#) for attribute access with IDynamicObject?
IronPython compiles a class definition to a method call that creates a new class at run time:
MSAst.Expression classDef = Ast.Call(
I'm not sure if this is the right way to go for me, because I'd like to execute class definitions at run time in an interactive environment (like the python shell or irb) but also compile code statically.
Is it better to use Reflection.Emit for all code generation in my case?