Carbon: Google’s programming language as a successor to C++


Written by admin



Carbon, the latest programming language created by Google, was unveiled today as an experimental successor to C++.

Over the years, Google has created several programming languages, some of which have become more popular and visible than others. For example, Golang (or simply Go) was created with the goal of improving server and distributed systems development, and has since been made available to the public. Meanwhile, the Dart programming language, originally conceived as a kind of alternative to JavaScript, did not enjoy wide popularity until the release of Flutter.

Today at the Cpp North convention in Toronto, as shared by Conor Hoekstra Google employee Chandler Carruth, who was present and documented the slides, shared his vision for a new programming language called Carbon. To set the stage, Carruth showed how many of today’s most popular programming languages ​​have successors that allow developers to work quickly as well as take advantage of modern language design.

Android developers are well aware that Kotlin is the successor to Java, just as iOS developers are well aware that Swift is the successor to Objective-C. Microsoft’s TypeScript has completely improved JavaScript while remaining usable and capable of “transpiling” back into JavaScript. C++, which is widely used at Google, is also a kind of successor to the original C programming language.

While some might speculate that Rust, originally a Mozilla project that has since gained significant popularity, is the successor to C++, Carruth wonders if the analogy holds. While Rust is undeniably a great language to start a new project, it doesn’t have the same “bi-directional interoperability” as Java and Kotlin, making it difficult to constantly migrate.

If Rust works for you today, you should use it. But porting the C++ ecosystem to Rust is hard.

To that end, while Carbon has many of the same goals as Rust, such as helping developers create “performance-critical software”, Carbon is also intended to be fully compatible with existing C++ code. Also, the goal is to make it as easy as possible to migrate from C++ to Carbon if desired.

As for why a C++ developer might want to consider implementing Carbon into their codebase, Carruth shared a few highlights of the language on stage.

  • Representative keywords and simple grammar
  • Function inputs are read-only values
  • Pointers provide indirect access and mutation
  • Use expressions to name types
  • The package is the root namespace.
  • API import via package name
  • An explicit object parameter declares a method
  • single inheritance; classes are final by default
  • Powerful, proven generic definitions
  • Types explicitly implement interfaces

In addition to the features of the language itself, the Carbon team looked at the development process that will shape the future of Carbon. The project code is publicly hosted on GitHub and open to pull requests, while the Carbon culture should be accessible and inclusive for both company employees and individuals.

However, one aspect of the Carbon programming language that isn’t particularly well described is Google’s involvement. Although today’s presentation was shared by a Google employee, and the current Carbon project leaders are mostly, but not entirely, Google employees, there is otherwise no mention of Carbon being a Google project.

This is actually intentional, as while Carbon originated at Google, the team understands and shared online that to be successful in the future, Carbon needs to be an “independent and community-driven project” and not solely Google’s own use. . In the same comment, Carruth further emphasizes that Carbon is currently only an experiment, although some companies have shown early interest in it.

If you want to get started with Carbon, you can download the source code and play with it on your device. Or you can experience the Carbon programming language right in your browser thanks to integration with the free Compiler Explorer web app.

An earlier version of this article incorrectly stated that all Carbon leads are Google employees. We apologize for the mistake.

FTC: We use automated affiliate links that generate income. More.

Check out 9to5Google on YouTube for more news:

#Carbon #Googles #programming #language #successor



About the author


Leave a Comment