Why did python took over scheme/lisp in popularity ?

You can compile Chicken using -optimize-level N where N is 0-5. Using 5, I gain 4 seconds (0m16.638s).
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).

Did you guys know that Scheme is absent from the list of parallel programming languages (unlike C and Python), and barely supports concurrent (not necessarily parallel) programming?
 
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,
 
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,
I'm sorry, but this does make me a bit lost... which times are for compile, and which times are for execution? 🤔
 
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 executable : 0.2 seconds
-Runtime to calculate fib(42) using the bytecode: 20seconds
 
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
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... 😅

The only valid comparison that I see is that chicken-scheme compiles to bytecode way faster than racket-scheme (by a factor of 50). After that, the comparisons are not there any more.
 
I made a lapsus & corrected it. Both can compile to an executable and compile time can differ in the range of 100.
They differ in that as intermediate step racket-scheme is able to compile to interpreted bytecode,
and chicken-scheme is able to interpret the scheme source files without a compilation step.
But for racket the slow compile time to an executable is not a problem as you can "incrementally" compile to bytecode which is acceptable in speed.
Note : there is :
 
So, if I got you straight:
  • racket-scheme cannot run bytecode, bytecode needs to be compiled first.
  • chicken-scheme can run bytecode without further compilation.
  • chicken-scheme can run a compiled executable just fine.
So, if you put racket-scheme through 3 steps (source -> bytecode -> executable -> run), shouldn't chicken-scheme be put through exactly the same steps for a valid comparison?
 
Racket-scheme : Source ---> (interpreted) "racket/scheme"-bytecode ---> executable
Chicken-cheme : (interpreted) Source - --> .c --> executable
Implementations differ so it's not as easy to compare as an llvm or gcc compiler.
The compilation to c , as used by Chicken you can also find in the languages zig & nim, meaning these 3 integrate well.
 
So, Racket-scheme requires bytecode as an intermediate step in compilation, while Chicken-scheme doesn't...

Even with that, what I said in post #90 in this thread applies. The baseline in your comparison is same algorithm (non-tail-recursive fibonacci of 42) and same processor. Steps taken to run both implementations should be exactly the same, as well. That's academic standards for fair comparisons.
 
The optional step of compilation to c by chicken-scheme opens alot of possibilities.
You could write a part in dlang or ocaml and compile to c.
You could compile and link both c-files with the zig-compiler.
 
Is this thread just lisp-alike posturing now? Is question and answer time over? Can I unfollow it?
I consider Off-topic like being in a bar and drinking a beer. Nobody tells to enter the bar.
In fact being in this bar give me some ideas. Compiler&intepreters are just tools like hammers and nails. And it's not a wrong question to ask if i use the best tool.
 
As an analogy, you can compare apples and pears using the process of jam-making. For the comparison to be fair, the recipe needs to be the same (same amounts of water, sugar, pectin, cooking time, cooking temperature), both species of tree should be growing in the same area (same farm is best), both kinds of fruit should be fresh-picked... then it would be fair to see which fruit is more profitable to grow. If customers like apples better than pears, would that change if you made jam?
 
After comparing apples and pears, i would like to add carrots, hoping i don't give anybody a head-ache.
In ocaml:
Code:
let rec fib n =
  if n < 2 then n
  else fib (n - 2) + fib (n - 1)
let _ =
  Printf.printf "%d\n" (fib 42)
Runtime to calculate fib(42) , 1.4seconds.
Yet, comparing ocaml/mlton to Chicken-Scheme looks like something interesting.
 
A simple puzzle: Try to figure out the fib implementation below. I used nothing beyond R4RS Scheme features (except for measuring run time).
Code:
> (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
Time to compute: under 30 milliseconds! [Interpreted, not need to compile!]
I used (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..
It was not my intention to pose scientific or mathematical facts with my snippets.
In the process of creativity you must allow to diverge from the original question, this without falling in the trap on nonsensical chaos.
 
FreeBSD has many choices of scheme
Code:
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
 
Today I learned car stands for,
contents of address registry.
cdr stands for,
contents of decrement registry.
 
Back
Top