您现在的位置是:首页 > 文章详情

FreeBSD 也要“锈化”?团队称考虑在基础系统采用 Rust

日期:2024-01-23点击:54

FreeBSD 开发者正在考虑允许在 FreeBSD 基础系统中使用 Rust 编程语言的好处和成本。

https://lists.freebsd.org/archives/freebsd-hackers/2024-January/002823.html

邮件写道,在 FreeBSD 基础系统使用 Rust 的主要缺点是构建时间加倍。这是因为需要编译基于 LLVM 的 Rustc 编译器和 Rust 的所有附加功能,这些操作使得基础系统的构建时间大约是当前的两倍。

如果 FreeBSD 基础系统采用了 Rust,开发者可以重新 Rust 重写许多组件——而不是使用 C++,例如 ZFS 守护进程 (zfsd)、重写 devd、WiFi 用户空间代码也可以受益于用 Rust 编写,等等。列举部分如下:

* ctl-exporter (I started this, but discovered that the CTL stats API is
  unstable, so it can't live in ports.  Instead, I had to do it in C).
  https://github.com/freebsd/freebsd-src/commit/1a7f22d9c211f504f6c48a86401469181a67ec34

* fusefs tests.  Absolutely impossible to do in C.  I considered Rust, but went
  with C++ so they could live in base.  They are too closely coupled to
  fusefs(5) to live out-of-tree.
  https://github.com/freebsd/freebsd-src/tree/main/tests/sys/fs/fusefs

* devd.  Currently C++, but imp suggested a rewrite.
  https://github.com/freebsd/freebsd-src/tree/main/sbin/devd

* zfsd.  Currently C++, but I've long pondered a rewrite.  Using Rust would
  make it more testable.
  https://github.com/freebsd/freebsd-src/tree/main/cddl/usr.sbin/zfsd

* nscd.  Currently C, but confusing and with no test coverage.  I've
  contemplated a rewrite myself, but I don't want to do it in C.
  https://github.com/freebsd/freebsd-src/tree/main/usr.sbin/nscd

* The userland portion of the 802.11ac and Lightning stacks.  scottl suggested
  that these were good candidates for Rust.

* freebsd-kpi-r14-0 .  https://crates.io/crates/freebsd-kpi-r14-0

原文链接:https://www.oschina.net/news/276426/freebsd-considers-rust-base
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章