Carbon 碳语言?
7月19日,在 CppNorth https://cppnorth.ca/ 会议上,Google工程师 Chandler Carruth 宣布了 Carbon 语言。
可以叫“碳语言”吗?哈哈
Github主页:https://github.com/carbon-language/carbon-lang
作者推特:https://twitter.com/chandlerc1024/status/1549411352657133568
周末抽时间看了下演讲,感觉不错。
完整的演讲 https://www.youtube.com/watch?v=omrY53kbVoA
目标和关键
https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/goals.md
这门语言的目标是成为C++语言的继任者。
最关键的特点是做到与C++语言的更加高效、简单的相互调用。
We expect this depends on having high-performance bidirectional interoperability with C++, excellent migration tooling, and an easy ramp-up for experienced C++ software developers.
如下图,carbon可以很容易的使用C++中的struct,C++中也很容易使用carbon的方法。
适用场景
-
如果要开发一个新的项目,那直接使用Rust。 -
但如果要维护C++项目,或者和C++项目有很深的交互,那适合Carbon。
Roadmap
-
2023年结束实验性质 -
2024-2025年发布1.0版本
https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/roadmap.md
内存安全
提问环节有人问,内存安全是怎么考虑的?大概意思是,
-
对Rust来说,内存安全是“起点” -
对Carbon来说,内存安全是“终点”。会尽量加入保障内存安全的机制。
包管理器
-
会有包管理器。(现代语言必备)
上手体验
可以参考 https://github.com/carbon-language/carbon-lang 下面的Getting Started。
或者直接web的explorer里体验:
https://compiler-explorer.com/
社区
语言设计文档
https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design
有网友统计,carbon github仓库中,markdown文件的行数就占了几乎一半。
交流群
虽然Carbon2024-2025年才能1.0,但 最美好的事就是陪伴一个语言成长 ,更好是参与其中。有需要交流可以加群,一起学习和陪伴Carbon这几年的成长。二维码过期后可以加我微信 everettjf 拉入群。