Xroma is a translation environment that supports the concept of smart libraries: libraries that can actively inspect the environment in which they are used and adapt to it. The Xroma system enables this both at compile-time and at run-time through the general principle of reflection. The system exposes syntax trees (called Xromazene), the translation cycle (parsing, semantic checking, ?) and the Xroma object model. Thus the Xroma programmer can substitute library-specific actions at specified points of the translation cycle to take control of the process. These actions are themselves Xroma elements and can be treated as ordinary software library components. Applications include component-specific optimizations, generalized genericity constraints, evolving interfaces, program analysis tools, and the coexistence and derivation of multiple object models (e.g., Xroma-to-COM translation).