Microsoft 发布Rotor,一场Shared Source对Open Source的速度比赛

** Microsoft 发布 Rotor ,一场 Shared Source 对 Open Source 的速度比赛 **


小气的神

2002 . 03 . 28

Article Type: News

难度等级: 1/9

版本: 1.48

我想这是 dotNET 世界中一件有意义的事,某种程度上它会在今后几年对 Microsoft 以及他的敌对者造成影响,当然现在我们不知道将是怎样的影响和振动。不过我认为目前的 Microsoft 显示出更多的“ Steve Ballmer ”特性,也许我们需要重新打量我们以前头脑中的 Microsoft ,应该说,他在变化。

昨天, 3 月 27 日, Redmond 宣布共享代码的 CLI( Common Language Infrastructure) 和 C# 实现发布。比起 Netscape Navigator 5.0 的 17 million 行源代码来说它只有 100 多万行 , 但这一百万行代码(近 1400 个文件)足以满足 C# 爱好者内心深处的好奇心,并且他们会为此激动不已。

Redmond 解释说该举主要是推广编程语言方面的创新和 XML Web Services 研究,并且主要针对大学和学术界,分析家也认为这样的举动将不会造成太大商业影响,同时 Microsoft 的批评者认为这主要是为了阻止 Java 的增长和打击 Linux 这种的开发源代码的发展。一些观察家认为目前 Linux 的发展放缓,特别是桌面应用方面,无疑 Redmond 现在的举动会触及到他们某些敏感的想法。

8 个月前 Microsoft 被指责对 dotNET 开放结构及跨平台使用能力的夸大宣传和无心承诺, 2001 年 7 月,著名的 Linux 桌面环境 GNOME 开发商 Ximian 公司出于改进开发工具的需要,开始启动一个名叫 Mono 的开放源码项目,旨在开发 Linux 版的 .NET 。不过目前看来 Microsoft 和他的伙伴率先进了一球。而且从 2000 年 10 月 Microsoft 向 ECMA 提交有关 C# 和 CLI 的规范,一直到 2001 年 12 月被 ECMA 批准看来, Microsoft 也都不断的向 Sun 施加压力,相比起来在 2000 年, Sun 公司撤回了他自己的 Java ECMA 申请过程。

C# ( ECMA - 334 )和 CLI ( ECMA - 335 )都是 Microsoft .NET Framework 多语言支持策略的核心和关键技术。 C# 作为 C 及 C++ 家族中一个改进型的面向组件的编程语言而 CLI 则是 .NET Framework 的一个优良子集,主要提供一个运行时环境和开发和分发 XML Web Services 的基本类库。 Redmond 这次发表的 Shared Source CLI Beta 包括了这两部分甚至更多。

不过值得注意的是, Microsoft 非常强调其 Shared Source 性质而不是 Open Source ,这符合这家公司一贯对于 GPL(GNU General Public License ) 的理解,老实说他们不相信 GPL 能够保证自己对自己代码和权力的控制,也不愿意跟 GPL 产生任何关系,特别是自己核心的产品。不过 Microsoft 自己有产品是遵循或支持 GPL 的, Andy Patrizio 曾吃惊的发现 Microsoft 至少有一个这样的产品: Interix 。 Microsoft 对于这个产品有些工具是在 GNU GPL 下 Released 非常的讨厌,但处于对以前 license 的尊重, Microsoft 不得不继续在 GPL 下 Release 以后版本的代码。 Microsoft 不是一家小公司,所以他不会轻易的接近 GPL, 以免只要有一样接触到 GPL ,那么所有的产品都可能会变成 GPL 的 ( Don Box 说 GPL 是一种“ Viral licences ”)如果说为研究学习和进步的需要公开源代码, Microsoft 一般会选择 Shared Source 。 Window CE.NET 和这一次 Shared Source CLI 等等,甚至 Windows 2000/XP/.NET Server 都是这样。尽管 Microsoft 被他的对手认为是极其无赖的,但本质上他符合美国商业最基本的一条规则:你可以选择不玩这个游戏,但只要你进入,那么你必须遵守这个游戏中的所有规则。

好了,先不管为什么不是“ Open Source ”的原因和可能的争论, 看看这个 11M 的软件包中有些什么,能干什么吧。 ( 不喜欢翻译所以不翻译了 , 见谅 )

** 有什么特色? **
The Shared Source CLI archive contains the following technologies in source code form:

l An implementation of the runtime for the Common Language Infrastructure (ECMA-335) that builds and runs on Windows XP and FreeBSD

l Compilers that work with the Shared Source CLI for C# (ECMA-334) and JScript

l Development tools for working with the Shared Source CLI such as assembler/disassemblers (ilasm, ildasm), a debugger (cordbg), metadata introspection (metainfo), and other utilities

l The Platform Adaptation Layer (PAL) used to port the Shared Source CLI from Windows XP to FreeBSD

l Build environment tools (nmake, build, and others)

l Documentation for the implementation

l Test suites used to verify the implementation

** 我能用它做什么? **
There is a wealth of programming language technology in the Shared Source CLI. It is likely to be of interest to a wide audience, including:

l Developers interested in the internal workings of the .NET Framework can explore this implementation of the CLI to see how garbage collection works, JIT compilation and verification is handled, security protocols implemented, and the organization of frameworks and virtual object systems.

l Teachers and researchers doing work with advanced compiler technology. Research projects into language extensions, JIT optimizations, and modern garbage collection all have a basis in the Shared Source CLI. Modern compiler courses can be based on the C# or JScript languages implemented on the CLI.

l People developing their own CLI implementations will find the Shared Source CLI an indispensable guide and adjunct to the ECMA standards.


** 如何获得它? ** ** **

http://download.microsoft.com/download/.netframesdk/CLI/Beta1/WXP/EN-US/sscli20020326.tgz

** FAQ ** ** ? ** ** **

http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/901/msdncompositedoc.xml

** 需要的安装环境 ** ** **

On Windows XP you will need:

l Visual Studio .NET

l Perl 5.6 (available from http://www.perl.org)

l Archiving utility of choice – WinZip or other

You will need FreeBSD 4.5 if you work with the Shared Source CLI on FreeBSD.

** 提示: ** ** **

l 官方申明目前还不支持 Windows 2000 但已经有人尝试并运行成功:

I just built it on Win2000 and ran the test suite (cd tests; rrun.pl).

Here are the results:

RRUN: Summary:

RRUN: Run time - 0h 36m 49s

RRUN: Processed - 1574

RRUN: Passed - 1574

RRUN: Failed - 0

Excellent!

(以上信息来自新闻组,有人认为 XP 的限定是为了促销而他们希望未来有更多人会工作 XP 下 , 最重要的可能是整个 Rotor team 是在 XP 环境下工作的,所以不保证未来是否会有变化)

l 如果你不熟悉 FreeBSD 那么小心你的双启动系统和备份先 ( 可以考虑试一试 VMware Workstation 软件 ) 。

l 找到 合适版本的 Perl

l 最新的有关 SSCLI 的书 ,

l Shared Source CLI 的代码名叫“ Rotor ”,你到新闻组和一些内部网站上可能会碰见它。

l 无论你多么激动或慌乱都一定在 Unzip 后的第一时刻阅读 ReadFirst.html

l 编译时保证你有足够的空间,越大越好。

l 文档链接中的 architecture_guide.html 似乎丢失,你可以从 O'Reilly's 看到同样性质的文章

The lay of the land

Points of interest in this directory:

· license.txt, licensed_file_list.txt, and license_banner_for_sources.txt

· env.bat, env.sh, and env.csh

· buildall and buildall.cmd

To build the Shared Source CLI, you must be running within a sh- or csh-flavored shell on FreeBSD, or a command window in Windows. The build procedure is detailed in this document, but to summarize, you first set up your environment by running one of the flavors of the _ env _ script, followed by running buildall . Note that through some filename and file permissions trickery, typing "buildall" on Windows will cause buildall.cmd to run, while typing it into a FreeBSD shell will cause the shell script named buildall to be run. The env scripts aren't quite as automagic -- on FreeBSD, depending on the shell that you favor, you will have to "source" either env.sh or env.csh ; on Windows, you may just type env into a command window.

** But wait! ** Before you go and build the CLI, first you should take a look at the license! The file named license.txt contains the Microsoft Shared Source CLI/JScript/C# License, which applies to this entire distribution. The file named licensed_file_list.txt contains the "bill of materials" for the distribution, and the file named license_banner_for_sources.txt is the copyright banner that is injected into most of the files found in this distribution. There are a few files in this distribution that are licensed under other licenses, and we have preserved the copyright and license notices for these.

sscli/docs is documentation for the Shared Source CLI

This document resides in this directory, as well as a very useful index of all of the doc that is part of the distribution.

Happy browsing!

sscli/pal contains implementations of the Platform Adaptation Layer (PAL)

Within the pal subdirectory, we find two subdirectories, unix and win32 . The "unix" directory contains the implementation of the FreeBSD pal (don't ask why it isn't named FreeBSD...) and, logically enough, the "win32" directory contains the Windows PAL. There is also an important header file, named rotor_pal.h, which declares all of the APIs that a developer building a new PAL would have to implement. See the PAL Specification for more details on this topic.

The Win32 PAL is primarily an exercise in calling through to the underlying Win32 API after logging the call and sanity-checking parameter values in some cases, but the code for doing portable exception handling might be of interest.

The FreeBSD PAL, on the other hand, is a substantial piece of work. Mapping Win32 semantics onto BSD semantics is non-trivial, and a number of interesting (and possibly controversial :) design decisions lie within this directory. From Unicode support to exception handling to memory-mapped files to debugger support to sockets and file I/O, there is a lot to look at here.

sscli/palrt/src contains the implementation of the "PAL runtime"

In order to make life simpler for developers who wish to build new PAL implementations, some of the more generic or reusable implementation details have been broken into a separate library, called the PAL runtime. If you're not implementing a PAL, this directory still might be interesting -- it contains a number of odds and ends, including:

· Implementation of the COM APIs used in Rotor

· Crypto code used to support strongnames and the runtime

· C runtime functions

· Math and decimal math routines

· Support for streaming over memory

· String, url, and pathname parsing and manipulation

· Configuration and resource loading

· Code used when calling from platform-native code to managed code

The PAL runtime is used by the FreeBSD PAL. Note the set of "cut down" windows header files in sscli/palrt/inc directory; these are included in order to pull in these API helpers. If you wish to implement a new PAL, you will probably want to use the same technique.

sscli/tools is source code for portable build tools

Once a PAL has been created, using the native tool chain for whatever platform is being built, a set of portable build tools are then built against the PAL. This is the bootstrap that enables the bulk of the build process; these tools use the PAL APIs to accomplish their work. Documentation for all of these tools can be found in the sscli/docs/buildtools directory; see in particular build.exe, binplace.exe, and nmake.exe.

sscli/clr/src contains a lot, including the runtime and the C# compiler

Points of interest include these sub-directories:

· vm -- This directory has the bulk of the execution engine, including the garbage collector, the class loader, the type system, error reporting, AppDomains, Assemblies, delegate support, reflection, security, and the code manager. There are numerous interesting files to examine here. (For those curious about the build process, note that vm has a "dirs" file, but

Published At
Categories with Web编程
Tagged with
comments powered by Disqus