关于“CLR 与CLI”的关系。

Posted on 2005-01-21 01:21 Ray Chang 阅读(923) 评论(3)  编辑 收藏 所属分类: .NET基础

自接触.NET以来,一直对这二个概念很模糊,曾还一度以为二者是一个东西呢,
下面是二者的全称:

CLR  = Common Language Runtime

CLI   = Common Language Infrastructure


在<>(强烈推荐这本书) 这本书中提到:  CLI is a standardised specification for a virtual execution environment. 所以说CLI是一种用于虚拟执行环境的规范标准。它是由Microsoft创建的,但是我们也可以说是 ECMA的CLI,ECMA 是指European Computer Manufactures Association, (欧洲计算机制造商协会),他们通过了CLI做为一种规范标准,而且ECMA和ISO有着很大的联系,CLI已经通过过ISO认可,做为ISO/IEC 23271:2003的标准。(C#也被ISO认可为国际标准,ISO/IEC 23270:2003)
我们可以这样说:
ECMA 是 Shared Source CLI的基础,而Shared Source CLI却是商业.NET Frameworks的基础。

关于CLR,在网上有这样的定义:
- The Common Language Runtime (CLR) provides a solid foundation for developers to build various types of applications.
- The CLR is a multi-language execution environment.
我想上面提到的multi-language execution environment,就是指的VS .NET中所包括的各种语言吧,像C#, VB, VC++, ASP等等,因此,CLR也执行了ECMA的标准。这一点于CLI相同。

而CLR与CLI不同点在哪里呢?老师给的notes上是这样写的:

- JIT and garbage collector replaced with more portable, more approachable, implementations.
- Many Windows-specific features not included: Com interop, WinForms, "It Just Works!," and other integration
- Commercial features not included, such as ADO.NET, enterprise services, NGEN (JIT -ahead), and ASP.NET.

翻译如下:(小弟英语不是很好,错了别扔鸡蛋)
- 将JIT (JIT stand for Just In Time) 和 垃圾回收 替换为更方便的和更接近的执行。
- 放弃了许多Windows的特点:例如Com interop,窗体,"It Just Works!"等。
- 一些商业性质的特性没有包括:例如ADO.NET, 企业服务,NGEN和ASP.NET

这是我目前对CLI和CLR的一个大概的认识,如果有哪些朋友有更好的理解,请一定要告诉我呀。

Feedback

#1楼    回复  引用    

2005-06-25 22:39 by silas [未注册用户]
CLI是一套用于描述微软的微软.Net Framework的基本组件的技术。它包括运行程序所需的一个虚拟执行系统和定义不同数据类型如何相互作用的基类库。CLI是微软通用语言运行时间的底层技术,是运行.NET应用程序的必需引擎。

#2楼    回复  引用    

2005-06-25 22:41 by silas [未注册用户]
Overview
The Common Language Infrastructure (CLI) is the ECMA standard that describes the core of the .NET Framework world. The Shared Source CLI is a compressed archive of the source code to a working implementation of the ECMA CLI and the ECMA C# language specification.

This implementation builds and runs on Windows XP, the FreeBSD operating system, and Mac OS X 10.2. It is released under a shared source initiative. Please see the accompanying license.

The Shared Source CLI goes beyond the printed specification of the ECMA standards, providing a working implementation for CLI developers to explore and understand. It will be of interest to academics and researchers wishing to teach and explore modern programming language concepts, and to .NET developers interested in how the technology works.

Features
The Shared Source CLI archive contains the following technologies in source code form:

* An implementation of the runtime for the Common Language Infrastructure (ECMA-335) that builds and runs on Windows XP, the FreeBSD operating system, and Mac OS X 10.2.
* Compilers that work with the Shared Source CLI for C# (ECMA-334) and JScript.
* Development tools for working with the Shared Source CLI such as assembler/disassemblers (ilasm, ildasm), a debugger (cordbg), metadata introspection (metainfo), and other utilities.
* The Platform Adaptation Layer (PAL) used to port the Shared Source CLI from Windows XP to FreeBSD and Mac OS X.
* Build environment tools (nmake, build, and others).
* Documentation for the implementation.
* Test suites used to verify the implementation.
* A rich set of sample code and tools for working with the Shared Source CLI.

#3楼    回复  引用    

2005-07-27 22:40 by hunter [未注册用户]
CLI是CLR的一个子集,也就是.NET中最终对编译成MSIL代码的应用程序的运行环境进行管理的那一部分。在CLR结构图中CLI位于下半部分,主要包括类加载器(Class Loader)、实时编译器(IL To Native Compilers)和一个运行时环境的垃圾收集器(Garbage Collector)。CLI是.Net和CLR的灵魂,CLI为IL代码提供运行的环境,你可以将使用任何语言编写的代码通过其特定的编译器转换为MSIL代码之后运行其上,甚至还可以自己写MSIL代码在CLI上面运行。

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      


相关链接:
 



posts - 63, comments - 179, trackbacks - 5, articles - 8

Copyright © Ray Chang