Live data from Hacker News

Clojure Implemented in Pure Python

github.com

51–56 of 56 posts

Re: Clojure Implemented in Pure Python

#51

Huh. I think Common Lisp would be a much better choice than Python. It's much faster, for starters. And it lets you do some fairly low-level stuff if you want. In general I think Common Lisp's virtues as an implementation substrate for other languages are much greater than most people appreciate. It is flexible, expressive, and fast. Its dynamicity comes in very handy. And some of its vices -- its sheer size, its lac…

Interoperability between clojure and python is promising, because it lets you do lisp programming with python libraries and data structures.

If you want to do lisp programming with CL libraries, you could just use CL.

I'm not sure what the advantage of clojure in CL is over just using CL.

Re: Clojure Implemented in Pure Python

#52
post #43

Earlier 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.

CLOS implementations have had to deal with the problem of extreme dynamism for a long time, so there has been quite a bit of optimization work associated with it. Polymorphic inline caches help a lot, for example.

That said, a good tracing JIT is probably better; but on the other hand, SBCL has profited from many years of optimization work on CMU CL. It would be interesting to see some real-world performance comparisons between SBCL and PyPy.

Re: Clojure Implemented in Pure Python

#53
post #50

Earlier 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?

PyPy is not just an Python-Interpreter. The PyPy Team build a Toolchain that can creat a JIT-Compiler out of a Interpreter (read some about the pypy project and you will be enlightened. Such a Toolchain does not exist for Common Lisp.

Interesting! Thanks for the pointer.

Re: Clojure Implemented in Pure Python

#54
post #38

Earlier quoted context omitted.

(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).

It's fairly clear in the context that he's using O(x) in the informal 'order of' meaning: 'order of 10', 'order of 1000' etc.

I agree, and had no problem understanding his intended meaning but I was irked by the unnecessary misuse of technical notation to attempt to get across an idea that would have been perfectly easy to write without it (e.g., "10 times" and "1000 times").

Re: Clojure Implemented in Pure Python

#55
post #45
post #36

Earlier quoted context omitted.

Why? If your going to rewritte the collections, why not in Clojure? Speed?

Mostly because we have to have these collections inside the compiler. So it's a bit hard to write collections in a language that has no compiler. Chicken/egg issue..

Well now that you have a compiler you can rewrite it in clojure-py to make clojure-py-in-clojure-py :)

Re: Clojure Implemented in Pure Python

#56
post #6

Earlier quoted context omitted.

ClojureScript scripts can already do this. :)

Are there many options for running ClojureScript scripts on a system outside of Node.js?

You want more command line Javascript runtimes? There's Rhino, but it's slower than Sunday with your in-laws...

Truth is, you only need one, as long as it's a good one.

Post reply on HN