Pyrex (programming language)
Developer(s) | Greg Ewing |
---|---|
Initial release | 3 April 2002[1] |
Stable release | 0.9.9
/ 12 April 2010 |
Written in | Cross-platform |
Type | Programming language |
Website | www |
Pyrex is a
Python itself only provides a
Pyrex allows the user to write extension modules in a Python-like language which may directly access the external C code. The similarity of Pyrex's syntax to Python's makes it easy to write Python modules, but there are some functional limitations.[3] The programmer must specify the name of C-header files, enumerations, datatypes and functions needing to be accessed in the module, then they can be used as if they were Python objects. The Pyrex compiler will generate the necessary glue code automatically and compile the Pyrex code into a working Python module.[citation needed]
There are tools like SWIG or Python's foreign function library ctypes which can be used for this task without requiring much additional code, but this is limited to making an external library available in Python code.[4][5] If adjustments to the API are needed, glue code must again be written manually.[citation needed]
See also
References
- ^ greg at cosc (3 April 2002). "ANN: Pyrex — a language for writing Python extension modules". Retrieved 24 February 2014.
- ISBN 9780596554613.
- ISBN 9781449379100.
- ISBN 9781441917195.
- ISBN 9780132678209.