Carbon Programming Language

Introduction to Google’s Carbon Programming Language (Carbon-Lang)

Carbon, or Carbon-Lang, is an experimental, general-purpose programming language. It was started by Google, following in the footsteps of previous Google-made programming languages (Go and Dart). By July 2022, Google engineer Chandler Carruth introduced Carbon at the CppNorth conference in Toronto.

Highlights of Carbon programming language

  • Introducer words and a simple grammar
  • Function input parameters are read-only values
  • Pointers provide indirect access and mutation
  • Use expressions to name types
  • The package is the root namespace
  • Import APIs through their package name
  • An explicit object parameter declares a method
  • Single inheritance – classes are final by default
  • Powerful, definition-checked generics
  • Types explicitly implement interfaces

Carbon Language is being designed for performance-critical software and language evolution. One of its core goals is to make it easy to read, understand, and write code. This enables fast and scalable development for Modern OS platforms, hardware architectures, and environments.

Comparison of a program in Carbon-Lang vs C++vs Go

Carbon programming language Example

package Sample api;

fn Main() -> i32 {
    var collegelib: auto = "Hello Collegelib";
    Print(collegelib);
    return 0;
}

C++ Example

#include <iostream>

int main() {
    auto collegelib = "Hello Collegelib";
    std::cout << collegelib;
}

Go Language example

package main

import "fmt"

func main() {
fmt.Printf("Hello Collegelib\n " )
}

Code reference: https://en.wikipedia.org/wiki/Carbon_(programming_language)

Other Google Projects and ideas collection

5 Top AI / ML / Data ScienceProject Ideas from Google Projects
Project Technology inventionsGoogle Tech projects

References:

Related articles – Programming languages