Home arrow Python arrow Page 6 - How Python Runs Programs

Future Possibilities? - Python

Python is a language and an interpreter that executes other programs. Get a quick look at program execution, how to launch code and how Python runs it. This chapter is from Learning Python, second edition, by Mark Lutz and David Ascher (ISBN: 0-596-00281-5, O'Reilly, 2003).

  1. How Python Runs Programs
  2. Program Execution
  3. Python Virtual Machine (PVM)
  4. Execution Model Variations
  5. The Psyco Just-in-Time Compiler
  6. Future Possibilities?
By: O'Reilly Media
Rating: starstarstarstarstar / 38
July 06, 2004

print this article



Finally, note that the runtime execution model sketched here is really an artifact of the current implementation, and not the language itself. For instance, itís not impossible that a full, traditional compiler for Python source to machine code may appear during the shelf life of this book (although one has not in over a decade). New byte code formats and implementation variants may also be adopted in the future. For instance:

  • The emerging Parrot project aims to provide a common byte code format, virtual machine, and optimization techniques, for a variety of programming languages (see http://www.python.org).

  • The Stackless Python system is a standard CPython implementation variant, which does not save state on the C language call stack. This makes Python more easily ported to small stack architectures, and opens up novel programming possibilities such as co-routines.

  • The new PyPy project is an attempt to reimplement the PVM in Python itself, in order to enable new implementation techniques.

Although such future implementation schemes may alter the runtime structure of Python somewhat, it seems likely that the byte code compiler will still be the standard for some time to come. The portability and runtime flexibility of byte code are important features to many Python systems. Moreover, adding type constraint declarations to support static compilation would break the flexibility, conciseness, simplicity, and overall spirit of Python coding. Due to Pythonís highly dynamic nature, any future implementation will likely retain many artifacts of the current PVM. 

Buy the book!If you've enjoyed what you've seen here, or to get more information, click on the "Buy the book!" graphic. Pick up a copy today!

Visit the O'Reilly Network http://www.oreillynet.com for more online content.

>>> More Python Articles          >>> More By O'Reilly Media

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Python Big Data Company Gets DARPA Funding
- Python 32 Now Available
- Final Alpha for Python 3.2 is Released
- Python 3.1: String Formatting
- Python 3.1: Strings and Quotes
- Python 3.1: Programming Basics and Strings
- Tuples and Other Python Object Types
- The Dictionary Python Object Type
- String and List Python Object Types
- Introducing Python Object Types
- Mobile Programming using PyS60: Advanced UI ...
- Nested Functions in Python
- Python Parameters, Functions and Arguments
- Python Statements and Functions
- Statements and Iterators in Python

Developer Shed Affiliates


Dev Shed Tutorial Topics: