官术网_书友最值得收藏!

Looking at other Python interpreters

This book will focus on a particular implementation of Python called the CPython. What this means is that Python—the abstract language—can be processed by a variety of concrete Python runtimes or implementations. The CPython implementation is written in portable C and can be recompiled for many operating systems.

Python can be embedded into an application. This means that a complex application can include the entire Python language as a way to write scripts that customize the given application. One example of this is the Ganglia monitoring system (http://ganglia.sourceforge.net). Python is part of the system; we can customize the behavior using Python scripts that will interact with Ganglia components. We won't be looking more deeply into these kinds of applications in this book; we'll focus on standalone implementations of Python.

There are several alternative Python implementations. In the Installing Python on Windows section in this chapter, we noted that Iron Python (http://ironpython.net) and PTVS (http://pytools.codeplex.com) are available. These provide tighter integration with the .NET framework.

There are still more implementations that we might encounter:

  • Jython: This is a version of the Python interpreter that is written in Java and runs on the Java Virtual Machine (JVM). See http://www.jython.org. This project focuses on Python 2.7.
  • PyPy: This is a version of the Python interpreter written in Python. See http://pypy.org. The circularity of "Python written in Python" is broken by the RPython translation toolchain, which creates a very sophisticated implementation of Python programs. This can provide significant performance improvements for a variety of long-running applications, such as web servers.
  • Stackless: This version of Python has a different threading model from CPython. See http://www.stackless.com. This version can provide dramatic performance improvements for multithreaded servers.

Since the Python source is readily available, it's quite easy to look for optimization opportunities. The language is relatively simple, allowing experimentation to see what effect changes in implementation may have.

主站蜘蛛池模板: 山丹县| 兰州市| 茌平县| 墨竹工卡县| 新昌县| 通山县| 宁蒗| 鄯善县| 兴宁市| 泽州县| 南投县| 武冈市| 岢岚县| 江城| 夏津县| 铜川市| 泽州县| 诸城市| 中卫市| 石楼县| 庆元县| 班玛县| 临西县| 逊克县| 榆社县| 神木县| 酉阳| 芷江| 海林市| 北票市| 徐汇区| 林甸县| 崇明县| 安图县| 阿拉善左旗| 卢湾区| 高邮市| 门源| 金塔县| 北安市| 高雄县|