[Fwd: Re: [Uuu-devel] languages] <-- Why Python

Donn Cave donn at drizzle.com
Sun Feb 20 00:35:43 EST 2005


Quoth Nick Coghlan <ncoghlan at iinet.net.au>:
[... re Python OS interface vs. language-generic model ]

| *Allowing* other languages is one thing, but that shouldn't preclude having a 
| 'default' language. On other OS's, the default language is some form of shell 
| scripting (i.e. Unix shell scripts, or Windows batch files). It would be good to 
| have a real language to fill that role.

I don't know what the Windows version is like, but for all the UNIX
shell's weaknesses, it's very well suited to its role.  The Plan 9
shell (rc) is similar with much improved syntax, and has a distant
relative "es" that I think is the closest thing I've ever seen to
a 1st class language that works as a shell (though the implementation
was only at the proof of concept level.)  (I'm not forgetting REXX,
it's a fairly respectable effort but not 1st class.)

...
| Still, the builtin shell is going to need *some* form of scripting support. An
| if that looks like IPython's shell mode, so much the better.
|
| Anyway, the reason to prefer Python to LISP for something like this, is that 
| Python reads much more naturally for most people, whereas LISP requires that y
| write things 'out of order'.
|
| Compare out-of-the-box Python:
|    a = 1 + 2 + 3 + 4
|
| And out-of-the-box Lisp:
|    (setq a (+ 1 2 3 4))
|
| Which language has the lower barrier for entry? That should be a fairly 
| important consideration for a language that is going to sit at the heart of an OS.

Well, honestly I think that's stretching it.  Your order issue here
seems to apply only to operators, and they don't really figure that
heavily in the kinds of things we normally do with the OS.  The only
operator I can think of in "rc" is ^, an odd sort of string multiplication
thing, and I can't think of any in the original Bourne shell.

Meanwhile, the idea that barriers to entry are built out of things like
"+ 1 2 3 4" vs. "1 + 2 + 3 + 4" is really quite open to question.

10 years ago when BeOS was a little hotter than it is today, there were
a couple enthusiasts pushing Python as an official language.  A few of
the people following BeOS at that point had come from a strong Amiga
background, and I remember one of them arguing vehemently against Python
because its arcane, complicated syntax was totally unsuited to casual use.
Compared to, say, REXX.

Now, we Python users know very well that's not true, Python's as clear
as could be.  But theoretically, if you wanted to talk about order
issues, for example ... is it really easier to understand when a language
sometimes expresses a function f over x and y this way
    f(x, y)
sometimes this way (+ is a function, really)
    x f y
and sometimes this way
    x.f(y)
?

I don't know, I'm just thinking that while Python's notation might
be just fine for people who've gotten here the way most of us have,
it's not obvious from this that it's just fine 4 everyone.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list