Earlier quoted context omitted.
I dougth CL-Clojure is faster then pypy-Clojure.
Why? CL compilers (SBCL at least) generate really fast code.
Clojure Implemented in Pure Python
41–50 of 56 posts
Re: Clojure Implemented in Pure Python
#42Earlier quoted context omitted.
Why? CL compilers (SBCL at least) generate really fast code.
It does not matter with how good a compiler you compile an interpreter it stays an interpreter. With Pypy you get a JIT Compiler. Sure you could maybe write a JIT with CL but thats a lot more work.
Re: Clojure Implemented in Pure Python
#43Earlier quoted context omitted.
It does not matter with how good a compiler you compile an interpreter it stays an interpreter. With Pypy you get a JIT Compiler. Sure you could maybe write a JIT with CL but thats a lot more work.
I don't understand. Do you mean that you can't compile Clojure into Common Lisp the way you can compile it into Python/PyPy?
Basically it reflection (aka dynamic dispatch) is a major performance killer if you don't implement a tracing jit.
Re: Clojure Implemented in Pure Python
#44Earlier quoted context omitted.
I agree. Native access to legacy linear algebra functionality exposed by Numpy is the #1 reason this project seems exciting to me. I don't really care if the bulk of the code is O(10) slower so long as the numerical bits are O(1000) faster, which is a typical comparison of LAPACK for the JVM equivalents.
(Pedant warning) I think you may be abusing Big-O notation a little here since, technically O(10) is equivalent to O(1000)—and both are O(1).
Re: Clojure Implemented in Pure Python
#45Earlier quoted context omitted.
PyClojure (in the link) didn't actually take it to the extent we are. clojure-py goes so far as to implement all the standard collections in pure python. So [1 2 3] in clojure-py is a PersistentVector not a python list.
Why? If your going to rewritte the collections, why not in Clojure? Speed?
Re: Clojure Implemented in Pure Python
#46Please remember kids, language X implemented in language Y, probably means language X > language Y. (And if you question this, first implement a small, elegant language, and a large "pragmatic" one and then talk to me about it.)
What do you mean by "language X > language Y"?
Re: Clojure Implemented in Pure Python
#47Earlier quoted context omitted.
First of all, it should be mentioned, that this is not an abstraction layer. Clojure-py functions are actual Python functions (not classes as they are on the JVM). This means that the speed of clojure-py is almost exactly the same as python code. Secondly, there is some benifit to not having to worry about static typing in a dynamic language. Anyone want to explain how to read a binary file in Clojure? Here's a hint,…
Ok, what's the use case? What is the benefit to this versus regular ol' Python? In what situations might I write clj-py assumine identical performance to Cpython or pypy, instead of just Python? I agree that this is a really cool project and I plan on reading through the source when I have time strictly as a learning exercise, but I cannot think of a use case.
Re: Clojure Implemented in Pure Python
#48Earlier quoted context omitted.
I agree. Native access to legacy linear algebra functionality exposed by Numpy is the #1 reason this project seems exciting to me. I don't really care if the bulk of the code is O(10) slower so long as the numerical bits are O(1000) faster, which is a typical comparison of LAPACK for the JVM equivalents.
(Pedant warning) I think you may be abusing Big-O notation a little here since, technically O(10) is equivalent to O(1000)—and both are O(1).
Re: Clojure Implemented in Pure Python
#49Earlier quoted context omitted.
I don't understand. Do you mean that you can't compile Clojure into Common Lisp the way you can compile it into Python/PyPy?
You can, but I think you'd run into the same issues mentioned here: http://clojure-py.blogspot.com/2012/02/ive-been-asked-many-t... Basically it reflection (aka dynamic dispatch) is a major performance killer if you don't implement a tracing jit.
Re: Clojure Implemented in Pure Python
#50Earlier quoted context omitted.
It does not matter with how good a compiler you compile an interpreter it stays an interpreter. With Pypy you get a JIT Compiler. Sure you could maybe write a JIT with CL but thats a lot more work.
I don't understand. Do you mean that you can't compile Clojure into Common Lisp the way you can compile it into Python/PyPy?