Live data from Hacker News

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

khinsen.wordpress.com

31–33 of 33 posts

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

#31

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…

Python has a quite a few immutable types, tuple, string, none, boolean, int, float, but they are all primitive types. Some of Clojure's immutable types are much more interesting, like the finger tree for example.

> int, float

Immutable? Could you explain this a bit more? (As far as I know, "x += 1" will modify the block of memory that x points to)

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

#32
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.

All 100 of them (Clojurers)?

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

#33
post #31

Earlier quoted context omitted.

Python has a quite a few immutable types, tuple, string, none, boolean, int, float, but they are all primitive types. Some of Clojure's immutable types are much more interesting, like the finger tree for example.

> int, float Immutable? Could you explain this a bit more? (As far as I know, "x += 1" will modify the block of memory that x points to)

No, I had to check that, but it doesn't appear to be true. `id` uses the ptr of the object in CPython, and:

    >>> a = 1
    >>> id(a)
    32855992
    >>> a += 1
    >>> id(a)
    32855968
So it's actually creating a new Integer object, which `a` then points to, or in other words:

    a += 1 is equivalent to a = a + 1
This behavior makes sense, if you wrote:

    a = 10
    b = a
    a += 20
You wouldn't expect b to be 30.
Post reply on HN