Python should try to displace Java

Alex Martelli aleax at aleax.it
Wed Aug 20 13:00:13 EDT 2003


Doug Tolton wrote:
   ...
> designed to be a scalable scripting language.  Python wasn't designed
> to be a replacement for C++ to my knowledge.  Are you saying that
> python was designed to be a replacement for C / C++ for building large
> scale systems?  If so I'm suffering under a mis-apprehension of what
> Python is all about.

Even though Python was NOT specifically designed for "building large
scale [software] systems" when it was born over 12 years ago, it does
"happen" to be excellent for the job.  Not just my opinion -- e.g.,
Mitch Kapor and his OSAF chose Python as the application-programming
language for the Chandler system, and if you look at the specs for
that ambitious undertaking you'll see it WILL be quite a large-scale
system when it matures.

Of course, part of what helps is that Python is substantially
higher-level than the other languages you're considering (most
particularly C): given a system's total functionality, measured
say in "Function Points", you can rely on the system SIZE (in
terms, say, of lines of code) being VERY substantially smaller
when you program it in Python.

C and C++, rather than being "replaced", are "re=positioned" at
doing what they're best at -- making libraries of stuff that must
run fast and in very memory-lean ways.  Python is ideal to build
applications, and systems, out of those "raw materials" (as well,
very often, at prototyping the libraries themselves).


> I'm using System in the generic sense rather than the specific sense
> of Operating System.

Yep, same here.  Although in the expression "system programming"
it IS more often than not an _Operating_ system that is meant.


> It isn't a matter of whether it can be done in Python.  You can write
> anything in assembly for that matter, the reason you don't is
> typically productivity.  That doesn't mean you shouldn't write
> anything in Assembly does it?

Of course!  Kapor and friends didn't choose Python because "it could
be done that way"; their purpose is making Chandler a great product,
and their motivation for choosing Python is that they believe it will
let them pursue that purpose with maximum productivity.  I happen
to agree with them (and, just like them, I come from long experience
with other languages such as C, C++, and Java).


> I don't know how stating the obvious 'that some languages are better
> at some tasks than other languages' would be considered a troll.

With such genericity, it could hardly offend anybody (and it would
be just as unlikely for the super-generic assertion to prove USEFUL
to anybody, of course:-).  But as soon as you get down to specifics,
it gets more interesting (in all senses of the word "interesting":-).

Why Java's inability to treat classes, functions etc as first-class
objects, or the copious and tedious boilerplate it requires, should
make it better than Python at putting together very large applications
and systems of applications, for example, is anything but obvious (to
me, at least).  Say, for example, that one believes Java's strength
is not the language itself, but the huge collection of libraries and
frameworks; then, since once can access those same libraries and
frameworks with the Jython implementation of Python, one might still
perfectly sensibly believe that the best way to put together large
applications and systems out of those wonderful libraries & frameworks
is still Python (just like it is when the libraries &c are in C/C++).

Until and unless somebody tries to build the SAME large application
several times with different languages (unlikely!), it will be hard
to get reliable data.  I do remember from the recent past, just as I
was stepping out of the CAD / PDM world, that one of our competitors'
marketing was making hay from the fact that they had entirely
rewritten their major system, from Java to C++, with untold benefits
in speed, memory consumption, and the like.  Of course, _our OWN_
marketing quietly replied that OUR systems had always been in C++
and the fact that we'd never pursued the (by our competitors' own
admission) blind alley of Java had just given us that many more
cycles to spend in solving our customers' problems, etc etc.


BTW: even though I left that CAD / PDM firm mostly because I was unable
to evangelize Python effectively there, I do find it amusing that
there's now LOTS of Python code in their systems -- apparently, my
evangelism HAD been effective at grass-roots levels, just not with
top management; and the techies had stealthily deployed growing amounts
of Python, e.g. in alleged "prototypes"... that had then been shipped:-).

Not complaining -- it does mean I get occasionally called in as a
Python consultant, which is a welcome opportunity to greet old friends
as well as a source of income;-).  But note that the firm does NOT
advertise the role of Python in their systems: "all rock-solid C++"
is the message marketing wants to keep sending (basically in a fight
with those competitors who switched to Java, whether they later
switched back to C++ or not) -- inserting the unknown-to-customers
"Python" term in the equation would dilute the message.  Pity, but I'm
convinced there's a LOT of that going on in the software world...!-)


Alex





More information about the Python-list mailing list