What python can NOT do?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Aug 29 07:21:08 CEST 2009

On Sat, 29 Aug 2009 05:37:34 +0200, Tomasz Rola wrote:

> My private list of
> things that when implemented in Python would be ugly to the point of
> calling it difficult:
> 1. AMB operator - my very favourite. In one sentence, either language
> allows one to do it easily or one would not want to do it (in an ugly
> way).
> http://www.randomhacks.net/articles/2005/10/11/amb-operator

Fascinating, but I don't exactly see how that's actually *useful*. It 
strikes me of combining all the benefits of COME FROM with the potential 
performance of Bogosort, but maybe I'm being harsh. 

On the other hand, it sounds rather like Prolog-like declarative 
programming. I fear that, like Prolog, it risks massive performance 
degradation if you don't apply the constraints in the right order.

> 2. Changing the language from the inside.
> Everybody can change the interpreter, right? But how about doing some
> bigger, maybe even fundamental change to the language by means offered
> by the language itself?

Like Forth. You need it in Forth, because it has a very sparse set of 
language features, and everything is bootstrapped from a small set of 
commands, so the ability to re-define the language as you go is (1) 
necessary and (2) free.

But for Python, I don't know... it sounds cool, but in practice? It 
sounds like the sort of thing that allows programmers to spend three 
hours writing a new control structure which will save them three minutes.

And of course, for all but the tiniest, one-man-band applications, 
readability is important. Sure, you've created a gee-whizz control 
structure which combines try, while and if into one keyword, and it 
automatically does logging and threading, fantastic. But how will anyone 
else be able to maintain it when you're gone?

The ability to change the language is one step into a tarpit, where 
everything is possible but nothing is easy, and where you spend all your 
time writing language features and none of your time building the useful 
functionality you actually want. It sounds like something you want in a 
language you use for designing languages, rather than writing 


More information about the Python-list mailing list