TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Mixing Rust and C in Linux likened to cancer by kernel maintainer

13 点作者 jjgreen3 个月前

4 条评论

badfishblues3 个月前
I think any one who has worked with a code base that has to interop between languages understands some of the pain here. There have been projects I've been a part of that interop between C, C++, C#, and Python, with mandatory support for Matlab. This is a nightmare for maintainability. It typically ruins the advantages of every language with lifetime management. No more RAII in C++, everything is IDisposable in C#, Python and Matlab support require very specific version management. It also leads to situations where it is exceedingly difficult to find references to given functions, as methods get wrapped into different languages. Error handling mechanisms frequently cannot cross language boundaries, leading to situations where you have to do conversions. Often it also leads to non-idiomatic language code, as each language has a different idiom. It leads to silo-ing, because certain developers are better with some of the languages than others. It can lead to contention because someone wants to implement something in the language they prefer. Bindings are also annoying to maintain.
评论 #42996418 未加载
somanyphotons3 个月前
Lots of discussion on LWN: <a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;1006805&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;1006805&#x2F;</a>
codingbot30003 个月前
While I do agree that more Rust probably makes any C or C++ code base more secure, I can feel Hellwig&#x27;s (the maintainer) pain. Even compared to C, Rust is often a PITA, and in fact tends to make things less readable in my experience. I think the readability part of Rust in the kernel is often underestimated.<p>Nevertheless, it is good to see that Linus is committed to try out Rust in the long run, which is very good for Linux I think.
mycall3 个月前
Imagine some AI converting all of the linux kernel source code into rust someday. Would kernel devs move over to rust and ditch the C tree?