Header Ads

Google launched a new programming language called Carbon a few days ago

Google launched a new programming language called Carbon a few days ago


It is the experimental successor of the C++ language.

The reason it is called an experimental successor is that it is still in the experimental stage. However, no compiler has yet been developed for this.

Why Carbon programming language is going to be known as the successor of C++:

Nowadays, along with technology, the programming languages ​​are constantly updated and their generations also change. C++ is powerful and runs on multiple platforms, hardware architectures, and many operating systems, but it has some issues.

The evolution process for adding new functionality to C++ is very difficult because the program is constantly challenged to improve the amount of computation time, memory, bandwidth, and other hardware-based resources that must be maintained to perform each specific task. It is therefore extremely difficult to improve C++ incrementally, as C++ struggles to improve and meet the needs of developers due to technical debt from the last few decades. And the best way to deal with these problems is to abandon direct inheritance to C or C++. As can be said-

  • JavaScript → TypeScript
  • Java → Kotlin
  • C → C++
  • C++ → Carbon

Already languages ​​like Go, Swift, Kotlin, and Dart are enhancing the developers' experiences day by day. Since these problems are really difficult to solve with C++, after in-depth research and evaluation across multiple languages ​​by Google engineers, the Carbon programming language has been introduced.

Google launched a new programming language called Carbon a few days ago



Since Carbon language is going to come as the successor of C++ language so as a successor language these things should be included in Carbon:


  •     Performance matching with C++ is an essential property for developers to say the least.
  •     Any C++ library can easily access Carbon.
  •     Compatible with C++ so that developers can learn it easily.
  •     Support the design and architecture of existing software based on C++.


The Carbon language is designed primarily to support things that C++ lacks:


  •     Performance Critical Software
  •     Evolution of software and languages
  •     Codes are easy to read, understand and write (we can consider Python as an example).
  •     Practical safety and testing mechanism
  •     First and scalable development
  •     Modern operating system platforms, hardware architectures, and environments.


As it is still in the experimental stage, Google engineers expect that by the end of 2022, the core Carbon language design should be substantially complete, including expressions and statements, classes, generics and templates, core built-in types, and interfaces such as integers and includes pointers, and interoperability.

The main features of the Carbon language will be:


  •     It is an open-source language.
  •     Fast performance matching using low-level virtual machines in C++.
  •     There are low-level accesses to bits and addresses.

    Bi-directional interoperability, meaning Carbon can call C++ language code and C++ can call Carbon language code.

    Migration support, meaning it will support moving code from C++.

    There will be modern features like fast and scalable builds that can work with existing C++ builds.


I have given some parts of the Carbon language code.

package ExplorerTest API;

//fn is function declaration

//return type is i32 i.e. int.

fn Main() -> i32 {

var s: auto = "Hello world!"; // AutoVariable

let x: i64 = 20; // Constant

var y: i32 = 3; // Integer variable

print(s); // Print

return 0; //Return value

}


Our Facebook Page: Click Here

No comments

Theme images by sebastian-julian. Powered by Blogger.