r/cpp • • Apr 24 '20

C++ Fork?

Let me start by simply saying that I am fairly new to C++ and this is the first time I am posting to this sub-Reddit. I hope I am not breaking any rules here.

I have a question:

Would it be possible for C++ to be forked into a newer more modern version like the way Python went from version 2.x to 3.x? Maybe clean-up the language a bit, remove some redundant features etc.

0 Upvotes

51 comments sorted by

View all comments

24

u/BrainIgnition Apr 24 '20

Oh, we discussed that numerous times. And the gist of those discussions is that there are quite a lot of people who require backward compatibility. Things preventing C++98 code to be used by C++next are very unlikely to get approved by the commitee, because adapting existing codebases to major language changes is simply infeasible.

The python (r)evolution has been sort of a disaster -- there are major projects like gyp where it took a decade until people even started porting. Such a split is absolutely harmful to the ecosystem.

However, one should mention the Epoch proposal which tried to provide a mechanism for language changes while maintaining a "sufficient" degree of compatibility with existing code. It currently seems to be the most feasible approach, but it is uncertain whether its issues (with e.g. concepts) can be resolved.

I recommend taking a look at D or Rust which could be remotely considered as "newer more modern" versions which may or may not fit your bill.

8

u/jube_dev Apr 24 '20

The python (r)evolution has been sort of a disaster -- there are major projects like gyp where it took a decade until people even started porting. Such a split is absolutely harmful to the ecosystem.

What disaster? Python has never been so popular nowadays! Some libraries are resisting, that's not a disaster. And nobody ever said that such a transition would be instantaneous. 10 years is not so bad.

29

u/echidnas_arf Apr 24 '20

The disaster was in how long the transition took with respect to what was originally planned. Just look at how many times the official deprecation of Python 2 has been postponed, and how abysmally low the adoption rate of Python 3 has been for years.

The rise of Python has been largely driven by the "data science" and ML hype, and it's an orthogonal topic with respect to the 2->3 transition.

8

u/TheFlamefire Apr 24 '20

It's falling apart now. There are libraries out there which don't get updated to Python 3 while others only support Python 3 so if you need both you need to carefully check versions or drop one of them

Heavy amounts of work have been done to support Python 2 & 3 in one code base which is expensive. And some libraries didn't bother leading to more issues.

To get another picture how hard it was: The end of Python 2 was announced early, then shortly extended by 5 years, and almost 5 months after the official end the "last" Python 2 version was released...

7

u/BrainIgnition Apr 24 '20

Yes, python is quite popular now. However, in the past it has been severely hampered by said incompatibility, especially in the 3.0 to 3.3 era when python scripts couldn't be written in a way compatible with both python 2 and 3.

Some libraries are resisting, that's not a disaster. And nobody ever said that such a transition would be instantaneous. 10 years is not so bad.

I politely disagree. It forces developers to choose between recreating/porting existing libraries with the new standard or staying with the old standard. This creates significant costs for everyone involved and potential benefits have to be weight against them. The python folks also realized that and made it possible to port scripts in a backward compatible manner with version 3.4.

1

u/adnukator Apr 24 '20

In hobby projects this is not much of an issue. It becomes significantly more prominent in scenarios where you have a massive corporate ecosystem with many dependencies. Just because undoubtedly many people use Python, I doubt it has the huge legacy baggage that C++ has to address with each new version. That would probably make a Python-like fork much more severe for C++ than for Python