5 ms·
Could you precis why it's taking multiple years? Surely there's a formal equivalence that could be automatically implemented wrt the code itself?
by pbhjpbhj 7y ago
Could you precis why it's taking multiple years? Surely there's a formal equivalence that could be automatically implemented wrt the code itself?
- lidHanteyk 7y agoPython 2 and Python 3 are distinct languages with a lot of commonalities. It's a difficult port that cannot be automated.
- kevin_thibedeau 7y agoIt's easy to gradually upgrade Py2 code. Start introducing the future imports. Unicode handling is the only tricky one (though not so bad when the codecs module is consistently used). Then start running files through 2to3 and making the code forward compatible. This can be done over a long time span while maintaining full 2.7 compatibility.
- marmada 7y agoThese types of comments are confusing. The developer of Mercurial has stated that it took/is taking them several years to port to Python 3. I'm inclined to believe them compared to some random stranger who asserts that it should be easy for Mercurial to be ported to Python 3. Unless you were saying that most other/non-Mercurial programs are easy to port to Python 3, which could be true.
- lidHanteyk 7y agoHave you ever carried an application using Django, or Twisted, or Zope, through this process? It is not easy. Many different libraries with various incompatibilities and versions can lead to real difficulties merely in upgrading for security releases. Additionally, unless one is containerized, one must contend with the underlying platform's issues, as the platform must also switch from Python 2 to Python 3. I understand your opinion: It is the party line. But it doesn't actually help much when the process as described will take years and people only have months, and this is further worsened by the fact that PSF did not have to deprecate the entire Python 2 ecosystem in order to stop supporting CPython 2.7.
- kevin_thibedeau 7y agoThe is more the fault of certain libraries playing non-Pythonic games with monkeypatches and magic code on import. Mercurial is not burdened by those troubles. The writing was on the wall ten years ago. Failure to take action is not Python's fault.
- jordigh 7y agoMercurial treats everything as bytes. Whatever you store in your repo, that's what Mercurial reads -- bytes. There are no encodings, there are no strings. Only bytes. You don't want your VCS to start having opinions about which language you should speak and how you should encode it. PEP 461 was the bare minimum we needed before porting to Python 3 could happen: http://legacy.python.org/dev/peps/pep-0461/ http://legacy.python.org/dev/peps/pep-0461/ We needed a way to put things into bytestrings. And after that, it's just nothing but work. Lots of it. Little of which could be automated. I get a little impatient, personally, with people who think that upgrading software is easy. We don't actually care about Python. We care about version control. Python is just some thing in the middle that is helping us produce version control. A multi-year effort to upgrade to Python 3 (or 3.8 or whatever) isn't giving us or our users a net benefit. In fact, until recently, it was a net loss, because Python 3.5 or 3.6 had slower warmup time, which is terrible for a tool like hg that needs to pay that cost every time you run any command. Instead, Python 3 created busy work. Almost five years of it.
- armitron 7y agoMay I ask why you think it's worth doing all this work, especially now that Git has - clearly - won. How do you motivate yourself to keep working on mercurial and at what point do you cut your losses short? I assume you're not getting paid for it, so besides bragging rights or a nice CV entry, what else is there for you to look towards?
- jordigh 7y agoGit is horrible to use. Few people like it, most only tolerate it. Regardless of how you feel about git, there's plenty of literature regarding how awful the git user experience is. Mercurial's greater modularity also has made it easier to implement improvements for monorepos, although personally that's less important to me. That's why I still use and work on Mercurial.
- bipson 7y agoHighly subjective I would say. Git is not horrible to use. And even before I was a proficient Git user, mercurial was giving a team of 5 people a lot of work trying to fix stuff that just works on Git.
- pjc50 7y agoNot really, no. There are some automatic transforms that "2to3" will do for you, and it's mostly automated, but the string handling is fundamentally different in subtle ways and there are a few places where you have to alter your entire architecture (e.g. make all your exceptions inherit from Exception). If your architecture makes too many assumptions about the equivalence of characters and bytes problems can be severe. The decision to make it not backward-compatible and thereby force-deprecate millions of lines of working Python code was extremely expensive.
- BJBBB 7y agoTend to agree. My previous employer did most of the ATE, quality, and production control in Python; and hardware drivers mostly in C. It worked reliably for about 15 years. During late 2017, the new 'code boss' mandated Python 3 for new stuff, and to convert as required for existing stuff. Production continued with little or no problems until an important customer did a major spec change, plus the new safety and EMC regulations and standards became effective, so we had to get some stuff re-certified and some processes accredited (again). After three months, the boss fired the three programmers and assigned the task to the quality, manufacturing and regulatory engineers. We looked at the code for a few days, then said nope and re-designed and wrote in C/C++. When I left in November, things were humming along well, but the parent company saw this as a huge future liability and commenced to shut down that part of the company that made that class of widgets. Think about - a group of less than 40 production people and a few engineers that pumped 25 million USD profit annually into the mother company was dropped because of potential future code shenanigans. Because of these experiences, I discourage use Python professionally (unless the contract allows for some specific indemnity clauses) for quality and manufacturing, and know of other manufacturing and hardware activities abandoning Python for new stuff and 'returning' to C and C++. I continue to enjoy and use Python (mostly 3) for personal projects, where support and making money do not always matter.