托管代码的优点-----外文翻译.doc

约7页DOC格式手机打开展开

托管代码的优点-----外文翻译,microsoft intermediate language shares with java byte code the idea that it is a low-level language with a simple syntax (based on numeric codes rather than tex...
编号:10-274576大小:50.00K
分类: 论文>外文翻译

内容介绍

此文档由会员 wanli1988go 发布

Microsoft intermediate language shares with Java byte code the idea that it is a low-level language with a simple syntax (based on numeric codes rather than text), which can be very quickly translated into native machine code. Having this well-defined universal syntax for code has significant advantages.
Platform independence
First, it means that the same file containing byte code instructions can be placed on any platform; at runtime the final stage of compilation can then be easily accomplished so that the code will run on that particular platform. In other words, by compiling to IL we obtain platform independence for .NET, in much the same way as compiling to Java byte code gives Java platform independence.
You should note that the platform independence of .NET is only theoretical at present because, at the time of writing, a complete implementation of .NET is only available for Windows. However, there is a partial implementation available (see for example the Mono project, an effort to create an open source implementation of .NET, at www.go-mono.com/).
Performance improvement
Although we previously made comparisons with Java, IL is actually a bit more ambitious than Java byte code. IL is always Just-In-Time compiled (known as JIT compilation), whereas Java byte code was often inter

Microsoft中间语言与Java字节代码共享一种理念:它们都是一种低级语言,语法很简单(使用数字代码,而不是文本代码),可以非常快速地转换为内部机器码。对于代码来说,这种精心设计的通用语法,有很大的优点。
1. 平台无关性
首先,这意味着包含字节代码指令的同一个文件可以放在任一个平台中,运行时编译过程的最后阶段可以很容易完成,这样代码就可以运行在该特定的平台上。也就是说编译为中间语言就可以获得.NET平台无关性,这与编译为Java字节代码就会得到Java平台无关性是一样的。
注意.NET的平台无关性目前只是一种可能,因为在编写本书时,.NET只能用于Windows平台,但人们正在积极准备,使它可以用于其他平台(参见Mono项目,它用于创建.NET的开放源代码的实现,参见http://www.go-mono.com/)。
2. 提高性能
实际上,IL比Java字节代码的作用还要大。IL总是即时编译的(称为JIT编译),而Java字节代码常常是解释性的,Java的一个缺点是,在运行应用程序时,把Java字节代码转换为内部可执行代码的过程会导致性能的损失(但在最近,Java在某些平台上能进行JIT编译)。