CLS(通用语言规范)是一组对 API 的约束,也是一组对语言的补充要求。如果一个库符合 CLS(即遵守所有约束),那么任何符合 CLS 的语言都可以使用该 API。相反,符合 CLS 的语言保证能够使用任何符合 CLS 的库。例如,符合 CLS 的语言保证支持 Int32,因此 CLS 保证库编写者在其 API 中使用 Int32 是安全的。
CIL (Common Intermediate Language) is the byte code to which your C# or Visual Basic code is compiled. It's the "machine code" of the .NET execution engine.
The CTS (Common Type System) is the representation of types (classes and structures) at the compiled level. Basically, it's saying that all .NET languages will use a common way of representing types (classes and structures).
The CLS (Common Language Specification) is a set of constraints on APIs and a complementary set of requirements on languages. If a library is CLS-compliant (i.e. adheres to all the constraints), then any CLS-compliant language will be able to use that API. Conversely, a CLS-compliant language is guaranteed to be able to use any CLS-compliant library. For example, a CLS-compliant language is guaranteed to support Int32, so the CLS guarantees it's safe for library writers to use Int32 in their APIs.
发布评论
评论(1)
CIL(通用中间语言)是 C# 或 Visual Basic 代码编译后的字节代码。它是 .NET 执行引擎的“机器代码”。
CTS(通用类型系统)是编译级别的类型(类和结构)表示。基本上,它是说所有 .NET 语言都将使用表示类型(类和结构)的通用方式。
CLS(通用语言规范)是一组对 API 的约束,也是一组对语言的补充要求。如果一个库符合 CLS(即遵守所有约束),那么任何符合 CLS 的语言都可以使用该 API。相反,符合 CLS 的语言保证能够使用任何符合 CLS 的库。例如,符合 CLS 的语言保证支持 Int32,因此 CLS 保证库编写者在其 API 中使用 Int32 是安全的。
CIL (Common Intermediate Language) is the byte code to which your C# or Visual Basic code is compiled. It's the "machine code" of the .NET execution engine.
The CTS (Common Type System) is the representation of types (classes and structures) at the compiled level. Basically, it's saying that all .NET languages will use a common way of representing types (classes and structures).
The CLS (Common Language Specification) is a set of constraints on APIs and a complementary set of requirements on languages. If a library is CLS-compliant (i.e. adheres to all the constraints), then any CLS-compliant language will be able to use that API. Conversely, a CLS-compliant language is guaranteed to be able to use any CLS-compliant library. For example, a CLS-compliant language is guaranteed to support Int32, so the CLS guarantees it's safe for library writers to use Int32 in their APIs.