4 ms·
Sounded good until I saw this: A faster Clasp compiler is coming soon – the current Clasp compiler generates slow native code that is about 100x slower than hi
by phkahler 12y ago
Sounded good until I saw this:
A faster Clasp compiler is coming soon – the current Clasp compiler generates slow native code that is about 100x slower than highly tuned Common Lisp compilers like Steel Bank Common Lisp.
No mention of the expected speedup, but 100x is a huge performance problem.
- ephemeralgomi 12y agoIn his defense, SBCL is really fast...
- eudox 12y agohttp://log.irc.tymoon.eu/freenode/lisp?around=2014-09-25T18:18:23&types=mnaot#1411661903 http://log.irc.tymoon.eu/freenode/lisp?around=2014-09-25T18:... Essentially, LLVM does tons of low-level optimizations but Clasp does few high-level, CL-specific ones. SBCL, on the other hand, mostly does CL-level optimizations and few low-level ones.
- drmeister 12y agoYes, LLVM is awesome. Clasp uses the inlining LLVM provides to inline C++ code within Common Lisp code by generating LLVM-IR bitcode files from C++ source and linking them with Clasp generated bitcode files and then running them through LLVM module and function optimization passes. I'm really excited about combining the CL specific optimizations with the ones that LLVM provides - stay tuned.
- drmeister 12y agoThe reason is that Clasp doesn't do Lisp language level optimizations like escape analysis yet. All bindings are stored on the heap and the stack/registers are underutilized. LLVM is a great library for implementing C and C++ but more work needs to be done to support Lisp features like closures and first-class functions. We are working on that now. The goal was first to "make it correct" and now we will "make it fast". Once we have a faster compiler (give us a couple of months) I don't see why it couldn't approach the speed of SBCL (a tall order).
- phkahler 12y agoGlad to hear it. I've been wondering when new languages would be developed on top of LLVM and it's starting to happen (Julia, now this). C++ is getting a lot of more advanced features, but the syntax is so clunky compared to something like Python for example. I also like the notion of easy C++ library use for things like QT.
- aidenn0 12y agoI'm not too worried, since a) that makes it about as fast as cpython and b) there is a lot of low-hanging fruit. There is work being done on integrating the Cleavir compiler which does a number of tricks. In particular escape analysis and lambda lifting should both help a lot on certain types of code.
- pjmlp 12y agoAny weekend compiler project can be faster than CPython.
- scardine 12y ago> Any weekend compiler project can be faster than CPython. Not true and not even funny.
- 1ris 12y agoTo write a compiler (and not a interpreter) it's indeed almost impossible to reach the slowness of CPython. Especially because it's hard to create a complex language in just a weekend.
- andrewchambers 12y agousing llvm as the backend not hard to make a toy language which runs insanely fast with only integer operations.
- tempodox 12y agoExactly.
- Igglyboo 12y agoWell CPython is an interpreter not a compiler so that's not really hard to do.
- lispm 12y ago
- krig 12y agoConsidering that SBCL is among the fastest programming language implementations there is, 100x is actually not terrible for a first version.
- sigil 12y ago> Considering that SBCL is among the fastest programming language implementations there is... Source for this? I'd love to find a really fast lisp or scheme. Hadn't heard SBCL was particularly fast, and the alioth benchmarks don't show anything special there. http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=sbcl&lang2=gpp&data=u64q http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t... Edit: actually SBCL stacks up alright against languages like Go or Rust in the alioth benchmarks, so maybe that's what you had in mind.
- mrottenkolber 12y ago> Hadn't heard SBCL was particularly fast What did you think was particularly faster than SBCL?
- sigil 12y ago> What did you think was particularly faster than SBCL? Haskell, Scala, Java, Go and of course C, C++, Fortran all outperform SBCL in the alioth benchmarks. Against the schemes, lisps, and "scripting" languages though SBCL stacks up favorably. I didn't notice that krig's comment was mainly comparing SBCL to this latter category ("programming language implementations").
- pjmlp 12y agoI imagine commercial Lisps like LispWorks would fare even better.
- lispm 12y agoDepends on what you look at. LispWorks is fast, but not really faster than SBCL in Gabriel benchmarks. But what about real programs, garbage collection, etc.? LispWorks is used because its implementation is very capable, widely ported and it has stuff like a GUI toolkit which runs on Windows, GTK+ and Cocoa/Apple.