CarbonCarbon-lang是一个实验性的通用编程语言,旨在成为“C++的后继语言”。该项目开放源代码,由Google启动,沿用了之前Google自创的编程语言的脚步(GoDart)。Google工程师钱德勒·卡鲁斯(英语:Chandler Carruth)在2022年7月多伦多的CppNorth会议上首次向公众介绍Carbon语言。[1][2][3]

Quick Facts 语言家族, 设计者 ...
Carbon
Thumb
Carbon语言在GitHub上的徽标
语言家族C
设计者Google
型态系统静态类型标称类型英语Nominal type system隐含类型
实作语言C++
许可证Apache-2.0
文件扩展名.carbon
网站github.com/carbon-language/carbon-lang
启发语言
C++Rust
Close

该语言旨在修复C++的几个明显缺点[4],但提供了类似的功能集。该语言的主要目标是可读性和“双向互操作性”,因此不会像Rust那样存在语言障碍(虽然基于C++,但与C++不兼容)。语言的更改将由 Carbon 负责人决定。[5][6][7][8]

Carbon语言的文档、设计、实现和相关工具托管在GitHub上,基于Apache-2.0许可证(带有LLVM异常)。[9]

示例

Hello, world!

package sample api;    
fn Main() -> i32 {
    Print("Hello, world!");
    return 0;
}

参考文献

外部链接

Wikiwand in your browser!

Seamless Wikipedia browsing. On steroids.

Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.

Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.