12.07.2015 Views

Is Python a

Is Python a

Is Python a

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Future Possibilities?Finally, note that the runtime execution model sketched here is really an artifact ofthe current implementation of <strong>Python</strong>, and not the language itself. For instance, it’snot impossible that a full, traditional compiler for translating <strong>Python</strong> source code tomachine code may appear during the shelf life of this book (although one has not inover a decade). New byte code formats and implementation variants may also beadopted in the future. For instance:• The emerging Parrot project aims to provide a common byte code format, virtualmachine, and optimization techniques for a variety of programming languages(see http://www.python.org).• The Stackless <strong>Python</strong> system is a standard C<strong>Python</strong> implementation variant thatdoes not save state on the C language call stack. This makes <strong>Python</strong> more easilyported to small stack architectures, and opens up novel programming possibilities,such as coroutines.• The new PyPy project is an attempt to reimplement the PVM in <strong>Python</strong> itself toenable new implementation techniques.Although such future implementation schemes may alter the runtime structure of<strong>Python</strong> somewhat, it seems likely that the byte code compiler will still be the standardfor some time to come. The portability and runtime flexibility of byte code areimportant features of many <strong>Python</strong> systems. Moreover, adding type constraint declarationsto support static compilation would break the flexibility, conciseness, simplicity,and overall spirit of <strong>Python</strong> coding. Due to <strong>Python</strong>’s highly dynamic nature, any futureimplementation will likely retain many artifacts of the current PVM.Chapter SummaryThis chapter introduced the execution model of <strong>Python</strong> (how <strong>Python</strong> runs your programs)and explored some common variations on that model (just-in-time compilersand the like). Although you don’t really need to come to grips with <strong>Python</strong> internalsto write <strong>Python</strong> scripts, a passing acquaintance with this chapter’s topics will helpyou truly understand how your programs run once you start coding them. In thenext chapter, you’ll start actually running some code of your own. First, though,here’s the usual chapter quiz.32 | Chapter 2: How <strong>Python</strong> Runs Programs

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!