scriptorium icon indicating copy to clipboard operation
scriptorium copied to clipboard

Benchmark CL

Open Leandros opened this issue 8 years ago • 5 comments

Just found this, great project, exactly what I did recently and was looking for.

Might be worth to also look at the few common lisp implementations:

Leandros avatar May 16 '16 21:05 Leandros

Aha, great. Thanks for sharing. Will try to find a slot next weekend :)

r-lyeh-archived avatar May 17 '16 09:05 r-lyeh-archived

You're welcome. ;)

I've had a little time to look into your benchmark sources, and here is the recursive fib for lisp:

; #!/usr/local/bin/ecl -shell
; #!/usr/local/bin/sbcl --script
; #!/usr/local/bin/clisp -C
; vim: set syn=lisp:

(defun fibr(n)
    (if (< n 2)
        n
        (+ (fibr (- n 1)) (fibr (- n 2)))
    )
)

(compile 'fibr)
(defvar i 34)
(format t "fib: ")
(format t "~D" (fibr i))
(format t "~%")

(compile 'fibr) is required by ECL/CLISP to get TCO.

Leandros avatar May 17 '16 10:05 Leandros

Hey there,

I've tried to compile the projects this weekend but got no success with them. They're not so small/easy to embed as I originally thought :P

I'll try to find another slot next weekend :)

r-lyeh-archived avatar May 22 '16 20:05 r-lyeh-archived

Hilarious. The only one of the bunch that can be considered embeddable is ECL and that requires to cherry-pick the features you specifically need to have.

wasamasa avatar Jun 16 '16 16:06 wasamasa

building ECL:

./configure && make && make install

Embedding examples in: examples/embed

Regards, Daniel

dkochmanski avatar Jun 16 '16 16:06 dkochmanski