News for hackers. Stuff that matters.
Re:Python becomes a platform. Thoughts on the release of clo... by agentultra on Thursday March 15, 2012 @12:32PM (#3709181)
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 rejected functional purity for pragmatism so I'm not sure there will be a great many Python developers suddenly switching to clojure. It's generally not the implementation that impresses Python developers the most AFAIK -- it seems that most Pyhtonista's like the language more than anything.

That being said I'd be interesting to see how far clojure-py goes. Pypy is the ideal implementation for this sort of project as they're aiming to be a JVM-like platform for dynamic languages.

Re:Python becomes a platform. Thoughts on the release of clo... by whateverer on Thursday March 15, 2012 @12:36PM (#3709205)
Users of a host platform are almost never the target of a port such as this. ``Pythonistas'' are not the audience here, it's Clojure programmers who wish to sneak Clojure in a Python environment or use its libraries in lieu of Java's.

Also, I must add that I really dislike the use of the word ``pragmatism'' in the context of a programming language. It almost always is used to justify either sloppiness, misunderstanding or just plain (and save for the word, valid) aesthetic preference.

Re:Python becomes a platform. Thoughts on the release of clo... by CPlatypus on Thursday March 15, 2012 @01:05PM (#3709340)
Fair point about "pragmatism" but the contrary "elegance" often comes across as dogmatic or even elitist. Most languages strive for both pragmatism and elegance, but tend to favor one a little over the other.

And yes, this is relevant since Python and Clojure embody exactly this kind of tension.

Re:Python becomes a platform. Thoughts on the release of clo... by whateverer on Thursday March 15, 2012 @01:24PM (#3709445)
I guess one could pinpoint it to the clashing of the traditions of pure mathematics and engineering which one finds in Computer Science.

Elegance is an often trotted epithet in mathematical writing, and sure, it has some sort of established connotation (minimalism, what we call orthogonality, etc.), but in the end it's almost always something like "it has sugar, and marmalade, and skittles and ketchup! All my favorite ingredients! I'm very glad they didn't put that icky caramel stuff in it".

Anyhow, Clojure sports a fair bit of ``pragmatism'' with its own, very leaky sequence abstraction, as you sometimes feed a vector to a function and you get a linked list and next thing you know, your head has been put in your ass (when you conj/cons an element to a sequence).

Lisp has also always leaned to a sort of messiness in its use, even if the language's features and libraries are held to a higher standard. Thus you see phrases like ``ball of mud'' used in a subtly positive way.

Re:Python becomes a platform. Thoughts on the release of clo... by eric_bullington on Thursday March 15, 2012 @12:47PM (#3709257)
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 to become more familiar with the Java infrastructure to learn Clojure well, and learning the JVM is one challenge I just don't feel like tackling at this point in my life.

On the other hand, I love PyPy, and I've been fascinated by the progress in performance the PyPy team has been making. I'm even hoping to eventually implement a version of CoffeeScript on PyPy. Given my Python background and interest in PyPy, Clojure now seems much more approachable thanks to this implementation. I'll probably wait until it's a little more mature, but I look forward to trying clojure-py out!

Re:Python becomes a platform. Thoughts on the release of clo... by cabalamat on Thursday March 15, 2012 @10:22PM (#3711649)
> 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 clo... by vutekst on Thursday March 15, 2012 @12:36PM (#3709202)
Clojure is not a purely functional language either. You can have side-effects anywhere, it's just that Clojure emphasizes immutable, persistent data structures.
Re:Python becomes a platform. Thoughts on the release of clo... by DanWaterworth on Thursday March 15, 2012 @02:34PM (#3709869)
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.
Re:Python becomes a platform. Thoughts on the release of clo... by dbaupp on Thursday March 15, 2012 @11:35PM (#3711833)
> 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 clo... by DanWaterworth on Friday March 16, 2012 @02:32AM (#3712249)
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.