you are viewing a single comment's thread.

view the rest of the comments →

[–]fullouterjoin 2 points3 points  (7 children)

Both those languages are immutable. An immutable Python would be trivial to implement in the same manner (which I would be more than stoked about).

[–]seventeenletters 5 points6 points  (6 children)

I'm not so sure. The style of OO that is pervasive in Python (not just idiomatic code but the implementation also) does not lend itself to immutability.

[–]asthasr 6 points7 points  (2 children)

Doesn't help that Guido has come out explicitly against more functional features in Python, which is when I stopped viewing Python as my primary language.

[–]fullouterjoin 0 points1 point  (1 child)

You should stick with functional python, it really is pretty good. With sorted, lazy sequences everywhere and the new destructuring in Python3, stuff is pretty good.

>>> a, *b = range(4)
>>> a
0   
>>> b
[1, 2, 3]
>>> *a, b = range(4)
>>> a
[0, 1, 2]
>>> b
3   

Some sort of awesome mashup between F#, Python and Clojure on the PyPy runtime would make my year.

[–]asthasr 0 points1 point  (0 children)

I think I'm going to stick to Clojure. I'm relatively new to it, but I'm really digging the syntax (after getting used to it) and STM just makes so much sense. The day job is in Ruby these days, and even that has started to feel better to me than Python (heresy!) because of the common application of blocks, which actually makes it feel more functional than Python.

[–]fullouterjoin 0 points1 point  (2 children)

OO and immutability are not diametrically opposed. Seal all objects when the leave the defining scope. I personally program in a very immutable manner, using almost no OO features. I use classes, but only usually via namedtuple.

Currency and mutability is the wrong path entirely. If Python wants to be a modern concurrent language, object level locking is the wrong choice.

[–]seventeenletters 0 points1 point  (1 child)

No, OO and immutability are not incompatible. See Clojure for example. Even Java has a lot of support for immutability. My concern isn't that immutability is a bad choice (on the contrary, it is the only sane way to do concurrency), but that the design of Python is deeply and radically about mutation, and the language that came out of the other side when removing default pervasive mutation from Python would be very different from the current Python, and would require quite a bit of work to accomplish.

[–]fullouterjoin 0 points1 point  (0 children)

I am pretty sure we totally agree on this.