I've given a second chance to D after watching D videos from Lang.NEXT 2012. As a first look, I wanted to try generate serialization code at compile time. Here's the class: class MyObject { public int m_id; public Data m_data; public bool AutoDelete; public int RefCount; mixin(AddStreamSerialization!(MyObject)); }