Google's Carbon programming language could be a worthy … – TechRadar

Posted under Programming, Technology On By James Steward

When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works.
Google is looking to make programmers’ lives easier
The programming language C++ will turn 38 years old in 2023, yet remains highly popular, having recently been recognized as the fastest growing programming language (opens in new tab) since the Covid-19 pandemic.
The age of the language primarily poses two major problems: it is saddled with technical debt, and is regularly criticized for missing features and simply being unintuitive. It has also had time to become so embedded that getting programmers to accept an alternative en-masse is an uphill battle.
Enter Google, and Carbon, a programming language it first unveiled in July 2022 that it hopes will wipe away technical debt by starting over and allowing developers to merge their own features via GitHub (opens in new tab). It also wants to offer a compelling reason for developers to gradually switch to it by being interoperable with C++ code, rather than gunning for its crown.
TechRadar Pro had the opportunity to speak with Phil Nash, Developer Advocate at “clean code environment” software provider Sonar, the author of the C++ test framework, about what Carbon aims to do and how it intends to do it.
Not exactly. The Carbon programming language is not technically a replacement for C++. Instead, it is designed as a successor. That may seem like splitting hairs. But the distinction is important: Carbon is intended to be used alongside C++. The interop story is essential as it allows you to keep your investment in years, maybe decades, of legacy code and third-party libraries.
C++ has a reputation for being a complex and hard to use language – full of pitfalls and gotchas.
There are several significant issues in C++ that Carbon addresses. These problems in C++ are the result of decades of technical debt in the language that, because of the priorities of C++ evolution, cannot be addressed within C++ itself. 
The language is notoriously hard to parse – even for tools – and often requires many extra keywords to get the behavior you would like by default. Its original take on generics evolved into a fully fledged meta-programming language, yet had been unable to fulfill some of its early goals.
Carbon also aims to address the governance model: favoring a Benevolent Dictators (emphasis on the plural) model with an open evolution process on modern tools – rather than an international standard (ISO) that is optimized for representation by nations and corporations. 
Built into the evolution model is the expectation of breaking change – and a tool-based approach to dealing with it.
Rather than a BDFL (Benevolent Dictator For Life) model, the governance team (of three people) will periodically be changed. 
The evolution process occurs in public using familiar tools, such as GitHub and Discourse and is open to external contributors.
ISO participation is heavily biased towards those whose employers have a vested interest in a particular direction of language evolution – although this depends on the country. 
The closed nature of the process can lead to a disconnect between the committee and the community – and lead to accusations of misplaced motives. However, on the flip side, that same closed process model does provide a neutral ground for employees from competing organizations collaborating towards a common goal.
A cleaner, simpler, syntax that is safer by default. It is also easier to parse – and therefore easier to write effective tools for (including those tools to help migrate after breaking changes to the language).
The other major successor announced so far is Herb Sutter’s Cpp2. Another language of note is Circle – although this is pitched more as a C++-with-extras – a playground of ideas that could go into C++ itself.
Cpp2 compiles down to C++. More specifically it compiles down to readable C++. This is important because, in theory, it means that if you decide to abandon Cpp2 you can take the generated C++ and just carry on as if it was always written that way. 
It is also being designed in tandem with major proposals for equivalent features in C++. If any of these are adopted the difference between the languages gets smaller.
Enough of the community would need to commit to it for it to be worthwhile, and enough contributors need to commit their time to keep it evolving. 
For many Carbon may not be taken seriously while it is largely seen as under the control of Google, so the future of the leadership team is a big factor, too. With other contenders, like Cpp2, also emerging it has a good chance, but is by no means guaranteed.
This has intensified interest in ways of simplifying the language. Ideas from Carbon – and Cpp2 – will likely inspire the future direction of C++ – just as ideas from Rust and Circle already have. C++ is not going away any time soon.
Sign up to theTechRadar Pro newsletter to get all the top news, opinion, features and guidance your business needs to succeed!
TechRadar is part of Future US Inc, an international media group and leading digital publisher. Visit our corporate site (opens in new tab).
© Future US, Inc. Full 7th Floor, 130 West 42nd Street, New York, NY 10036.

source

Note that any programming tips and code writing requires some knowledge of computer programming. Please, be careful if you do not know what you are doing…

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.