chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] More idomatic code (Language Shootout)


From: Greg Buchholz
Subject: [Chicken-users] More idomatic code (Language Shootout)
Date: Wed, 11 May 2005 09:04:15 -0700
User-agent: Mutt/1.4.2.1i

    Lately, in my quest to become more familiar with Scheme, I've been
toying with the programs over at the "Great Computer Language
Shootout"...

    http://shootout.alioth.debian.org/

The "n-body" problem captured my interest, and I thought I'd try my hand
at crafting a more-modular/less-imperative program than the existing
Chicken solution...

  http://shootout.alioth.debian.org/benchmark.php?test=nbody&lang=chicken

...Well, I was quite impressed that my attempt...

  http://shootout.alioth.debian.org/benchmark.php?test=nbody&lang=chicken&id=2

...turned out to be only about 2x slower than the original (let's ignore
the fact that it is 70x slower than C).  The main changes I made were to
simplify the program by using vector math, and to try and replace "do"
loops and mutation with higher-order functions working on lists.  I was
wondering if anyone would care to take a look at the code and see if
there were any easy things I was missing (being a Scheme novice and
all) to make the code cleaner, more idomatic, and/or faster. 


Thanks,

Greg Buchholz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]