r/ProgrammingLanguages • • Nov 21 '17
Python 3 and Firefox 57 (an observation)
[deleted] — view deleted post
10
Upvotes
r/ProgrammingLanguages • • Nov 21 '17
[deleted] — view deleted post
13
u/Syrak Nov 22 '17
I'm not sure the comparison is fair. The main reason why Python 2 is still around is that businesses have large codebases that are too costly to upgrade to Python 3, no matter how many other new features the language could have offered. Firefox is an end-user product with no such constraints.
8
u/Uncaffeinated 1subml, polysubml, cubiml Nov 22 '17
That's actually pretty trivial as far as breakages go, because it can easily be fixed automatically. The real problems as far as breakages go are the changes to string handling and iterators. There's also a lot of obsolete syntax that got dropped, though that's not an issue for anyone trying to move from 2.7, but legacy code bases tend to be full of it.
7
u/oilshell Nov 22 '17
I think this has been discussed to death in the Python community?
The Python core team explicitly tried to provide enough "carrots" for people to migrate to Python 3. The, idea like you say, is to balance the costs with benefits.
In my opinion, and for my use cases, they didn't provide enough benefit. I still use Python 2. But others disagree and they went to Python 3.
So yes there's more of a split than desired, and I personally think they could have done more. But I don't see what's new about this discussion. If you think they didn't even realize this concept of balancing costs and benefits, then you're mistaken. But if you think they realized it, but didn't quite succeed, then I agree with that assessment :)
FWIW I ported Oil to Python 3 and then back to Python 2 [1], so this isn't just shouting from the sidelines. Ironically, the unicode support in Python 3 is really bad for Unix-style programming. File systems don't have an encoding! The stdout of "grep" as called by
subprocessalso has no encoding! Some things are better dealt with as byte streams.Python 3 forces you to know specify encodings in the "wrong" places in your program. It might good for "application" programming, but it's not good for writing Unix command line tools (which are a big part of Python's user base).
Since I forked the Python VM, and cobbled together a Python bytecode compiler in Python, I'm toying with the idea of porting my personal Python scripts to "OVM". It's more of a pipe dream at this point, but it might not be harder than porting all the Python 2 I have lying around.
Although I guess I could keep using Python 2 in 10 years? I think when python-dev abandons it in 2020 I think, there will be unofficial forks to maintain it. The codebase is very mature and well-studied.
[1] http://www.oilshell.org/blog/2017/04/08.html
6
u/BoarsLair Jinx scripting language Nov 22 '17
There are definitely trade-offs either way, certainly, as it applies to languages and backwards compatibility. Take a look at C++. Even its advocates realize that it's a terribly complex, syntactically ugly language with lots of dark corners and gotchas. I think much of that is due to the fact that it's tried very hard to remain compatible both with C and earlier versions of itself. That means you still have to support code that does things the old way, even though there are much better solutions in modern C++. There are literally billions of lines of C++ out in the wild, so that's critically important to that community.
This devotion to stability and backwards-compatibility also makes it easier to choose C++ for large-scale/long-term infrastructure or applications, because everyone can be pretty confident that the next C++ standard isn't suddenly going to break backwards compatibility over the next decade or two, and bifurcate the community between pre and post compatible versions. It's fairly amazing to me that this is STILL an issue with Python all these years later. Apple doesn't even ship Python 3.0 as part of their OS, if I recall correctly.
Speaking of Apple... minor breaks in compatibility between versions doesn't seem to be harming Swift adoption. I think this is partly because it's still a young and growing language without huge amounts of legacy code, so these are seen as changes for the long-term health of the language. I think Apple also made it clear from the start that they'd be making breaking changes in the short term.
I don't necessarily think there's a simple or easy answer, other than the obvious observation that the longer you wait, the harder a compatibility break will be for a language and its community.
2
u/PaulBone Plasma Nov 23 '17
Hurray FF57 ;-)
1
u/GNULinuxProgrammer Nov 22 '17
Literally solvable by a trivial regexp. You can even ask this in job interviews and filter bad candidates. Python 2 -> Python 3 is not an easy problem but that print thing is a minor inconvenience.