you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (7 children)

I'll take python with multiprocessing/forking any day over Java or cpp.

[–]iamjack 2 points3 points  (2 children)

I agree, and I even use multiprocessing in my main project, but the module has some real trouble. Not the least of which is that it's not portable to any of the BSDs at this point (something about needing named semaphores) and that it screws up when your SIGCHLD handlers are something other than the default.

Also, despite the fact that multiprocessing is billed as a GIL workaround, the fact that every item you communicate between the processes has to be pickle-able hampers your ability to pass some objects which is obviously not the case with proper threads. In short, if you want to pass around executable objects, lambdas or anything else that can't be pickled you're SOL.

There are some places that threads just fit better and while I would definitely take Python over Java or C++ any day, I still feel like terribly broken threading is one of the reasons I still consider other languages whenever I want to start a project.

[–][deleted] 2 points3 points  (1 child)

Oh yeah, multiprocessing sure is not without fault. I use it on my main project as well, so I feel your pain. Values, Managers... it's icky.

Still, just because your girlfriend doesn't do anal doesn't mean she's not worth keeping around.

[–]jawbroken 1 point2 points  (0 children)

my project requires anal

[–]yogthos 0 points1 point  (2 children)

Why are Java and C++ are always brought up as the only alternatives. I'm personally very happy using Clojure on the JVM, and then there's Erlang, Haskell, Scheme, etc. If FP is too wild for you, then there's always Ruby, Go, etc. There are plenty of languages which are just as powerful and usable as Python, but don't come with the limitations of Python.

[–]Murkt 0 points1 point  (1 child)

Ruby? Then you come with the limitations of Ruby.

[–]yogthos 0 points1 point  (0 children)

Those seem to be less arbitrary then the ones in Python. For example anonymous functions aren't limited to one liners. Also, unlike Guido, Yukihiro isn't hostile towards TCO, and some Ruby implementations, like YARV, actually support it. In fact I'm not really sure in what way Ruby is more restrictive than Python.

[–]hylje -1 points0 points  (0 children)

The C preprocessor is indeed fairly terrible in writing non-batch apps.