- Thread Starter
- #76
Yes. Some things are implicit, the word is runtime. It took me longer to write snippets.
Seriously, nearly 17 seconds??? for that one code snippet??? I bet that equivalent C code will run much faster on the same processor, even if it takes way more LOC's. (LOC = Lines Of Code).You can compile Chicken using-optimize-level N
where N is 0-5. Using 5, I gain 4 seconds (0m16.638s).
I'm sorry, but this does make me a bit lost... which times are for compile, and which times are for execution?Test of non-tail-recursive fibonnaci was to test only the "stack behavior" of the language. Which is only one aspect.
The slow to .exe compile time of racket is not a problem as you can fast compile to bytecode for testing.
Personally i find the documentation of chicken-scheme & eggs very good. Which is a big plus.
For instance for one of its eggs,
So, chicken-scheme doesn't allow for compilation to executable? or does racket-scheme not allow for bytecode to run? I realize this is a quick-and-dirty comparison, but still...For the racket scheme non-tail-recursive fibonacci of 42:
-Compile time of the program to bytecode : 10seconds
-Compile time of the program to executable : 20seconds
-Runtime to calculate fib(42) using the executable: 4.5seconds
For the chicken-scheme non-tail-recursive fibonacci of 42:
-Compile time of the program to bytecode : 0.2 seconds
-Runtime to calculate fib(42) using the bytecode: 20seconds
I consider Off-topic like being in a bar and drinking a beer. Nobody tells to enter the bar.Is this thread just lisp-alike posturing now? Is question and answer time over? Can I unfollow it?
let rec fib n =
if n < 2 then n
else fib (n - 2) + fib (n - 1)
let _ =
Printf.printf "%d\n" (fib 42)
> (define x 0)
> (time (set! x (fib 1000000)
(time (set! x (fib 1000000)))
0.027409 secs real time
0.029737 secs cpu time (0.029735 user, 0.000002 system)
no collections
1352112 bytes allocated
3613 minor faults
no major faults
(set! x ..)
to avoid printing (as time for number->string conversion & printing will dominate for large numbers). To check that your code works correctly, (fib 1000000)
is a 208,988 digit number "1953282128...8242546875". FYI: this is on a $300 Ryzen laptop. If you want, you can write a C program using gmp and see if it is faster!Yeah, but there are still threads of conversation..I consider Off-topic like being in a bar and drinking a beer.
Ypsilon was a very good implementation of R6RS. The most up to date sources seem to be at https://github.com/fujita-y/ypsilonNote : there is :
Ypsilon (Scheme implementation) - Wikipedia
en.wikipedia.org
It was not my intention to pose scientific or mathematical facts with my snippets.Yeah, but there are still threads of conversation..
chez-scheme-9.5.2 Chez Scheme system
chibi-scheme-0.10.0 Minimal Scheme implementation for use as a C extension language
chicken5-5.2.0 Scheme-to-C compiler
elk-3.99.8_2 Embeddable Scheme interpreter
gauche-0.9.10 Scheme script interpreter with multibyte character handling
kawa-3.1.1 Java-based Scheme implementation
mit-scheme-9.2_4 MIT Scheme: includes runtime, compiler, and edwin binaries
mosh-scheme-0.2.7_6 Fast R6RS Scheme interpreter
owl-lisp-0.1.23 Functional dialect of Scheme
qscheme-0.5.1_10 Small and fast Scheme interpreter
racket-8.2 Interactive, integrated, graphical Scheme programming environment
sagittarius-scheme-0.9.7 R6RS/R7RS Scheme system
scm-5f2_10 Scheme interpreter
siod-3.6.2 Small footprint implementation of the Scheme programming language
sketchy-20070218_1 Interpreter for purely applicative Scheme
slib-3b6 Portable scheme library
ypsilon-0.9.6.3_11 Scheme implementation for real-time applications