Active Hackathon

A new programming language that might be successor to C++

Carbon reduces existing libraries' tech debt and makes extending those libraries easier.
Listen to this story

During the recently held ‘CPP North’ conference in Toronto, Chandler Carruth, a software engineer at Google, introduced developers to a new programming language called Carbon. According to Carruth, Carbon is an experimental successor to C++, which is ageing, and there is a growing demand in the developer community for the programming languages to evolve.

Typescript was developed by Microsoft as a successor to JavaScript. Similarly, Kotlin was created to shore up weaknesses in Java. Now, the question is can Carbon prove to be a successor to C++?

THE BELAMY

Sign up for your weekly dose of what's up in emerging technology.

Code comparison

(Source: Github)

Can Carbon be a worthy successor?

At the event, Carruth announced Carbon as an experimental successor to the C++ programming language. Even though most of the developers working on Carbon are from Google, it is not a Google-exclusive project. Carruth revealed they would soon start this experimental work with the C++ community.

Carbon is open source, and the developers want it to be ‘an independent and community-driven project’ for it to be successful. So the project will be maintained on GitHub, with discussions on Discord.

“Carbon is for organisations and projects heavily dependent on C++; for example, projects that have a lot of C++ code or use many third-party C++ libraries,” the creators said in a Github repository.

The origin of Carbon also lies in the fact that it is difficult to improve C++. One of the primary reasons for this is that C++ has decades of technical debt accumulated in language design. Further, it also inherited the legacy of C.

Carbon does not inherit the legacies of either C or C++. Instead, the developers have ensured Carbon has a much more efficient evolution process. Also, it’s built on open-source principles, processes, and tools.

However, for Carbon to be a worthy successor to C++, there is a long way to go. First of all, C++ has been around for a very long time. Carbon, on the other hand, is still in the experimental stage and years away from actual use. Even when it comes to life, Carbon must be able to address the problems that C++ failed to. 

One of the plus points of C++ is that it can directly manipulate the hardware it runs on. All programmers need to do is fine-tune their code even in limited hardware space availability. For Carbon to be a successor, it must also be able to do similar things, and maybe more. 

Also, the use cases of C++ are multifold. Popular operating systems such as Windows and macOS use C++. It is also one of the widely-used programming languages in the gaming industry, with games such as World of Warcraft, and Counter-Strike having been developed using C++.

Popular database tools like MySQL and MongoDB were built using C++. It also plays a role in web browsers like Google Chrome, Mozilla Firefox, and Safari. TensorFlow, an open-source software library for machine learning,  also relies on C++ as a back-end programming language. Further, C++ is also used to develop many financial tools and flight softwares.

Carbon in, Rust out!

Before Carruth introduced us to Carbon, another programming language called Rust was seen as the successor to C++. This was primarily because of its syntactic similarities to C++, as it provides increased speed and better memory safety. However, this is open to discussion since many developers found Rust too difficult to learn as it introduced a lot of novel concepts too.

Besides the steep learning curve, converting major projects’ current C++ codebases to Rust is challenging. Further, according to the developers of Carbon, the design of Rust itself acts as a significant barrier to adoption and migration from C++. On the other hand, Carbon aims to convert the C++ codebases in a much better way than Rust. 

For a C++ developer, it won’t be difficult to learn Carbon. In fact, Carbon is said to have a gentle learning curve. While many felt using Rust was similar to learning a new programming language.

“It is built out of a consistent set of language constructs that should feel familiar and be easy to read and understand,” Carbon’s Github page states.

While speaking at the event, Carruth also explained that Rust, which Mozilla developed, doesn’t have the same ‘bi-directional interoperability’ as other tools. But, the creators of Carbon encourage developers to keep using Rust if it’s technically and economically viable for the project. 

“We believe Rust is an excellent choice for writing software within the pure Rust ecosystem. Software written in Rust has properties that neither C++ nor Carbon has. Rust is also good for using APIs implemented in a different language in-process, when the cost of maintaining the FFI boundary is reasonable.”

How is the industry reacting?

“Carbon matches 100% of the performance of C++ and aims to provide a significantly better developer experience,” Kaggle master and senior data scientist Mark Tenenholtz tweeted.

This is mainly because Carbon reduces existing libraries’ tech debt and makes extending those libraries easier.

However, not everyone is convinced that Carbon would be a worthy successor to C++. While Carbon is new, C++ has been around for decades and has large community support.

“I don’t know if Carbon will be ditched in a year or if it’s going to revolutionise the way C codebases are maintained,” Tenenholtz added.

A few community members questioned the need to change trivialities like syntax and make people learn stuff all over again. 

However, another section of developers are excited about Carbon and what it could bring to the developer’s community.

https://twitter.com/darkosubotica/status/1552048520265232384

More Great AIM Stories

Pritam Bordoloi
I have a keen interest in creative writing and artificial intelligence. As a journalist, I deep dive into the world of technology and analyse how it’s restructuring business models and reshaping society.

Our Upcoming Events

Conference, Virtual
Genpact Analytics Career Day
3rd Sep

Conference, in-person (Bangalore)
Cypher 2022
21-23rd Sep

Conference, in-person (Bangalore)
Machine Learning Developers Summit (MLDS) 2023
19-20th Jan

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
21st Apr, 2023

3 Ways to Join our Community

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Telegram Channel

Discover special offers, top stories, upcoming events, and more.

Subscribe to our newsletter

Get the latest updates from AIM
MOST POPULAR

The curious case of Google Cloud revenue

Porat had earlier said that Google Cloud was putting in money to make more money, but even with the bucket-loads of money that it was making, profitability was still elusive.

Global Parliaments can do much more with Artificial Intelligence

The world is using AI to enhance the performance of its policymakers. India, too, has launched its own machine learning system NeVA, which at the moment is not fully implemented across the nation. How can we learn and adopt from the advancement in the Parliaments around the world? 

Why IISc wins?

IISc was selected as the world’s top research university, trumping some of the top Ivy League colleges in the QS World University Rankings 2022

[class^="wpforms-"]
[class^="wpforms-"]