The Impossible Optimization, and the Metaprogramming to Achieve It