Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 3.28 KB

Dev-tanay.md

File metadata and controls

59 lines (40 loc) · 3.28 KB

Carbon (A new programming language by Google)

Everyone knows Google’s obsession with creating different frameworks and launching a few programming languages. Dart was one of the programming languages launched by Google which was object-oriented and a web-based programming language.

Dart programming language didn’t gain a huge response from the developers and hence it never got the position of mainstream programming language. Many programmers prefer C++ and JavaScript over Dart due to their strong background.

Now Google is all set to launch a new programming language called Carbon programming language. Carbon Language could serve as a successor language to C++, one that provides a simple starting point for developers to a newer language that addresses contemporary development concepts like memory safety and generics.

This would be similar to how Microsoft built Typescript to update JavaScript and Kotlin to strengthen weaknesses in Java. The language was recently unveiled at the CPP North conference in Toronto by Google developer Chandler Carruth.

Carbon Programming Language: An Experimental Successor To C++

Given the context, it seems reasonable to think of a new purpose-driven language that builds on the six goals for C++ and adds one more:

  • Performance-critical software
  • Software and language evolution
  • Code that is easy to read, understand, and write
  • Practical safety and testing mechanisms
  • Fast and scalable development
  • Modern OS platforms, hardware architectures, and environments
  • Interoperability with and migration from existing C++ code
  • What Are The Promises Of Carbon?
  • Starting from the difficulties experienced in the language and in the governance, Carbon adopts a different approach for both areas.

Language

Carbon wants to start from scratch including:

  • modern generics system,
  • modular code organization,
  • simple syntax.

Carbon wants to be “a successor language […], rather than an attempt to incrementally evolve C++”, carbon-lang.

For this reason, it gave up on transparent backward compatibility while remaining interoperable with and migratable from C++.

Governance

Carbon wants to be more inclusive by:

  • Building on open-source principles, processes, and tools. Contributing is easier and more transparent.
  • Having a clear governance structure that can make decisions rapidly when needed.
  • Expanding the ecosystem with tools that provide a rich developer experience (compiler, standard library, IDE tools), and tool-based upgrades.
  • Bridging a gap in the C++ ecosystem with a built-in package manager.

Carbon: The Language

As stated in the Goals, “Carbon is an experiment to explore a possible, distant future for the C++ programming language designed around a specific set of goals, priorities, and use cases”.

Syntax

Among the presented features, it is worth mentioning:

  • Introducer keywords:fn for function, var for variable declarations
  • Function input parameters are read-only values
  • Pointers provide indirect access and mutation
  • Expressions to name type
  • The namespace at the root is always local
  • Public members by default. The reasoning seems to be that since you will mostly read the public functions in your API, it makes sense to expose them.
  • Type checking generics