News for hackers. Stuff that matters.
Re:Where are we in the Python 3 transition? by jacquesm on Friday January 01, 2016 @05:10PM (#10823716)
The python 2.x to 3.x change will be studied for many years. How to completely rob an ecosystem of its momentum in one fell swoop. I still don't understand why 3 couldn't have had a mode switch defaulting to 2.x behavior. The whole debacle would have been avoided and all the ugly details would have been hidden behind the language implementation. It would have definitely been more work and you might even call it an ugly hack (and Ed DeCastro would likely have thrown a fit if one had asked his opinion) but it would have at least made the transition instant and seamless.

The present mess will - if not resolved in a much more drastic fashion - cause more and more teams to switch away from python. It's a real waste of the potential that python had (and still has).

I never even bothered porting my code, I'm 'stuck' on 2.7 and anything new gets written in another language. Even bloody PHP, the language everybody loves to hate on, gets deprecation and backwards compatibility better than python.

Re:Where are we in the Python 3 transition? by nostrademons on Friday January 01, 2016 @06:04PM (#10823947)
That's the same approach that IE took for many years - IE7 embedded the IE6 rendering engine, IE8 embedded both the IE7 & IE6 rendering engines, etc. You could switch between them with a meta tag, or with developer tools.

It didn't stop IE from being robbed of momentum.

I think this is more a case study of what happens when fundamental assumptions that a technology ecosystem is based upon change. Things like string & collection types, async mechanisms, interface/protocol definitions, package managers, programming paradigms, developer preferences, and hardware performance characteristics are foundational to a language's definition. After all, the network effect that binds a language ecosystem together is all based upon being able to share code between multiple unrelated developers.

In Python's case, unicode happened. A lot of old Python code was written on the assumption that everything was a sequence of ASCII bytes; it was just plain broken in the presence of unicode characters. There's little you can do here other than accept that much of your ecosystem's strength is gone anyway and build for the future.

I suspect we'll see similar problems crop up in other languages in the near future; in particular, promisification in ES7 is a big threat to the existing Node ecosystem, which is all based upon callbacks. A language that jumps on the promise bandwagon early (Rust? Go? Elixir?) could rob Node of much of its momentum. Similarly, if Android & iOS win out over the web, that could lead to a big resurgence in Java or rise of Swift over server-side technologies like Node or Go.

Re:Where are we in the Python 3 transition? by jacquesm on Friday January 01, 2016 @06:05PM (#10823954)
Have a look at how the Erlang ecosystem managed the unicode transition.
Re:Where are we in the Python 3 transition? by nostrademons on Friday January 01, 2016 @06:11PM (#10823986)
I would take the Python 3 ecosystem over the Erlang ecosystem any day.
Re:Where are we in the Python 3 transition? by jacquesm on Friday January 01, 2016 @06:12PM (#10823991)
Interesting, why?
Re:Where are we in the Python 3 transition? by nostrademons on Friday January 01, 2016 @06:27PM (#10824067)
I'm far more likely to find a library I need in a Python 3 version than in an Erlang version.

Take a look at the PyPI stats for Python3 packages vs. the Hex stats for Erlang packages:

https://python3wos.appspot.com/

https://hex.pm/

The vast majority of common packages are compatible with Python3. Moreover, a common Python package gets about 100x the downloads of a common Erlang package. Even with only 20% of Python users on Python3, that's still about 20x the users that Erlang has.

Python3 adoption only sucks compared to the installed base of Python2. Compared to any niche language - Haskell, Erlang, Rust, Swift - it's massive, and you're much more likely to find a battle-tested library in Python3 than in your niche language.

(The bulk of my work is actually in Node and Swift these days. Node has a mammoth package library, but that's because its culture encourages many small modules and lots of code re-use. In my experience, I've found that the chance of finding a robust, well-supported Node module is roughly equal to the chance of finding a robust, well-supported Python2 library, and is maybe 20-30% greater than the chance of finding a robust, well-supported Python3 library. The Swift library situation is much, much worse than Python3.)

Re:Where are we in the Python 3 transition? by jacquesm on Friday January 01, 2016 @06:33PM (#10824090)
Agreed on the library part, that's my biggest hang-up in making more (and faster) progress with Erlang projects. Sometimes I even end up rolling my own and coming from languages with substantial 'batteries included' library systems this is a real drawback.

On the other hand, when it finally works it is absolutely bullet proof and that's a feeling I have with very few other languages and eco systems.

The degree of isolation between subsystems and the reliability are absolutely un-matched. Neither is the learning curve :(

Re:Where are we in the Python 3 transition? by BuckRogers on Saturday January 02, 2016 @02:02AM (#10825382)
Have you tried Elixir? If so, just wondering if you found the learning curve to be as difficult as Erlang.
Re:Where are we in the Python 3 transition? by jacquesm on Saturday January 02, 2016 @05:02AM (#10825723)
No, but it is definitely on my 'todo' list.
Re:Where are we in the Python 3 transition? by Drdrdrq on Saturday January 02, 2016 @08:28AM (#10826125)
> It didn't stop IE from being robbed of momentum

IE actually handled the transition very well, because backwards compatibility was the thing that kept it in the game. When it lost it was because this feature no longer mattered (that much).

Re:Where are we in the Python 3 transition? by choosername on Friday January 01, 2016 @08:11PM (#10824440)
so python is the IE of programming languages? yikes ;)
Re:Where are we in the Python 3 transition? by nostrademons on Friday January 01, 2016 @09:11PM (#10824624)
Python 2 is, yep. And Java, and C++, and PHP, and all those other languages that were super popular at the turn of the millenium but now feel really dated.

Actually, C++ has an even bigger claim to the title, because it now has "modern" versions that are much better, more standards-compliant, and have language features borrowed from newer languages...but a number of enterprises are stuck with no-exceptions, no-STL, no-move-semantics subsets because that's how all the existing code is written.

Re:Where are we in the Python 3 transition? by blub on Saturday January 02, 2016 @03:06AM (#10825500)
The IE metaphor is terrible for programming languages :)

I don't know about PHP, but C++ (and I suspect Java too) is backwards compatible and doesn't belong in the same class with Python. One can still compile older code and start using new features as they see fit, there is no hard break.

Re:Where are we in the Python 3 transition? by jacobolus on Friday January 01, 2016 @06:26PM (#10824063)
> How to completely rob an ecosystem of its momentum in one fell swoop.

I suspect your perception depends a lot on which part of the community you are observing. As far as I can tell, the Python community is as vibrant and fast-growing as ever, with continuing huge crowds at Pycon, brisk sales in Python books, active meetup groups around the world, hundreds of python bloggers, several very active mailing lists, etc.

Most of the change I’ve seen is the rise in other language communities (Clojure, node / server-side Javascript, Go, Swift, ...) which share certain cultural priorities or programming niches with python, and have caused some number of Pythonistas to switch to something else. I suspect this would have happened about as much with or without the Python 3 project though.

Re:Where are we in the Python 3 transition? by jacquesm on Friday January 01, 2016 @06:42PM (#10824127)
> I suspect this would have happened about as much with or without the Python 3 project though.

That could be, of course for me the lens I'm looking through is very much a personal one. Backwards compatibility is a very important concept to me and I really dislike breaking changes, especially when there is no graceful intermediate phase with deprecation and warnings and ample time to move. It's what completely turned me off drupal and python more or less did the exact same thing. I'm sure that for newcomers to python the result is a much improved experience but from my point of view this was an un-necessary hardship.

Re:Where are we in the Python 3 transition? by snowwrestler on Friday January 01, 2016 @07:36PM (#10824339)
It seems like kind of a double standard to say "I don't like that they released breaking changes, so I'm going to switch language." Isn't switching language an even larger breaking change?
Re:Where are we in the Python 3 transition? by BuckRogers on Saturday January 02, 2016 @02:50AM (#10825477)
It is, but if you have to do a rewrite anyway?

The real gem in the rough with Python2 is PyPy4. You don't have to rewrite anything, while gaining CPU performance as a feature and dropping the GIL.

If you're not gaining that, I would probably switch to another language too. Elixir, Go, Swift, among others are definitely worth porting too.

Re:Where are we in the Python 3 transition? by themgt on Friday January 01, 2016 @05:55PM (#10823905)
Yeah, I'd argue this article is itself a quite amazing form of denial. The idea that 7 years into the transition, "20% of the scientific Python community and 20% of the Python web community have [switched to Python 3]" is simply abysmal.

Ruby and Python were always going to have problems with computing's concurrent future, but holy damn did Python just tie its shoelaces together and completely unsurprisingly fall on its face.

The fact no one is doing a "Ruby 2, 20% of rubyists finally reaching acceptance" blog post is a testament to how to move a language forward properly. And ffs is Ruby 2.x not more of an upgrade from 1.8 than Python 3 is from 2?

Re:Where are we in the Python 3 transition? by takeda on Friday January 01, 2016 @09:11PM (#10824623)
There was nothing wrong with Python 3, what they really messed up is to give so much time for the transition. 10 freaking years!!! That's the problem, people won't do anything unless you light fire under their asses.

Ruby f-cked up with 1.8 to 1.9 transition (notice that it was also a minor version change) yet people migrated without a problem because they knew that if they stay on 1.8 soon their programs will stop working everywhere.

Python did everything they could do to help migrate (it even allows you to install all versions (I know there are no problem with anything between 2.4 - 3.5) and have them run without conflicts side by side.

The only mistake they made is to give too large window for migration. People just now started working on migrating to 3.x because development on 2.7 stopped in 2015 (even though 3.x was available for 7 years now). And there are still people who will wait until 2020 (once security patches will stop being provided) until they will decide to move.

There's so much FUD with Python 3, and goes as far as people wondering which version to use to learn it. I mean learning all the difference is at most as couple hours (and I'm being conservative here). For a beginner the only major difference is that the print is a function and not a statement, the whole unicode is barely noticeable unless you are writing code that should work on 2.x which shows it was needed, because wringing correct unicode code in 2.x is hard.

Re:Where are we in the Python 3 transition? by BuckRogers on Saturday January 02, 2016 @03:25AM (#10825530)
Ruby 1.8 code does not just "stop working". Just as this 2020 Python2.7 political stunt won't stop anyone's code from working.

The migration window was extended because the core development team didn't want to lose control of Python(2). Someone else would've taken control for sure, and for myself, I've already ported to PyPy4 instead of Python3.

A much easier transition than going to Python3 and nets you CPU performance and GIL-free Python.

Re:Where are we in the Python 3 transition? by takeda on Saturday January 02, 2016 @06:58PM (#10828674)
What I meant is that as time passes it's harder and harder to get working Ruby 1.8 installation. With RHEL for example you're guaranteed that there will be Python 2.7 until 2024, which delays adoption.

As for PyPy4, majority of people don't chose python for performance. Even PyPy will perform worse than statically compiled languages. If performance is the goal, you should probably look into golang or even C.

Re:Where are we in the Python 3 transition? by BuckRogers on Monday January 04, 2016 @12:01AM (#10834105)
You can have the best of every world with Python on PyPy. Most people agree PyPy's performance levels reach the point of "good enough", while allowing you to write pure Python.

Personally, I prefer to write Python over Go or C. No reason to not have your cake and eat it too.

Re:Where are we in the Python 3 transition? by gravypod on Friday January 01, 2016 @05:35PM (#10823821)
Sadly I have to agree with you. Some things that changed were not even necessary.

Why would the development team make replacement packages rather than fixing underlying implementation, for example imp and importlib.

There was also no sugar added to support this mangled jungle gym of package replacements. Backwards compatibility is a thing of dreams for the python developer.

This is only one of many of the problems with the change.

Re:Where are we in the Python 3 transition? by msellout on Friday January 01, 2016 @05:23PM (#10823772)
> gets ... backwards compatibility

That should be past tense, "got" as the Python community has certainly learned its lesson. Luckily it wasn't as bad a mistake as the Perl folks made.

Re:Where are we in the Python 3 transition? by jacquesm on Friday January 01, 2016 @05:27PM (#10823790)
> That should be past tense, "got" as the Python community has certainly learned its lesson.

Evidence of that to me would be a proposed fix and maybe I'm too out of touch with what's happening in the python world but from what I see the two main version still co-exist rather than that any attempt at unification has been made. Am I missing something major here? My understanding is that you migrate your project to 3.x or you're stuck in the past.

> Luckily it wasn't as bad a mistake as the Perl folks made.

That's up for debate.

Re:Where are we in the Python 3 transition? by nostrademons on Friday January 01, 2016 @06:10PM (#10823977)
Python 2 and Python 3 are different languages. The core Python team is working exclusively on Python 3. If you're using Python 2, you're using a deprecated language, with all the pitfalls that entails. It's much like using Visual Basic or Delphi in the mid-2000s: you can do it, you can build some fairly decent applications quite productively, but you aren't going to get any improvements in the future and you're not going to be at the leading edge of technology.
Re:Where are we in the Python 3 transition? by kzrdude on Friday January 01, 2016 @05:53PM (#10823901)
It sounds like you are still in the Denial phase?
Re:Where are we in the Python 3 transition? by jacquesm on Friday January 01, 2016 @05:59PM (#10823919)
No, I'm just lucky that I don't actually need anything that 3.x has to offer. The python code I wrote uses a bunch of modules that are not available for 3.x so that's one reason for being stuck (and they won't be ported either and I don't feel like doing it myself). The old code works and works well enough that I just set it up in a VM where it will happily work for decades to come. New stuff gets written in other languages, once burned, twice shy.

I loved the way I could use python to quickly prototype some GUI based program, but I don't love it that much over that I can't write the same program in a wide choice of different languages with other ideas about long term stability.

Re:Where are we in the Python 3 transition? by msellout on Friday January 01, 2016 @11:36PM (#10825053)
Before the tragedy of the Perl 5-6 transition, I don't think people realized how important backwards compatibility is. I understand your fear, but perhaps the most reliable team is the one that's already made the mistake and been burned.
Re:Where are we in the Python 3 transition? by msellout on Friday January 01, 2016 @10:46PM (#10824907)
Yes, you are missing that the str as bytes to str as Unicode transition was a tough problem. That's the major incompatibility. Once that decision (mistake?) was made, the break was irrevocable. Perhaps not in theory, but in the practice of how Python 2 folks have used strs.
Re:Where are we in the Python 3 transition? by raiph on Saturday January 02, 2016 @01:08PM (#10827069)
Aiui the Unicode problem is even more complex than most folk realize for the reasons I explain in this comment.

-----------------------------------------

On the final technical destination implied by Unicode:

The final technical destination implied by the Unicode standard is correct handling of "grapheme clusters".[1]

-----------------------------------------

On the half way point at which we've arrived:

In the 80s, there were a bazillion incompatible "character" sets and encodings of those "character" sets. Unicode was a response to this.

The half way point envisaged by the original Unicode design was to firmly establish a single overall "character set" view with a handful of encodings.

Imo we've arrived at this half way point.

-----------------------------------------

On the string types of languages:

Programming languages designed before Unicode emerged adopted the "byte=character" view to determine the character unit of their default string type, leaving higher level views to library code and functions. This is the level Python began at. But the more established Unicode becomes, the more important the higher level views become.

Newer languages have mostly been designed to optimize for Unicode's half way point (but not the eventual destination). They typically support the byte view in some form but adopt the "codepoint=character" view to determine the character unit of their default string type. Aiui, this is where Python 3 is at.

A handful of newer languages continue to support the byte and codepoint views in some form but have adopted the highest level "grapheme=character" view for the character unit of their default string type. I think the most visible new language that's been forward-thinking enough to adopt the final destination view (grapheme=character) is Swift.

-----------------------------------------

[1] Folks trying to understand this point should find it helpful to start with the deceptively brief hint inherent in http://www.unicode.org/glossary/#Grapheme which defines "what a user thinks of as a character".

Next, I'll quote the perluniintro[2] document:

> A Unicode logical "character" can actually consist of more than one internal actual "character" or code point. For Western languages, this is adequately modelled by a base character (like LATIN CAPITAL LETTER A ) followed by one or more modifiers (like COMBINING ACUTE ACCENT ). This sequence of base character and modifiers is called a combining character sequence. Some non-western languages require more complicated models, so Unicode created the grapheme cluster concept, which was later further refined into the extended grapheme cluster.

[2] http://perldoc.perl.org/perluniintro.html

Re:Where are we in the Python 3 transition? by hackbinary on Friday January 01, 2016 @06:56PM (#10824204)
They got their transition better than the Perl 5 to 6 transition, and arguably better than the Ruby 1.8 --> 1.9 --> 2.0 transitions.