3 ms·
I know more about Racket (that is very similar to Scheme). The compiler does a very aggressive optimizations and inlines many of the lambdas. You can write nice
by gus_massa 11y ago
I know more about Racket (that is very similar to Scheme). The compiler does a very aggressive optimizations and inlines many of the lambdas. You can write nice understandable code with lambdas, but under the hood many of them are removed and the actual running code is similar to the imperative version.
In Haskell there are a lot of abstractions, the compiler is also very aggressive, but I don't know the details.
Anyway, in the "Computer Language Benchmarks Game", most of the programs in Haskell and Racket are much faster (> 10x) than Python. http://benchmarksgame.alioth.debian.org/u32/compare.php?lang=ghc&lang2=python3 http://benchmarksgame.alioth.debian.org/u32/compare.php?lang... http://benchmarksgame.alioth.debian.org/u32/compare.php?lang=racket&lang2=python3 http://benchmarksgame.alioth.debian.org/u32/compare.php?lang...
(But I like the saying: There are lies, dammed lies, statistics and microbenchmarks.)
- igouy 11y ago"After all, facts are facts, and although we may quote one to another with a chuckle the words of the Wise Statesman, 'Lies--damned lies--and statistics,' still there are some easy figures the simplest must understand, and the astutest cannot wriggle out of." Leonard Henry Courtney, 1895 Also, those are "toy programs" not "microbenchmarks".