Live data from Hacker News

Python 3 can revive Python

medium.com

91–100 of 242 posts

Re: Python 3 can revive Python

#94
post #24

That pretty much reiterates my points from last time we discussed (not many hours ago). https://news.ycombinator.com/item?id=7801004 Besides what already was said. It is also important to emphasize that Python 2 is already pretty good. So it is not that Python 3 is bad, it is just that it is very hard to improve on 2. Ironing out the warts is good, but this was not the right time. This should have happened 7-10 years…

Exactly. Python and JavaScript is a perfect demonstration of "worse is better". Python 2 is a vastly better language than JS, avoiding nearly all of its design misfeatures and having actually useful built-in types and standard libraries. Yet while Python spent a decade to go from 95 to 99 percent purity, JS took over the world through sheer ubiquity.

Javascript won the "language lottery" when it was created for the web browser, how would another language capitalize on that?

Re: Python 3 can revive Python

#95
post #36

Python 3 isn't really good. It's not really bad, either. There's really not that many magic bullets (other than proper functional programming, maybe, which isn't about to happen in Python). People are leaving Python for Go because people have always left Python for fast compiled languages. Google ditched Python for C++ and Java. Java! I've seen a lot of projects get re-written in Java from Python, but no-one worried…

"People are leaving Python for Go because people have always left Python for fast compiled languages." I think the angst about Go comes from the fact that someone who leaves Python for Java may still come back, because you can develop far more quickly in Python than Java. But someone who leaves Python for Go probably isn't coming back... my experience is that it is slightly slower (10-20%, YMMV but we're certainly no…

My experience was Go was about 2-3x slower (development speed) than Python for prototyping. Web programming, though, which is a particular strength of Python and a particular weakness of Go. YMMV, of course.

I actually really do miss list comprehensions and properties and pervasive protocols for built-in types and really concise keyword/literal syntax. I don't miss metaclasses, and I only vaguely miss decorators. (Go has struct annotations and compiler-available-as-a-library, which in some ways are better.) Properties in particular are really useful for the evolvability of code; otherwise you have to overdesign up front to avoid a big rewrite as you switch from straight struct fields to accessors.

I'm actually leaning towards Java 8 + Jython 2.7 as I consider what language to write my startup/personal projects in. Jython 2.7 gives me basically all the language features I actually cared about in Python, and it fixes the Unicode mess that necessitated Python 3. It has no GIL and solid multithreading support. The Java layer gives you all the speed of Go and more. And the interface between them lets you seamlessly use Java within your Jython scripts, so you can easily push code down into the Java layer without having to rewrite your whole product.

Re: Python 3 can revive Python

#96
post #36

Python 3 isn't really good. It's not really bad, either. There's really not that many magic bullets (other than proper functional programming, maybe, which isn't about to happen in Python). People are leaving Python for Go because people have always left Python for fast compiled languages. Google ditched Python for C++ and Java. Java! I've seen a lot of projects get re-written in Java from Python, but no-one worried…

"People are leaving Python for Go because people have always left Python for fast compiled languages." I think the angst about Go comes from the fact that someone who leaves Python for Java may still come back, because you can develop far more quickly in Python than Java. But someone who leaves Python for Go probably isn't coming back... my experience is that it is slightly slower (10-20%, YMMV but we're certainly no…

I don't know why people are leaving Python for Go when they could be using PyPy or Shedskin. There are plenty of ways to be fast using Python.

Re: Python 3 can revive Python

#97
post #89
post #88

Why doesn't anyone seem to think the full number tower in python 3 is great? It seems to always be left out of discussions like this ... but I think it is a great and very "pythonic" thing to add to the language. [edit: because the numeric tower wrt integers wasn't new in python3, just other parts of the number hierarchy... see below] In that light I think unicode also makes more sense: text is text and numbers are n…

No matter how fast the OS can spin up another process, you still have to contend with the overhead of Python initialization itself. And I don't quite understand what you mean by the "full number tower".

> No matter how fast the OS can spin up another process, you still have to contend with the overhead of Python initialization itself.

Good point... but isn't part of that possible to reduce a little when python itself forks? I've not looked at the code, that might very well not be what happens when you use the multiprocess-module?

> And I don't quite understand what you mean by the "full number tower".

I was thinking of: http://legacy.python.org/dev/peps/pep-3141/

but apparently confused as to what had changed in python3 (mostly the change to division/true division -- which I still think is more pythonic, but less of a change than I thought).

So eg:

    $ python2 -c "print(1/2)"
    0
    $ python3 -c "print(1/2)"
    0.5
But I also thought there might be some differences wrt doing stuff like:

     $ python -c "print(2**10000)"
     19950(...)9376
But there isn't :-)

Re: Python 3 can revive Python

#98

Earlier quoted context omitted.

Out of curiosity: why?

I use map(print, list_of_tuples) quite a bit, but that possibly an artifact of my print-based debugging. I can only do this with print as a function rather than a statement, and the single line makes it easy to drop in or comment out as needed.

    >>> from pprint import pprint; pprint(list_of_tuples)

Re: Python 3 can revive Python

#99
post #24

That pretty much reiterates my points from last time we discussed (not many hours ago). https://news.ycombinator.com/item?id=7801004 Besides what already was said. It is also important to emphasize that Python 2 is already pretty good. So it is not that Python 3 is bad, it is just that it is very hard to improve on 2. Ironing out the warts is good, but this was not the right time. This should have happened 7-10 years…

Exactly. Python and JavaScript is a perfect demonstration of "worse is better". Python 2 is a vastly better language than JS, avoiding nearly all of its design misfeatures and having actually useful built-in types and standard libraries. Yet while Python spent a decade to go from 95 to 99 percent purity, JS took over the world through sheer ubiquity.

Given that the functional programming story in JavaScript is much more developed, "vastly better language" may be true as long as you only consider the object-oriented side of it.
Post reply on HN