FreeBSD也要 “锈化”?

FreeBSD开发者讨论了在系统中引入Rust的可能性,指出这可能导致构建时间翻倍,但潜在好处包括替换C++组件如ZFSd和提高测试性。他们关注的关键组件如ZFSd、devd和802.11ac堆栈被提及作为可能的Rust重写目标。

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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值