Updated: 11/5/2005; 6:04:01 PM.
Chris Double's Radio Weblog
        

Thursday, April 03, 2003

Playing around with Chicken Scheme I tried the harmonize benchmark function I posted about previously. I used the following code:

(define (harmonize n)
  (do ((i 1 (+ i 1))
       (z 0.0 (+ z (/ 1.0 i))))
       ((> i n) z)))

The result was 2.4 seconds running in interpreted mode and 0.76 seconds when compiled to C code with optimisations turned on. That's pretty good considering there are no type declarations which the Common Lisp and Lush code has the advantage of using.

Chicken Scheme is quite a nice Scheme implementation. It packs a lot of stuff in a small package. The current release of Swig has support for Chicken out of the box. Using it I was able to wrap an external C API for use with Chicken very easily. The generated Scheme code, when compiled to C, was compiled as a shared libary, loadable on demand in the Chicken interpreter and/or compiler.


1:18:45 AM      

© Copyright 2005 Chris Double.
 
April 2003
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Mar   May



Click here to visit the Radio UserLand website.

Listed on BlogShares

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.