Write about semantics and implementation for generating generic code