4

Fuchsia 的 Rust 代码占比超 50%

 2 years ago
source link: https://www.techug.com/post/fuchsia-s-rust-code-accounts-for-more-than-50-2.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Fuchsia 的 Rust 代码占比超 50%

出品 | OSC开源社区(ID:oschina2013)

谷歌近日正式面向公众推出了 Fuchsia OS,获得 Fuchsia 1.0 推送的设备是第一代 Nest Hub。

img1622422834962693984.png

与基于 Linux 内核的 Chrome OS 和 Android 等操作系统不同,Fuchsia 使用了全新的、自研的 Zircon 微内核,其采用 C++ 编写。内核的组件则使用到了 Go、Rust、Python,以及 C/C++ 等编程语言进行编写,如 USB 驱动程序使用 C++ 编写,而网络堆栈则使用了 Rust。

在关于 Fuchsia 的讨论帖中,有开发者表示 Fuchsia 大量使用了 Rust 编写代码,根据对 Fuchsia 整体的代码分析,Rust 的代码行数最多。

主要编程语言所占的比例分别如下(包含 JSON 配置代码):

  • Rust 22%,
  • C++ 18%,
  • Go 2%,
  • Python 1%,
  • Dart 1%

如果把 JSON 配置去掉再统计,Fuchsia 的 Rust 代码的占比实际已超过 50%。

根据此前报道过的“Fuchsia 编程语言策略”,终端开发者不支持使用 Rust,这里的终端开发者是指在 Fuchsia Platform Source Tree 之外为 Fuchsia 编写软件的人。而 Rust 除了在 Zircon 内核中使用,还被批准在整个 Fuchsia Platform Source Tree 中使用。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK