Python for everything?

Ivan Van Laningham ivanlan at pauahtun.org
Fri Jul 1 01:50:34 CEST 2005


Hi All--

Mike Meyer wrote:
> 
> xeys_00 at yahoo.com writes:
> 
> As other have noted, C was never really used for everything. Unix
> tools were designed to connect together from the very beginning, which
> is what makes shell scripting so powerful. This was true before there
> was a C. Likewise, some things you need more control over the machine
> than you get in C - those are still done in assembler. These days, C
> compilers let you embed assembler statements in your C, so some of
> these things are done in such variants.
> 

It really was used "for everything"; C compilers have *always* let you
include assembler, with the "asm" keyword.  Unless you're talking about
the early days of DOS/Windows compilers, about which I know little, but
all *K&R* compilers had asm.  If you wanted to write kernel code and
device driver code (including disk drivers) for large Unix systems, asm
was a requirement.  To put it in perspective, for Gould systems in the
80s, for the entire OS (BSD-derived Unix), there were under 100 lines of
assembler, all in a very few device drivers (multiple thousands of lines
of code, don't remember exactly how many).

And living with structs instead of classes was not nearly as much of a
pain in the butt as you make out; it was perfectly reasonable to include
methods within structs, by including a pointer to a function.  X10 and
X11 showed just how object-oriented you could get with C, using
callbacks with required signatures, and specifying how Widgets were to
be written--contracts before there were contracts.

It's true that OO languages are better, and languages like Python which
allow you to combine fairly low-level calls with an OO worldview make
life *vastly* easier, but C is still hugely flexible, highly adaptable,
and very powerful.  For about 10 or 15 years there, knowing C was pretty
much a guarantee of a good job.  That changed when C++ compilers became
common and good and not merely preprocessors that wrote really, really
ugly C.

Metta,
<while(*s++=*p++);>-ly y'rs,
Ivan;-)
----------------------------------------------
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours



More information about the Python-list mailing list