Python from Wise Guy's Viewpoint

Pascal Costanza costanza at web.de
Sun Oct 26 19:40:11 EST 2003


Joachim Durchholz wrote:

> The next question, however, is whether the programs where the answers 
> differ are interesting.
> There's also a narrow and a broad sense here: obviously, it's not 
> possible to type check all Lisp idioms, but are we allowed to present 
> alternative idioms that do type check and serve the same purpose?

No, and that's exactly the point. "We" can write completely idiomatic 
and well-behaved Lisp code that works, can be understood and maintained 
by other Lispers, and provides various useful additional behavior at 
runtime.

Why should we rewrite it just to make a static type checker happy? 
That's redundant work with no obvious advantages.

Why should we, on the other hand, accept statically type-checked code 
that does less than our straightforward solutions?

We could _additionally_, if we wanted to, write our code in a style that 
is acceptable by a static type checker whithout switching the language. 
We could add a full-blown static type checker to our language and ask 
for a different coding style for those parts of the code that would use 
it. See Qi and ACL2 for two real-world examples.

This is the gist of unrestricted expressive power: we objectively have 
more options! A language that forces your code to adhere to a static 
type system has less options!

You may probably not care about the loss of options. You might even 
think it's an advantage to have less options. But you objectively have 
less options to write well-behaved code!


Pascal





More information about the Python-list mailing list