Transforming Metadata in the CLI

The sequence of annotation, transformation, and continuous refinement results in constant production of metadata and interpretation of that metadata. As we mentioned in Chapter 1, this sequence defines a data-driven architecture, onto which it is easy to graft new services. The integration costs of a data-driven architecture for extensibility are low compared to one based on API definitions, and since component integration is the most important feature enabled by the CLI specification, a data-driven architecture is the right choice for the task. Using this approach, one subsystem’s data becomes another subsystem’s executable code. (The programming community has known this since the fifties, and it is as good an idea now as it was then.)

Figure 8-1 shows some of the transformations and augmentations that occur in the SSCLI. Starting from the left, an abstract type, written as code in a high-level programming language, is transformed by a high-level compiler into CIL and type metadata, which is bundled into an assembly. After this, file loaders, module loaders, and class loaders sequentially transform an on-disk PE file to an in-memory structure that is optimized for the JIT compiler and the execution engine. With these structures in place, the JIT compiler can produce native code from the intermediate representation. Unlike traditional compilers, a JIT compiler makes decisions in the context of the current execution environment; as it generates ...

Get Shared Source CLI Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.