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



_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to