An API for Run-time Code Generation