On Language Choice

I’m still a huge fan of Python. Fantastic library support, generally available everywhere, an excellent REPL, and a stable package manager. Python also tends towards being cleanly expressive - there’s a great story at Google about a candidate who asked to write in pseudo-code and produced valid Python. Python is also old enough to have great Win32 bindings, Microsoft Excel bindings, and I’ve even managed to get it to speak Cocoa on occasion. If you don’t think this is important you’ve probably never worked with non-engineers.

I’ve managed to write fairly complex multi-threaded code on the firs try thanks to Eventlet - it’s still the most painless way to add concurrency I’ve ever seen in any language. Bottle has driven every one-off RPC system I’ve thrown together - and there have been many.

However…the GIL. Many smart folks have beaten it to death, so I will not. Python is not, in general, the fastest option - nor the slowest, but there is a wall. I’m sure eventually someone will solve typing - after I’ve been dead and buried a minimum of forty years - but for now it is quite easy to leave time bombs in production code. The 2-to-3 cliff is rapidly approaching and some of the crustier py2 code is why I keep coming back to the language. (Some systems now default to python3 - which is infuriating.)

I don’t have a Next Big Language recommendation. I still break out Python for almost every small-to-medium project (and every one-off.) That said, I’m learning Go. It is an amazing language for writing servers - Krzysztof Kowalczyk, writer of SumatraPDF (the best PDF reader you’re not using) has some nice post-mortem thoughts on his blog. I’ve also written some non-trivial ObjC<->Go code.

Creating binaries is a special circle of Python hell. (This is true of every interpreted language.) Creating distributable apps is also fairly terrible - you’d think someone would figure out how to reliably freeze a virtualenv, and Terrarium is trying, but it fails the non-engineer test. Hard. I love pip, but getting extensions that require compilation to work with it on Windows (again, for non-engineers) is a painful process that more or less requires administrative access - luckily, a great guy by the name of Christoph Gohlke publishes some of the critical ones here.

I’m hoping Go will hit a number of sweet spots - faster than Python, almost as expressive as Python, easy to distribute binaries, etc. Too soon to call.

Fun fact: this blog is generated using Hugo and it’s lovely.


comments powered by Disqus