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

-14

u/pjmlp Apr 24 '20

It is called C# and is already used alongside C++ in a couple of well known game engines.

11

u/peppedx Apr 24 '20

Honestly C# is great language but it is a different thing wrt C++.
As others said C++ niche is more similar to Rust or D.

-2

u/pjmlp Apr 24 '20

Well it depends on what one is trying to do, I still remember the days when every GUI toolking under the Sun was being written in C++ and it was the way to go for mobile apps (Symbian/Brew).

If you mean the niche of low level OS system libraries, I doubt most OS vendors will choose anything else other than C++, they already have their managed alternatives for the upper layers and millions of C++ lines on their kernel, drivers and GPGPU libraries.

Even Google has written that although they are using Rust on Fuchsia they don't advise to expose it on the OS SDK, on their language adoption documentation on Fuchsia's site.

4

u/peppedx Apr 24 '20

For example I do real time and embedded stuff. I don't plan to do it in C#, while rust is an option for the future.

0

u/pjmlp Apr 24 '20

Faire enough that is a good example.

3

u/max0x7ba https://github.com/max0x7ba Apr 24 '20

C# was a Microsoft fork of Java, not C++.

3

u/metapwnage Apr 24 '20

And the second one at that! This first, j++, met its death by litigation at the hands of Sun Microsystems.

2

u/pjmlp Apr 24 '20

Sure, but it contains a very sweet subset of C++.

7

u/lithium Apr 24 '20

It's also why visual studio takes 10 seconds to open just the welcome window now.

-3

u/pjmlp Apr 24 '20

Photoshop also takes several seconds to start and is written in straight C++.

Don't mistake languages with lousy programmers.

4

u/lithium Apr 24 '20

Agreed, but in photoshop's case it went to shit when they started using html/js/css for their dialogs.

The fact that VS took a dive when it moved to XAML and C# is undeniable at this point, but I suppose you're right, it could be that they just happened to get lousy programmers at the exact same moment too.

-2

u/pjmlp Apr 24 '20

Have you tried XAML with C++ in UWP?

It worse than with C#, due to having to do AddRef()/Release() all over the place, including crossing process boundaries and sandboxing.

So writing in C++ isn't necessarily a guarantee of blazing performance, other factors matter as well.

2

u/lithium Apr 24 '20

Deviated quite a bit from the original point but you'll get no arguments from me that XAML is slow and bad. One of the major aforementioned "other factors".

(not strictly fair to blame XAML the markup itself, but you know what I mean)

1

u/pjmlp Apr 24 '20

Coming back to my original point it must not be a zero sum game.

Instead of forking C++, while throwing away all the eco-system benefits, just combine it with other language of your liking.

From my point of view there is more to gain from doing polyglot programming than to lose.

Using C# as a better C++ (debatable I know) doesn't mean having to throw away C++.

They are both there on a VS full install.