I’m happy to announce the initial public release of CodePy, a native-code Metaprogramming toolkit for Python.

The idea is the following:

  • You build a string that is actually C code.
  • CodePy compiles it, links it, and dynamically loads it into the Python interpreter.

Ta-da: Instant native-code performance, with no explicit pre-compilation step. CodePy can also help you with the generation of the code, by letting you build a data structure and turning that into C code. CodePy works well with Boost.Python and PyCuda. In conjunction with the latter, it offers an easy way of doing GPU Metaprogramming, a very effective tuning technique for the GPU.