FreeBSD 開發(fā)者正在考慮允許在 FreeBSD 基礎(chǔ)系統(tǒng)中使用 Rust 編程語(yǔ)言的好處和成本。
郵件寫道,在 FreeBSD 基礎(chǔ)系統(tǒng)使用 Rust 的主要缺點(diǎn)是構(gòu)建時(shí)間加倍。這是因?yàn)樾枰幾g基于 LLVM 的 Rustc 編譯器和 Rust 的所有附加功能,這些操作使得基礎(chǔ)系統(tǒng)的構(gòu)建時(shí)間大約是當(dāng)前的兩倍。
如果 FreeBSD 基礎(chǔ)系統(tǒng)采用了 Rust,開發(fā)者可以重新 Rust 重寫許多組件 —— 而不是使用 C++,例如 ZFS 守護(hù)進(jìn)程 (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
審核編輯:劉清
-
freebsd
+關(guān)注
關(guān)注
0文章
37瀏覽量
10816 -
rust語(yǔ)言
+關(guān)注
關(guān)注
0文章
57瀏覽量
3028
原文標(biāo)題:FreeBSD也要 “銹化”?
文章出處:【微信號(hào):OSC開源社區(qū),微信公眾號(hào):OSC開源社區(qū)】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論