4 ms·
> Because LISP is expressive and C is fast and I wanted the best of both worlds is the short answer. I'm not sure how well known it is, but some Lisps can be s
by jlas 10y ago
> Because LISP is expressive and C is fast and I wanted the best of both worlds is the short answer.
I'm not sure how well known it is, but some Lisps can be statically compiled to machine code.
But one thing I've wondered about is how good can it get? Are there any benchmarks for Lisp vs. C?
- tosseraccount 10y agohttp://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=sbcl&lang2=gpp http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
- girvo 10y agoFor example: https://www.call-cc.org/ https://www.call-cc.org/ That's a full Scheme that compiles to C. It's quite nice, too!
- Flow 10y agoIt's a fine compiler for sure, but have you seen the generated C output? It's based on Henry Baker's Cheney-on-the-MTA compilation strategy. https://wiki.call-cc.org/chicken-compilation-process https://wiki.call-cc.org/chicken-compilation-process
- dreamcompiler 10y agoSome Lisps? Almost all Common Lisps compile to native machine code. Which is why CL programs tend to run orders of magnitude faster than e.g. Python programs. (But they're still typically slower than C because of runtime memory allocation and typetag checking.)
- agumonkey 10y agoTalking about speed, someone put this online http://www.nexoid.at/tmp/scheme-benchmark-r7rs.html http://www.nexoid.at/tmp/scheme-benchmark-r7rs.html
- eggy 10y agoChez Scheme (the compiled version vs. Petite Chez) figures high on those lists, and it was just opensourced by Cisco. I used to use Gambit-C, and I still like it, but Chez is fast.
- agumonkey 10y agoIt is and regularly way above the others. I had to hold on my fanaticism.
- eggy 10y agoI am playing with Eduardo Cavazos's libraries with Chez [1], and particularly the port of xspringies. Great fun considering as he points out that the mass-spring calcs are all taking place in scheme. It runs fine on my 2-3 year old notebook. C was a third language for me in the day, and I like Lisps, so this Lispy-C thing is going to eat my afternoon up! [1] https://github.com/dharmatech?tab=repositories https://github.com/dharmatech?tab=repositories
- groovy2shoes 10y agoThat would be ecraven (who hangs out in #scheme on Freenode). See also: https://github.com/ecraven/r7rs-benchmarks https://github.com/ecraven/r7rs-benchmarks