[rescue] Mozilla Firefox
jdboyd at jdboyd.net
Thu Apr 22 13:45:52 CDT 2004
On Thu, Apr 22, 2004 at 02:02:29PM -0400, Dave McGuire wrote:
> >I don't think it is that poor of a mapping. Sure all of today's
> >processors are procedural, but still many paradigms run well with
> >compiler technology.
> You've just reinforced my point while trying to disagree with it. ;)
> What you're saying here is that a modern optimizer will take the OO
> code and wrangle it into something that maps into a procedural
> processor more effectively. Thus, changing a basic element of OO
> programming to make it work right on a real processor.
> It's kinda like taking a poorly-performing Ethernet network and
> making it fully switched to alleviate congestion. That's modifying a
> very basic underlying part of the design of Ethernet (the whole point
> of CSMA/CD) in order to make it perform well.
I don't think it is quite the same. Using OO enables you to give the
compiler a better big picture view of what you are trying to
accomplish. This enables it to potentially do a better job optimizing
things. You certainly should be able to do an equal or better job by
hand, but it is nice to give the compiler a chance to do it for you if
This doesn't just apply to OO, it even applies to Fortran, where a
quickly written numerical program is fairly frequently faster then the
first pass of a C program from most people. I believe this is a large
part of why the scientific community, especially users of vector and
other SIMD machines, like fortran so much.
Now, I realize that in the real world, the theory doesn't work out quite
as well as we would like. Something like OpenMP for smalltalk, lisp, or
erlang should be even more usefull than OpenMP for C or fortran is, yet
only a few labs seem to bother playing with it. For one thing, using a
language that discourages side effects makes the task of OpenMP like
systems much simpler.
> You've named two applications. You have dozens, if not hundreds more
> on your UNIX machines that aren't written in this way. This is the
> exception, not the rule.
True. But also look at how much of the system is managed via scripts.
Like, say the house keeping kicked off by cron every night, and system
initialization, etc. Of course, in days past, people seemed to use C
more frequently as a scripting language (or so it seems to me when one
has a C program that talks to another with the other's output redirected
> > I thought writing applications in scripting languages was the unix
> I think you're using a different UNIX than I am.
Wasn't the philosophy to have each program do one thing and do it well,
then build more complex tasks on top of each other? Scripting, whether
by perl or bash, seems to me to be the natural way to do that.
More information about the rescue