日期:2012-08-13  浏览次数:20431 次

CLS - Common Language Specification

The Common Language Specification (CLS) aids the development of mixed language programming. It defines a subset of Common Type System which all class library providers and language designers targeting CLR must adhere to.
CLS is a subset of CTS. If a component written in one language (say C#) is to be used from another language (say VB.NET), then the component writer must adhere to types and structures defined by CLS.

CIL - Common Intermediate Language

All compilers complying with CLI must generate an intermediate language representation called Common Intermediate Language (CIL). The CLI uses this intermediate language to either generate native code or use Just In Time (JIT) compilation to execute the intermediate code on the fly.
The Microsoft documents refer this standard's implementation as MSIL (Microsoft Intermediate Language).

JIT   -  Just in Time Compiler

The JIT or Just in Time Compiler is the part of the runtime execution environment, which is used to convert the intermediate language contained in the executable file, called assemblies, into native executable code.
The security policy settings are referred at this stage to decide if code being compiled needs to be type safe. If not an exception is thrown and JIT process is aborted.
  

VES - Virtual Execution System



Virtual Execution System (VES), is more or less equivalent to the JVM (Java Virtual Machine).
VES loads, links and runs the programs written for Common Language Infrastructure contained in Portable Executable (PE) files.
Virtual Execution System (VES) fulfills it's loader function by using information contained in the metadata and uses late binding (or linking) to integrate modules compiled separately, which may even be written in different languages.
VES also provides services during execution of the codes, that include automatic memory management, profiling and debugging support, security sandboxes, and interoperability with unmanaged code, such as COM components.
Managed codes are Intermediate Language (IL) code along with metadata contained in Portable Executable (PE) files, these may be .EXE or .DLL. This needs just in Time (JIT) compiler to convert it into native executable code. There is also a provision of pre compiled executable which is called unmanaged code. The advantage of unmanaged code is that is does not need to JIT compilation but has the disadvantage of unportablity across different Operating System (OS) platforms.

Microsoft's Implementation of CLI is CLR

The Microsoft's implementation and adaptation of the above standard has resulted in difference in terminology, for example Common Intermediate Language (CIL) is called Microsoft Intermediate Language (MSIL) and Common Language Infrastructure (CLI) is referred to as Common Language Runtime (CLR).
These changes in naming convention, I believe, is to create a branding distinction while implementing the standards. This was probably intended to avoid the clash that occurred with the Java the language standard, Java the island, Java the coffee brand and Java the Sun's trademark! But, in the long run, it will only lengthen the already long list of confusing acronyms and jargons in the programmer's dictionary.
We use CLI and CLR interchangeably, however, it will be more correct to say that  CLR is the Microsoft's implementation of CLI.
Apart from scripted languages like JavaScript and VBScript, the .NET framework presently supports three compiled languages, namely: VB.NET, VC++ and C# (pronounced C Sharp)  These language compilers target this runtime. The type verifiable compiler's output is called managed code.
Unsafe codes can also be generated by compilers, which is called unmanaged code. Garbage collection is only handled for managed codes.
The man