[http://pexlang.sourceforge.net Pex] is a preprocessor for Cython developed at PnyLab LLC.
Pex provides important experience and Cython will provide almost identical capabilities, but through a more general mechanism: [:enhancements/buffer: Supporting the buffer PEP natively].
Automatically generating __reduce__ and __setstate__ is a Cython goal and is already done by Pex.
Pex has a pragma syntax that Cython will probably not adopt; although the feature seems to be very valuable. One can either polish the syntax a bit, or fine some subset of module header comments, decorators and with statements. Command-line pragmas should of course be supported. (Config files? Isn't that what setup.py is?) Perhaps syntax similar to specifying the encoding [http://www.python.org/dev/peps/pep-0263/ PEP 263]
Dan made a very good point that exceptions should always be propagated, at least by default, rather than strange behaviour being the default. We'll look into this.
Pex is able to automatically create fast dump/load methods for simple classes. While useful, this seems to be more in the application domain than language domain because it is so tightly coupled with trade-offs determined by the type of data, type of inter-object references etc.. At the same time, it's a very useful feature. Ways this can be handled:
- FastIO (from Pex) can perhaps be ported as a Cython plugin module
- Metaprogramming would solve this in a generic way, allowing one to have multiple kinds of such serialization
- One could look into existing C libraries for this and provide hooks at the right API level
We would phase out cimport, letting cimport automatically be an import if the pxd (or, as above, pyx) file can be located.
Cython didn't reach a conclusion; it's the kind of things that are nice to have while they don't fit into emulating Python. Metaprogramming would solve this too ("compile-time metaclass support"?) or a method generator of sorts
Pex has system that mimics the Python import statement; one can simply invoke pex on a px sourcefile (or use the pex module from Python to import a px file) and pex will automatically rebuild the appropriate files and import them.
There could be potential for direct code reuse in this area.
- The modules gets hooks added to do sanity checks for .so file time stamps, so that Python import won't coredump if there's a build problem.
- The Python pex module does magic stack inspection in order to do the right import, might want to look at that
Sourcefiles in pex can carry information about their include paths. Cython may provide something similar but in a much more declarative syntax.