Live data from Hacker News

Python becomes a platform. Thoughts on the release of clojure-py.

khinsen.wordpress.com

21–30 of 33 posts

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#21
post #9
post #6

Earlier quoted context omitted.

> I'm curious, can PyPy JIT-compile Python bytecode by itself, or does it require the source to be in Python? Considering you can run bytecode-only Python, it would be weird if Pypy's JIT only worked from source. Beyond that, they're apparently implementing Clojure on top of (in) Python, so they won't get the JIT for free (the interpreter code will be JITed, but the Clojure code won't be unless their runtime compiles…

From the article > clojure-py is an implementation of the Clojure language in Python, compiling Clojure code to bytecode for Python’s virtual machine Which means both the compiler (mostly an AST walk from the look of clojure/lang/compiler.py) and the Python bytecode it produces should benefit from PyPy's JIT.

This is very correct. We compile Clojure code to Python bytecode. Clojure functions become python functions, clojure deftypes are Python classes, Clojure namespaces are Python modules. And yes, it runs perfectly well on PyPy. Actually it sometimes runs a bit better. CPython segfaults with bad bytecode sequences (unbalanced stacks). PyPy actually throws an error so you can fix the code.

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#22
post #15

I'd argue that clojure-py is important for a different reason: Clojure is slowly sneaking up on every popular runtime: JVM -> Clojure Javascript -> ClojureScript Erlang VM -> Joxa CPython/PyPy -> Clojure-py In a few years clojurers/lispers will be able to target multiple platforms with one simple language. As a pythonista myself, I used to feel overcome with nausea just by looking at Clojure/Lisp code. However, Erlan…

Joxa is not Clojure. From joxa.org:

> Joxa (pronounced 'jocksah') isn't Erlang, though its very compatible. Its not Clojure though there is plenty of shared syntax. It's not Common Lisp though that is the source of the macro system. While Joxa shares elements of many languages, it is its own specific language. of all these languages, and knowing these languages will help you get up to speed with Joxa, but it is its own unique language.

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#23

Earlier quoted context omitted.

Sadly, I believe all of these ports run slightly different dialects of Clojure (beyond the things that must be different, like interacting with code written in other languages).

ClojureCLR and ClojureScript are not Clojure dialects - they are Clojure implementations. I'm not sure what the creators of clojure-py intend and Joxa is not Clojure as far as I can tell.

Of course, I'd forgotten about ClojureCLR and yes, Joxa is not Clojure, but it's close enough [1] that the point remains valid.

[1] From the website: "[Joxa's] not Clojure though there is plenty of shared syntax."

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#25

Earlier quoted context omitted.

Sadly, I believe all of these ports run slightly different dialects of Clojure (beyond the things that must be different, like interacting with code written in other languages).

ClojureCLR and ClojureScript are not Clojure dialects - they are Clojure implementations. I'm not sure what the creators of clojure-py intend and Joxa is not Clojure as far as I can tell.

We're taking the same approach as ClojureCLR and ClojureScript in clojure-py. As much as possible implement things exactly the way Clojure does.

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#27
"Clojure is strong in two areas in which Python isn’t. One of them is metaprogramming, a feature absent from Python which Clojure had from the start through its Lisp heritage."

Absent is too strong a word, surely.

http://bitshaq.com/2011/07/14/basic-intro-to-python-meta-pro...

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#28

The idea of a python implementation becoming host to other languages is somewhat interesting. Python has had a good interop story with the vibrant ecosystem of C libraries and is pretty good at being cross-platform as well. However, I'm not sure Clojure is going to impress Python developers for the reasons the author states. Python has metaprogramming and it has an immutable type (the tuple). However, Python has reje…

As a Python programmer, I agree with most of your assessment. Most Pythonistas I know have chosen Haskell as their primary functional language (and Haskell is the PL I'm constantly working on mastering). But this clojure-py project is very interesting to me. I've heard so many positive things about Clojure and Lisp in general. I've been wanting to explore Clojure, but I've been holding off because I knew I would need…

> Most Pythonistas I know have chosen Haskell as their primary functional language (and Haskell is the PL I'm constantly working on mastering).

I'm currently learning Haskell too. My ideal functional language would be one similar to Haskell which runs on the Python VM and has good interoperability with Python.

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#29
post #15

I'd argue that clojure-py is important for a different reason: Clojure is slowly sneaking up on every popular runtime: JVM -> Clojure Javascript -> ClojureScript Erlang VM -> Joxa CPython/PyPy -> Clojure-py In a few years clojurers/lispers will be able to target multiple platforms with one simple language. As a pythonista myself, I used to feel overcome with nausea just by looking at Clojure/Lisp code. However, Erlan…

> In a few years clojurers/lispers will be able to target multiple platforms with one simple language.

I doubt it, unless either their code doesn't use any external libraries, or Clojure writes a library abstraction layer containing all the Java/Python/etc libraries.

Re: Python becomes a platform. Thoughts on the release of clojure-py.

#30
post #15

I'd argue that clojure-py is important for a different reason: Clojure is slowly sneaking up on every popular runtime: JVM -> Clojure Javascript -> ClojureScript Erlang VM -> Joxa CPython/PyPy -> Clojure-py In a few years clojurers/lispers will be able to target multiple platforms with one simple language. As a pythonista myself, I used to feel overcome with nausea just by looking at Clojure/Lisp code. However, Erlan…

> In a few years clojurers/lispers will be able to target multiple platforms with one simple language. I doubt it, unless either their code doesn't use any external libraries, or Clojure writes a library abstraction layer containing all the Java/Python/etc libraries.

I did not mean to imply that Clojure code would be portable across runtimes (though it is a possibility).

I meant that things like ClojureScript One (if you don't know it, please take a look, it's worth it) will be possible across a variety of domains. Simple interoperability between platforms, same data structures, fewer context switches, Clojure all the way down.

Post reply on HN