3.4 Writing Extensions in Other Languages

While C is in some sense the most natural language to write Python extensions in - Python is implemeted in C, after all - it's not the only choice. The next most likely choices are C++ or Pyrex (also, scientific users fairly frequently wrap libraries written in Fortran).

Extensions written in other languages will be using the C interfaces on some level, so knowing about them doesn't do you any harm.

C++ is an obvious choice if you are writing a wrapper to a library written in C++, or if you just plain prefer C++ to C. The most commonly used library is boost.python (or Boost::Python?), but there are a variety of alternatives. XXX links, details, perhaps a toy example.

Pyrex is a relatively new Python-like lanuage designed specifically for writing Python extensions. XXX links, details, toy example.

Something about f2py?? SWIG??

THIS DOCUMENT IS A DRAFT! Comments to mwh@python.net please.