.NET Type System—CLR–Programming Language Interaction
| CSharp-Online.NET:Articles |
| .NET Articles |
| © 2003 Microsoft Corp. |
CLR–Programming Language Interaction
Figure 2.1 depicts the relationship between elements of the CLR and programming languages. At the top of the diagram, the source file may hold a definition of a new type written in any of the .NET languages, such as Python. When the Python.NET compiler compiles this file, the resulting executable code is saved in a file with a .DLL or .EXE extension, along with the new type's metadata. The metadata format used is independent of the programming language in which the type was defined.
Once the executable file for this new type exists, other source files—perhaps written in languages such as C#, Managed C++, Eiffel, or Visual Basic (VB)—can then import the file. The type that was originally defined in Python can then be used, for example, within a VB source code file just as if it were a VB type. The process of importing types may be repeated numerous times between different languages, as represented by the arrow from the executable file returning to another source file in Figure 2.1.
At runtime, the execution system will load and start executing an executable file. References to a type defined in a different executable file will cause that file to be loaded, its metadata will be read, and then values of the new type can be exposed to the runtime environment. This scenario is represented by the line running from the execution system back to the executable files in Figure 2.1

Figure 2.1 Interaction between languages, compilers, and the CLR
|

