CHAPTER 36

image

Execution-Time Code Generation

If you come from a C++ background, it’s likely you have a very “compile-time” view of the world. Because a C++ compiler does all code generation when the code is compiled, C++ programs are static systems that are fully known at compile time.

The Common Language Runtime provides a different way of doing things. The compile-time world still exists, but it’s also possible to build dynamic systems where new code is added by loading assemblies or even by writing custom code on the fly.

Loading Assemblies

In the .NET Common Language Runtime, it’s possible to load an assembly from disk and to create instances ...

Get A Programmer's Guide to C# 5.0, 4th Edition 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.