欢迎来到毕设资料网! | 帮助中心 毕设资料交流与分享平台
毕设资料网
全部分类
  • 毕业设计>
  • 毕业论文>
  • 外文翻译>
  • 课程设计>
  • 实习报告>
  • 相关资料>
  • ImageVerifierCode 换一换
    首页 毕设资料网 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

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

    • 资源ID:125296       资源大小:37.60KB        全文页数:7页
    • 资源格式: DOCX        下载积分:100金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: QQ登录
    下载资源需要100金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

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

    1、附录 I翻译文献 I. 英文全文 Advantages of Managed Code 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 univ

    2、ersal syntax for code has significant advantages. 1. 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 platfo

    3、rm. 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 imp

    4、lementation of .NET is only available for Windows. However, there is a partial implementation available. 2. 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

    5、), whereas Java byte code was often interpreted. One of the disadvantages of Java was that, on execution, the process of translating from Java byte code to native executable resulted in a loss of performance (with the exception of more recent cases, where Java is JIT compiled on certain platforms).

    6、Instead of compiling the entire application in one go (which could lead to a slow start-up time), the JIT compiler simply compiles each portion of code as it is called (just-in-time). When code has been compiled once, the resultant native executable is stored until the application exits; so that it

    7、does not need to be recompiled the next time that portion of code is run. Microsoft argues that this process is more efficient than compiling the entire application code at the start, because of the likelihood that large portions of any application code will not actually be executed in any given run

    8、. Using the JIT compiler, such code will never be compiled. This explains why we can expect that execution of managed IL code will be almost as fast as executing native machine code. What it doesnt explain is why Microsoft expects that we will get a performance improvement. The reason given for this

    9、 is that, since the final stage of compilation takes place at runtime, the JIT compiler will know exactly what processor type the program will run on. This means that it can optimize the final executable code to take advantage of any features or particular machine code instructions offered by that p

    10、articular processor. Traditional compilers will optimize the code, but they can only perform optimizations that are independent of the particular processor that the code will run on. This is because traditional compilers compile to native executable before the software is shipped. This means that th

    11、e compiler doesnt know what type of processor the code will run on beyond basic generalities, such as that it will be an x86-compatible processor or an Alpha processor. Visual Studio 6, for example, optimizes for a generic Pentium machine, so the code that it generates cannot take advantage of hardw

    12、are features of Pentium III processors. On the other hand, the JIT compiler can do all the optimizations that Visual Studio 6 can, and in addition itwill optimize for the particular processor the code is running on. 3. Language interoperability The use of IL not only enables platform independence; i

    13、t also facilitates language interoperability. Simply put, you can compile to IL from one language, and this compiled code should then be interoperable with code that has been compiled to IL from another language. Youre probably now wondering which languages aside from C# are interoperable with .NET,

    14、 so lets briefly discuss how some of the other common languages fit into .NET. (1)Visual Basic .NET Visual Basic .NET has undergone a complete revamp from Visual Basic 6 to bring it up-to-date with .NET. The way that Visual Basic has evolved over the last few years means that in its previous version

    15、, Visual Basic 6, it was not a suitable language for running .NET programs. For example, it is heavily integrated into COM and works by exposing only event handlers as source code to the developer most of the background code is not available as source code. Not only that, it does not support impleme

    16、ntation inheritance, and the standard data types Visual Basic 6 uses are incompatible with .NET. Visual Basic 6 was upgraded to Visual Basic .NET, and the changes that were made to the language are so extensive you might as well regard Visual Basic .NET as a new language. Existing Visual Basic 6 cod

    17、e does not compile as Visual Basic .NET code. Converting a Visual Basic 6 program to Visual Basic .NET requires extensive changes to the code. However, Visual Studio .NET (the upgrade of VS for use with .NET) can do most of the changes for you. If you attempt to read a Visual Basic 6 project into Vi

    18、sual Studio .NET, it will upgrade the project for you, which means that it will rewrite the Visual Basic 6 source code into Visual Basic .NET source code. Although this means that the work involved for you is heavily cut down, you will need to check through the new Visual Basic .NET code to make sur

    19、e that the project still works as intended because the conversion might not be perfect. One side effect of this language upgrade is that it is no longer possible to compile Visual Basic .NET to native executable code. Visual Basic .NET compiles only to IL, just as C# does. If you need to continue co

    20、ding in Visual Basic 6, you may do so, but the executable code produced will completely ignore the .NET Framework, and youll need to keep Visual Studio 6 installed if you want to continue to work in this developer environment. (2)Visual C+ .NET Visual C+ 6 already had a large number of Microsoft-spe

    21、cific extensions on Windows. With Visual C+ .NET, extensions have been added to support the .NET Framework. This means that existing C+ source code will continue to compile to native executable code without modification. It also means, however, that it will run independently of the .NET runtime. If

    22、you want your C+ code to run within the .NET Framework, then you can simply add the following line to the beginning of your code: #using You can also pass the flag /clr to the compiler, which then assumes that you want to compile to managed code, and will hence emit IL instead of native machine code

    23、. The interesting thing about C+ is that when you compile to managed code, the compiler can emit IL that contains an embedded native executable. This means that you can mix managed types and unmanaged types in your C+ code. Thus the managed C+ code: class MyClass defines a plain C+ class, whereas th

    24、e code: _gc class MyClass will give you a managed class, just as if youd written the class in C# or Visual Basic .NET. The advantage of using managed C+ over C# code is that we can call unmanaged C+ classes from managed C+ code without having to resort to COM interop. The compiler raises an error if

    25、 you attempt to use features that are not supported by .NET on managed types (for example, templates or multiple inheritances of classes). You will also find that you will need to use nonstandard C+ features (such as the _gc keyword shown in the previous code) when using managed classes. Because of

    26、the freedom that C+ allows in terms of low-level pointer manipulation and so on, the C+ compiler is not able to generate code that will pass the CLRs memory type safety tests. If its important that your code is recognized by the CLR as memory type safe, then youll need to write your source code in s

    27、ome other language (such as C# or Visual Basic .NET). (3)Visual J# .NET The latest language to be added to the mix is Visual J# .NET. Prior to .NET Framework 1.1, users were able to use J# only after making a separate download. Now the J# language is built into the .NET Framework. Because of this, J

    28、# users are able to take advantage of all the usual features of Visual Studio .NET. Microsoft expects that most J+ users will find it easiest to use J# if they want to work with .NET. Instead of being targeted at the Java runtime libraries, J# uses the same base class libraries that the rest of the

    29、.NET compliant languages use. This means that you can use J# for building ASP.NET Web applications,Windows Forms, XMLWeb services, and everything else that is possible just as C# and Visual Basic .NET can. (4)Scripting languages Scripting languages are still around, although, in general, their importance is likely


    注意事项

    本文(外文翻译---托管代码的优点)为本站会员(泛舟)主动上传,毕设资料网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请联系网站客服QQ:540560583,我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们
    本站所有资料均属于原创者所有,仅提供参考和学习交流之用,请勿用做其他用途,转载必究!如有侵犯您的权利请联系本站,一经查实我们会立即删除相关内容!
    copyright@ 2008-2025 毕设资料网所有
    联系QQ:540560583