• IronPython Architecture


    IronPython

      IronPython is an implementation of the Python programming language written by the CLR team at Microsoft. IronPython runs on the Microsoft® .NET Framework and supports an interactive console with fully dynamic compilation

      It is well integrated with the rest of the .NET Framework and makes all .NET libraries easily available to Python programmers, while maintaining full compatibility with the Python language.

      This column will give a brief overview of Python and what sets dynamic languages apart from other languages. I will discuss iterative development, describe how IronPython integrates with .NET while staying true to Python syntax, and show the advantages of using IronPython to utilize .NET.

    Dynamic Languages and Iterative Development

      Dynamic programming languages allow for a program's structure to be changed while it runs: functions may be introduced or removed, new classes of objects may be created, and new modules may appear. These languages are usually dynamically typed, allowing variable declarations to change type during execution. But just having dynamic types does not make a language dynamic. 

      观点一:仅仅有dynamic type并不能让一门语言成为动态语言,如Objc,有动态类型,但并不是动态语言。

      he most common question I hear about dynamic languages is "why should I use them?". One concrete benefit of dynamic languages is that they facilitate an iterative development cycle. Interactive console, a high-level syntax, and extensive standard libraries.

    How the .NET Framework Fits In

      观点二:所有语言都提供类似的库,如网络、GUI、集合、数据库、单元测试等。每一种语言都有各自的一套实现,对于多语言Coder来说每学一种语言就要掌握其背后的一堆库,非常痛苦。

      The .NET Framework is intended to be a single runtime engine for many programming languages. It does this via a shared byte code intermediate language, just-in-time (JIT) and ahead-of-time compilers, a highly tuned garbage collector, and reflection and dynamic loading support. The academic world has envisioned this common runtime for decades, but .NET is the first runtime engine with many languages used in production today. Microsoft maintains .NET support for C#, Visual Basic®, C++, J#, and JScript®, while others have integrated languages like Eiffel, COBOL, FORTRAN, RPG, and Delphi with .NET.

      The common language runtime (CLR) enables deep integration among languages; a single project could use many languages that work together seamlessly. This allows developers to choose the best language for the problems they are trying to solve, rather than settling on one language. 

    IronPython Architecture

      IronPython uses a common type of compiler architecture; the noticeable difference is in code generation. The IronPython byte code is MSIL, intermediate language for the CLR, and will eventually be converted into native code (see Figure 4), whereas CPython (the standard Python implementation, done in the C language) has a runtime loop that interprets its byte code.

      IronPython先被解析成MSIL,后再转成Native Code执行。而CPython是转成字节码,然后被虚拟机执行。注意区别在于,一个是NativeCode执行,一个是字节码(由虚拟机执行)。

        

      IronPython has two important, often-conflicting goals: it needs to be seamlessly integrated with .NET and it needs to be a true implementation of the Python language.

      

      To utilize additional .NET libraries, the clr module must be imported and then specific assemblies referenced. The additional library assemblies can then be imported and used seamlessly. Once the library is imported, it can be used just as before.

      

    参考:http://msdn.microsoft.com/zh-cn/magazine/cc300810(en-us).aspx

      

  • 相关阅读:
    对同一个对象绑定多个响应事件并都执行
    IO流读取与写入文件+SQL替换更新字段脚本
    去掉所有HTML标记或取出匹配HTML标记间的文本
    CS程序启动后定时循环执行Clock_Elapsed事件Timer控件
    SQL新建登录帐户,并为新帐户建立安全帐户,并授予访问数据库的角色
    WEB服务的调用与调试
    SQL修改约束
    删除数据库的所有存储过程、主键、外键、索引等
    用SQL直接将文件内容导入数据表中
    将上传文件以二进制形式存入数据库中,并下载数据库中的二进制数据生成对应的文件
  • 原文地址:https://www.cnblogs.com/tekkaman/p/4135509.html
Copyright © 2020-2023  润新知