devork

E pur si muove

Cross platform shell scripts

Thursday, September 24, 2009

At work we have an rather elaborate collection of shell scripts that builds our softweare and all it's dependencies on about 7 UNIX variants as well as on Windows. Shell seemed like a good choice when we started to write those scripts: it is available on all hosts (using Cygwin on Windows) and with some care you can do most task in a portable way, ssh and scp are at your fingertips to do things on remote hosts without any extra hassle etc.

The thing I didn't realise is just how extrordinary expensive forking is on Windows. And when having lots of shell that's what you're doing all the time (cut, tr, grep, awk, ...), on UNIX you generally don't even notice it but on Windows it just grinds to a halt.

This basically means I'm slowly moving to replacing the scripts in Python. Each time I need to modify something I consider the cost of re-writing it in Python and of keeping it in shell. Some critical parts are already replaced by Python code and the speedup is impressive.

So next time you need cross-platform scripts, think about how much work it will need to do on Windows. Forking is expensive. Sadly.

Battery life

Wednesday, September 23, 2009

Normally I'm quite happy with the 3h of battery life of my laptop, it covers all my disconnected time on trains etc. But it just doesn't cut it on a 10h flight, especially painful if my brain has loads of ideas to try out and things to do.

New Delny release

Sunday, September 20, 2009

A few days ago I got another of those two-a-year inquiries about Delny, the python wrapper around Qhull for Delaunay triangulations. But increadably indirectly it finally got me to do a new release, it's only been a few years since the last one! Nothing has changed really, the only difference it that it finally uses numpy to compile instead of the deprecated numeric

I've also taken the opportunity to move the revision control to mercurial and host it on bitbucket. And uploaded the tarball to PyPI, not sure why I didn't do that before.

Hope this keeps being of use to some people.

Subscribe to: Posts (Atom)