News for hackers. Stuff that matters.
Re:Navigating the Postmodern Python World by gcr on Thursday July 11, 2013 @04:25PM (#6028972)
Consider looking into Cython, a Python-->C source translator.

http://docs.cython.org/index.html

Cython can turn Python source into a binary `.so` that you import, thus removing the overhead of the bytecode compiler/interpreter.

You can also annotate any or all of your Python variables with C types. This way, Cython will generate raw high-performaning C using Python syntax. Other Python functions can call your optimized C versions, allowing you to optimize only the hotspots.

Further, if you need to integrate with other languages, Cython can import other libraries' C functions and call them. Conversely, it can generate a header file for your Cython code, thus allowing other languages like C to call your existing Python or Cython functions.

Re:Navigating the Postmodern Python World by mercurial on Friday July 12, 2013 @04:27AM (#6031564)
My experience with Cython is limited to some hacking on lxml, but I found the compilation phase extremely slow. So, sure, you get performance but you get a big hit in terms of development speed.
Re:Navigating the Postmodern Python World by chadzawistowski on Friday July 12, 2013 @09:30AM (#6032455)
I don't recall Cython's default optimization level, but you may be able to decrease compilation time by adding a -O0 flag for debug builds. This StackOverflow question addresses adding optimization flags to a Cython setup.py script: http://stackoverflow.com/q/16285011/1628916
Re:Navigating the Postmodern Python World by gcr on Tuesday July 16, 2013 @09:59PM (#6055752)
Huh. I find that if you have a short cython script, you can just hack aruond in the IPython Notebook. Evaluating a 200-line cython script takes under a second for me, which is fine for my purposes.