Python from Wise Guy's Viewpoint

mike420 at ziplip.com mike420 at ziplip.com
Mon Oct 20 06:28:25 EDT 2003


Duncan Booth wrote:

> mike420 at ziplip.com wrote in
> news:LVOAILABAJAFKMCPJ0F1IFP5N3JTNUL0EPMGKMDS at ziplip.com:
> 
>> 1. f(x,y,z) sucks. f x y z  would be much easier to type (see Haskell)
>>    90% of the code is function applictions. Why not make it convenient?
> 
> What syntax do you propose to use for 

isn't it obvious? What ML, Haskell (and I suppose Dylan) use:

> f(x(y,z)), 

f (x y z)

> f(x(y(z))), 

f (x (y z))

> f(x,y(z))

f x (y z)

> f(x(y),z)

f (x y) z

> f(x)(y)(z)

(((f x) y) z)

In each of these cases, my version uses as many or fewer syntactic elements
(commas and parens) than yours. The problem with Python is that it also 
lacks uniformity here (think "print" and "del").

Now look at some more realistic code

sin(x) + 2 / atan z

sin x + 2 / atan z

the latter is exactly how you would write this in math.

Anyway, I'm not advocating incompatible changes to the language
(that's unrealistic). I'm saying people should be kicked in the nuts when
they try to design their own languages unless they already know a few
*smart* languages (Lisp, Haskell, etc.). Java, C#, Pascall and Basic are not
smart. Also, since many Pythonista aren't programmers, and may never 
learn such smart languages, my aim was to give them a little perspective.

You, Pythonista, are like naive little children who have to be 
taught about the world, while Haskellers and Lispers are 
experienced old men.

But to be _wise_ like me, it's not enough to grow a beard or 
know Lisp or Haskell. You have to know *both*, because they are 
so different, you have to grok monads and master macros.

Lisp is strict, Haskell is lazy
Lisp is dynamically typed, Haskell is statically typed
Lisp has OO, Haskell does not
Haskell uses monadic IO, Lisp does not
Haskell has indentation-based syntax, Lisp uses S-expressions.

When you know both Lisp and Haskell (and maybe a few other 
languages) then other languages seem like small variations
on some old theme (or just plain bad ideas like C# and X++)

Anyway, this discussion is boring me. I'll leave you to
argue amongst yourselves. My job here is done.

420

P.S. Lulu aka David Mertz, I hate to say this, but you are the 
BIGGEST idiot in comp.lang.python I've encountered so far.

P.P.S. You can have O(1) function calls in the interpreter (see Lisp). 
Just one other thing that was done unWISEly in Python.




More information about the Python-list mailing list