Scott Robinson (quadhome) wrote,
Scott Robinson

CPython sucks

You heard it here, not exactly first. I hate the GIL. Python is a great language, I recommend it to anyone learning or prototyping. However, I do not recommend it as an implementation language for anything CPU-bound.

Oh, it's said you can use multiple processes, C extensions, psyco, or pyrex. But mostly, those are all lies.

Multiple processes need to be able to communicate between each other, and cPickle isn't GIL friendly so you'll be killed by serialization costs. (And don't talk to me about POSH, it doesn't even work in 2.4.)

C extensions and pyrex both suffer from the GIL, if you want to get data boxed/unboxed. They're also near impossible to get correct without automatic code generation. See also the fact every GNOME/freedesktop binding uses a code generator.

psyco is voodoo magic. It's incredible, when it works. However, don't push it too hard or it might break. This includes fun with the GIL or threading. Oh, and portability.

Fuck you, CPython - I'm sick of defending you. In a month or so, when I'm responsible for several thousand lines of Python code people be caring about, I won't be looking to you anymore. IronPython and Mono seem to have a nice license...

Honestly, I just wish there was a well supported, well implemented VM that wasn't totally proprietary. It would save the computer industry millions of dollars, but no one will ever make the commitment.
Tags: spewing
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.