Hacker News new | ask | show | jobs
by jokoon 814 days ago
Someone on reddit said that the cpp2 repo was a bit old, and that is true, although he may have started this as an experiment influenced by typescript and left it on the side at some times.

Anyway I have no idea if cpp2 would get support from microsoft or other devs, but cpp2 seems like the most humble and "least risky" solution for the future of C++, and I really want it to be.

What I remember the most that Herb Sutter said in his cpp2 talk, is that it aims to avoid 95% of bad coding practices that C++ allows today.

It's safe to say that beyond the valid criticism of C++, that it quite a good goal and it would improve C++, without using a new language, and that's good, because a new language causes problems: new toolchains, new semantics, new specifics, no experience on a new language.

Cpp2 is not a new language, it is the same semantics of C++, except it has a new syntax and enforces good practices.

One very interesting point: in the future, cpp2 allows a cpp2-only compiler to be born, and it would still live next to C++ binaries without problem. That cpp2 compiler might probably be much faster since the cpp2 is a smaller stricter subset.

3 comments

How about Google's Carbon language?

https://github.com/carbon-language/carbon-lang

Carbon and Cpp2 are both "C++ successors," broadly speaking. However, they take different approaches in their design:

Carbon is a brand-new language that's designed to have seamless interoperability to C++.

Cpp2 is C++, just with a different syntax. (The goal is to even be able to mix Cpp2 and C++ syntax in the same source file. The initial implementation transpiles Cpp2 to C++ source code, similar to how the original C++ implementation transpiled C++ to C, rather than implementing a full compiler.)

Their overall goals appear to be different, too: The Carbon README states, "Existing modern languages already provide an excellent developer experience: Go, Swift, Kotlin, Rust, and many more. Developers that can use one of these existing languages should." With that mindset, it sounds like more of a stopgap for projects already invested in C++. In contrast, I believe that Sutter would argue that C++ still has the potential to be a viable choice for many tasks, and Cpp2 is a way to realize that.

> Cpp2 is C++, just with a different syntax.

Not really, that is like telling CFront or Objective-C (Stepstone days) were C with a different syntax.

> Anyway I have no idea if cpp2 would get support from microsoft or other devs…

Doesn’t he work for Microsoft?

Yes but it’s his own personal project
> Anyway I have no idea if cpp2 would get support from microsoft or other devs, but cpp2 seems like the most humble and "least risky" solution for the future of C++, and I really want it to be.

That ship has sailed. They already have C#.

To be fair C# is vastly different in terms of semantics compared to C++. There's a lot of areas where it's not viable to use C#, and IMHO it also has its own share of legacy and bad decisions from its "Java clone" days that make it impossible to prefer it to C++ sometimes.

Btw Microsoft is definitely interested into adopting new languages, just look all the effort they've been pouring into Rust lately.

Rust is now the official system programming language for Azure infrastructure, alongside managed languages, and it appears there is a soft spot to use Go instead of C#, when looking at what Azure opens up.

WinDev, Office and XBox is another matter, they are deep into C++ and COM culture.

C# is so old by now, if it would be a good replacement for C++ at MS, it would already have replaced it.
Don't mix technology with the internal politics at Microsoft, where some business units won't use anything else besides COM and C++, no matter what.

They are so strong that they were responsible pushing the whole company into the whole Windows 8 debacle with WinRT, where COM was supposed to finally replace .NET.

https://arstechnica.com/features/2012/10/windows-8-and-winrt...

Java and C# are in their "let's get functional" phase.
:(

C# has been at that for more than a decade and a half already. Java's arrival to the party is extremely late and still lacking in many areas.

C# could have been like D back in 2001, yet it had to wait to go open source, away from the wings from WinDev politics, having to provide a replacement to C++/CLI capabilities in a cross-platform way, to finally expose the full CLR to C#, without us having to routinely manually generate MSIL or reach out to C++/CLI.

Singularity and Midori were hardly taken seriously in any form by WinDev.