TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

13 pointsby jjgreen3 months ago

4 comments

badfishblues3 months ago
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 months ago
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 months ago
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 months ago
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?