Monday, December 8, 2008

Python: Not for real software development

Some guys at the job wanted to deploy some software they made in Python. And that's when the problems started. Turns out they want to embed all the libraries they used - they want to include all of them so that the end user won't have to move a finger. Just run the binary installer, and voila (just like in Windows).

But guess what, turns out python doesn't let you choose which path you want to run some libraries from (not the .py plugins, but the .so the plugins depend on). They tried setting up LD_LIBRARY_PATH (or whatever it's called, I don't remember), other environment variables, and nothing.

Just because the program in particular depends on some python bindings to some libraries.

My question is, what the hell was Python made for? For quick-and-dirty configuration scripts to come by default in Linux distros? Maybe. For students to learn programming? Probably. For real software development? IN YOUR DREAMS.

See, everything is perfect in Python (metaphorically speaking, of course - NOTHING is ever perfect in Python) until you face the problem of deploying your python program on a variety of machines running different Linux distros, and you want the program to run WITHOUT HAVING THE USER MOVE A FINGER. Turns out you can't. If the user needs to open the commandline, you know you've failed.

So what should I compare Python to?

A sandbox for kids to make their sand castles. Sure, they can be wonderful castles - they can have bells and whistles! Even better, they can be LEGO castles! But try to move them away from the sandbox (your development environment), and they'll crumble.

A sandbox. That's what Python really is about, isn't it? Hey, at least in Java you could embed everything your program needed!

My Solution

My solution is simple: Copy the most used python functions, classes, etc. and their parameters. And why stop at that? You can copy the most useful functions from PHP. Add a variant class, it's simple.

Then bundle all those functions and classes in "libeasycpp".

Voila. You can have all the rapid prototyping you had in python. And it will work on any setup because it's compiled to a binary executable!

There! Was it that difficult?

No comments: