yeah, we're just better then awk!

Shawn Pearce spearce@REDACTED
Tue Mar 4 10:41:07 CET 2003


Bengt Kleberg <eleberg@REDACTED> wrote:
> > Given the number of languages he implemented in, I have
> > to wonder how good his implementation was in anything,
> > save C or Java.  :)
> 
> they are not all his implementations. anybody can send in a version.
> most exotic languages have other authors.

I didn't realize that.  I guess that makes more sense than one poor
sap learning enough of each langauge to be dangerous and write up
examples for the shootout.

> > Also, the tests are very small tests that only test
> > simple operations.  Nearly all languages have about
> > the same number of lines of code, each test does no
> > useful work,
> 
> are we talking about http://www.bagley.org/~doug/shootout ?
> most of the tests there do real work (ex: word count, sorting,
> reversing, adding numbers) on file contents.

Yes.  I guess I consider that although this is real work, in
the grand scheme of what most computing is today, they are
overtly simple.  Meaning lets take an example such as a modern
peice of software that is slighlty larger and more complex than
sort:  a web browser, or a network server, or some other such
"beast" of a program.  The expressive power of each language,
coupled with the builtin toolbox (standard libraries) will make
huge differences between them when it comes to lines of code
required to solve the problem.

Compare that to a word count or sorting problem, where most
langauges either have equivilent expressivity to access their
equivilient standard sorting routines, or will have equivilient
expressivity to express quicksort or some such sorting routine.

I definately see your point that these tests do real work
for which quite a few programs exist in product do.  (I couldn't
live without wc, sort, etc.)  However, my (poorly) made point was
more to the "these programs are all fairly small" when talking
about lines of code to solve a problem, and performance of
language to solve said problem.

> > and the tests run fast on bare hardware
> > and slower when higher levels are in the way. Thus
> > they are unfairly biased against the native compiled
> > languages.  Its also unfairly biased against apps
> > that can startup/shutdown very fast, which both
> > Java and Erlang don't do well.  SAE may have
> > faired better.
> 
> i do not think it is unfairly biased. for this kind of problems it is a
> good thing to be fast in startup and excution speed.
> moreover, some of the languages that are fast are very high level (ex:
> ocaml, haskell, sml).
> perhaps you mean that the higher levels are virtual machines?

Ok, I see your points.  I felt it was unfairly biased against languages
which tend to have higher startup costs, I wouldn't see these used to
solve the kinds of problems the shootout throws at them, for exactly
that reason:  they just take too long to startup compared to other
languages, but lines of code wise they are equal.  I guess in that
context the language shootout is a big success, as it shows what
many of us feel we inherently "know" about these tools:  who would
use Java to count the number of words in a file given the amount
of memory it needs and the time it takes to startup/shutdown
relative to native C?

I meant it was "unfairly biased" against Erlang in that few of
us (I think anyway) would use Erlang for these problems, as the
language (imho) is ill-suited for these tasks.  The strong points
of Erlang are for building larger, complex systems which demand
reliability, vs. smaller, fast tasks which demand speed and
low resource consumption.

I didn't pay enough attention to the shootout relative to the
other langauges to note that ocaml, etc. came out as being good
performers.  Next time I better do so.  :)  I do think though
that I was implying more the virtual machine langauges when
I said "higher level", but to some degree I was also implying the
langauges themselves in that higher levels of abstraction do tend
to pay in performance (but not always).

Just as we tended away from assembly to C, we'll tend to higher level
languages than C soon enough.  Hardware is getting so fast and compilers
are getting so good that its just a matter of a few years before people
do seriously consider writting `wc' in Java.  What a sad, sad day that
will be.  :)

-- 
Shawn.

  Man is the only animal that blushes -- or needs to.
  		-- Mark Twain



More information about the erlang-questions mailing list