A Brief Overview of Python


Python is a dynamic, object-oriented language. Now more than 10 years old, its popularity has been slowly growing to the point where it often ranks highly in polls for most popular programming language, and many books and companies are dedicated to its support. Although Python has a UNIX heritage, it is very much at home on the Windows platform, with support for many Windows-specific services, including COM, Active Scripting, and NT Services.

This appendix describes an exploratory implementation of the Python language for the .NET Framework. It introduces Python and the existing Python implementations , and then describes the scope and utility of the Python for .NET compiler. Finally, the limitations in the existing compiler and an alternative implementation strategy are discussed.

Portions of this appendix have been taken from various documents distributed with the Python for .NET compiler and from the official Python Web site (http://www.python.org).

About Python

Python is a dynamic, high-level, interpreted, interactive, object-oriented language that is often compared to Tcl, Perl, Scheme, or Java. First publicly released in 1991 under a very liberal license, Python has since grown to generally rank very highly in programming language surveys.

Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high-level dynamic data types, and dynamic typing. There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). New built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface.

This extensibility has allowed developers to build interfaces to native system services. Microsoft Windows provides an excellent case in point; extensions to Python on Windows have been developed that allow Python to use COM/ActiveX and much of the native Win32 API, including obscure features such as Services, Overlapped IO, IO Completion Ports, and so forth.

Python Implementations

Until a few years ago, there was exactly one implementation of the Python language. This implementation, written in C, is the cornerstone of all Python development; it is the only official implementation of the language.

In 1998, the first version of JPython (since renamed Jython) was released, an implementation of the Python language written in (and certified as) 100% pure Java. This release was significant for two reasons. First, it forced the Python language to make a clear distinction between Python-the-language and Python-the-implementation; until then, the implementation itself was considered the de facto language specification, even though a formal specification already existed. Second, Jython opened the Python door to a whole new range of programmers and solutions, as Python could now be used in almost any Java program.

At this time when this appendix was written, the original C implementation and Jython were the only two mainstream implementations of Python. Some smaller implementations have been started, but none has gathered enough critical mass to be used in the general Python community.

The Python for .NET implementation of Python is but a fledgling, created in early 1999 by Mark Hammond and Greg Stein. Although continuing maintenance is performed by Mark, either additional support or a grass-roots open -source effort will be required before this implementation could be considered viable . The implementation can be found at http://starship.python.net/crew/mhammond/dotnet.

Terminology

The term Python will often be ambiguous in this document. Therefore, the following conventions are used:

  • CPython: The original, existing implementation of Python written in C, currently at version 2.2

  • Jython: An implementation of Python that targets the Java Virtual Machine

  • Python for .NET: [1] The implementation of Python that targets Microsoft .NET; the topic of this appendix

    [1] Our preferred name for this project is simply Python.NET , but the issue of using the trademarked .NET in this manner, plus the existence of the python.net Internet domain makes this issue murky. Therefore, we have adopted the safe Python for .NET.

Whenever the term Python is used alone, it will refer to the Python language specification [2] rather than a specific implementation.

[2] http://www.python.org/doc/current/ref/.



Programming in the .NET Environment
Programming in the .NET Environment
ISBN: 0201770180
EAN: 2147483647
Year: 2002
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net