About the CLR, CIL, CTS, CLS, CLI, BCL, and FCL

Source: Internet
Author: User

If you want to learn in depth. NET platform, then these keywords in the title are not unfamiliar to you, these nouns constitute. Net of huge ecosystems, for macro-awareness. NET platform, learn some. NET architecture system, the understanding of some commonly used nouns is necessary, not necessarily forced memory, but at least to know their meaning.

CLR, Common language runtime (Common Language Runtime)

Building products in any language must be hosted on a single platform, as our software runs in an operating system environment, and the operating system provides the CLR with a running environment. NET builds a program that runs on top of the CLR, the CRL provides a hotbed for the operation of. NET programs, the CLR provides a basic class library and run engine, the basic class library encapsulates operating system functions for developers to call, and runs the engine to compile and run the programs we develop. The CLR contains a. NET run engine and a class library conforming to the CLI. Pass. NET platform is built on the CLR base Class library and runs on top of the CLR-provided run engine.

When compiled into managed code, the compiler translates the source code into Microsoft intermediate language (MSIL), a set of instructions that can be effectively converted to native code and CPU-independent. MSIL includes instructions for loading, storing and initializing objects and invoking methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. For code to work, you must first convert the MSIL to CPU-specific code, which is usually done through a just-in-time (JIT) compiler. Because the common language runtime provides one or more JIT compilers for each of the computer structures it supports, the same set of MSIL can be JIT-compiled and run on any supported structure.

CIL, Common Intermediate language (Common intermediate Language)

The CLI, abbreviated as Microsoft Intermediate Language (MSIL) or intermediate language (IL). CIL is an intermediate code that the compiler compiles. NET code into the common language runtime (CLR) to recognize. It is a language between high-level languages, such as C #, and CPU instructions. When a user compiles a. NET program, the compiler (for example, VisualStudio) translates C # source code compilation into intermediate language (MSIL), which is an intermediate language that can be converted by the CLR into CPU instructions, and when these intermediate languages are executed, The CLR provides a just-in-time (JIT) compiler that translates them into CPU-specific code. Because the common language runtime supports a variety of real-time compilers, the same intermediate language code can be compiled in real time by different compilers and run on different CPU architectures. In theory, MSIL will eliminate disputes between different languages in the industry over the years. In the world of. NET, it is possible that some of the code can be implemented in C + +, while another part of the code is done using C # or vb.net, but eventually the code will be converted to an intermediate language. This gives the programmer a great deal of flexibility, and programmers can choose the language they are familiar with, and no longer have to worry about learning the new language they are constantly introducing.

CTS, Common type systems (Common type System)

The CTS is a type system and language specification that ensures that the CLR is able to identify and process types, all. NET development language, regardless of the vs.net type or C #. NET type will eventually be compiled into the type of CTS that the CLR recognizes, so the CTS is an abstraction of the. NET platform type. For example, the integer type in vb.net and the int type in C # are compiled into the System.Int32 type of the CTS. If a program written in a language can run on the CLR, it does not indicate that the language is fully compliant with the CTS specification. For example, code written in C + + does not conform to the CTS specification, and at compile time this part of the code that does not conform to the CTS is compiled into the original code local CPU instruction rather than the intermediate code.

CLS, Common Language Specification (Common Language specification)

The CLS is a subset of the CTS, all. NET language should follow this rule in order to create applications that interoperate with other languages, but be aware that in order for each language to interoperate, you can use only the feature objects listed in the CLS, which are collectively known as CLS-compatible features. The minimum specification for running languages on the net platform, just because. NET can be easily interacted with by different languages, such as C # writing a program directly referencing and using a class library written by VB.net. In order to achieve such an interaction, the CLS specification is developed and all class libraries (not all) provided in the. NET Framework itself are CLS-compliant, and incompatible classes and methods are specifically marked as incompatible when viewing the MSDN documentation, for example, System.UInt32 in C # is marked as " This API is not CLS-compliant. The CLS-compliant alternative API is Int64. , which means that not all languages (such as vb.net or J #) support unsigned data types, but this data type is incompatible with the CLS.

CLI, Common Language Infrastructure (Common Language Infrastructure)

The CLI is an open technical specification. It was initiated by Microsoft United Hewlett-Packard and Intel in 2000 to ECMA. The common Language Infrastructure defines the executable code that makes up the. NET framework infrastructure and the code's runtime environment, which defines a language-independent, cross-architecture run environment that enables developers to develop software in a variety of high-level languages defined in the specification. And you can run the software on different computer architectures without needing to fix it. The CLI is sometimes mixed with the CLR. But in a strict sense, it's wrong. Because the CLI is a specification, the CLR is an implementation of this specification.

The European Association of Computer Manufacturers (ECMA) has approved the C # Language Specification (ECMA-334) on October 13, 2001 as a new computer industry standard. ISO also agreed that the standard should enter the approval stage of the organization. And, as. NET and the CLR, the CLI and C # also get the ECMA approval (ECMA-335). With both C # and CLI standards, you can write your own to run on any operating system. NET platform (as long as you want). As mentioned earlier, this is how the famous mono project is done, and the mono project consists of three core parts: A C # language compiler, a CLI, and a class library.

BCL, basic library (base class)

The BCL is a public programming framework called a base class library that can be exploited by developers of all languages. is one of the specifications of the CLI (Common Language Infrastructure, Common Language Infrastructure), which mainly includes: performing network operations, performing I/O operations, security management, text operations, database operations, XML operations, interacting with event logs, tracing and some diagnostic operations, Use unmanaged code, create and invoke dynamic code, and so on, with relatively small granularity, providing basic support for all frameworks.

FCL, framework libraries (framework class Library)

The FCL provides a large-grained programming framework that is designed for different applications, with most implementations of the FCL referencing the BCL, such as the development framework we often call: ASP. NET, MVC, WCF, WPF, etc., providing a different level of programming framework.

About the CLR, CIL, CTS, CLS, CLI, BCL, and FCL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.