Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 29, 2026·3 min de lecture

Carbon Language — Experimental Successor to C++ by Google

An experimental programming language designed as a successor to C++ with modern generics, memory safety goals, and seamless C++ interop.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Carbon Language Overview
Commande d'installation directe
npx -y tokrepo@latest install 7925fecb-5b9b-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Carbon is an experimental programming language initiated at Google as an evolution path for C++ codebases. It aims to provide modern language features — generics, pattern matching, and improved memory safety — while maintaining bidirectional interoperability with existing C++ code. Carbon is still in early development and not yet ready for production use.

What Carbon Does

  • Provides a modern syntax with type inference, pattern matching, and named parameters
  • Offers bidirectional C++ interoperability for incremental migration
  • Implements checked generics with type constraints instead of templates
  • Targets memory safety improvements through a planned safe subset
  • Compiles via an LLVM-based toolchain for native performance

Architecture Overview

Carbon's toolchain is built on LLVM and uses Clang for C++ interop. The compiler pipeline processes Carbon source through lexing, parsing, and semantic analysis, lowering to LLVM IR for code generation. The design separates a safe Carbon subset from an unsafe interop layer, allowing gradual migration from C++ while maintaining compatibility at the ABI level.

Self-Hosting & Configuration

  • Clone the repository and build with Bazel (requires Clang 18+ and LLVM)
  • Use the Carbon Explorer for quick experimentation with the language
  • Follow the language design documents in the repository for specification details
  • Contribute via the RFC process for language evolution proposals
  • Track milestone progress on the GitHub project board

Key Features

  • Bidirectional interop with C++ at the function and type level
  • Checked generics replacing C++ templates with better error messages
  • Sum types and pattern matching for expressive control flow
  • Modern syntax free of C++ legacy baggage like header files
  • Designed for incremental adoption alongside existing C++ codebases

Comparison with Similar Tools

  • C++ — Carbon's direct predecessor; Carbon aims to fix ergonomics while maintaining interop
  • Rust — stronger safety guarantees today but no direct C++ interop; Carbon prioritizes migration path
  • Zig — targets C interop rather than C++; Carbon focuses specifically on the C++ ecosystem
  • cppfront (Cpp2) — Herb Sutter's C++ syntax evolution; Carbon is a separate language with its own semantics

FAQ

Q: Is Carbon ready for production use? A: No. Carbon is explicitly experimental. The team targets a working 1.0 specification but has not set a release date.

Q: Can I mix Carbon and C++ in the same project? A: That is the core design goal. Carbon is designed for bidirectional interop so you can call C++ from Carbon and vice versa.

Q: Does Carbon replace Rust? A: Carbon and Rust serve different niches. Rust is for new projects prioritizing safety. Carbon is for teams with large C++ codebases that need an incremental migration path.

Q: Who is developing Carbon? A: Carbon was initiated by Google engineers but is developed as an open community project with contributions from multiple organizations.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires