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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Rust Support Is Being Built into the GNU GCC Compiler

63 点作者 jerryjerryjerry大约 2 年前

4 条评论

j-krieger大约 2 年前
I like Rust. I use it daily, at work and for personal projects.<p>I can definitely see many advantages in Rust that would add value to the Linux kernel. However, I feel like there are two definite things currently missing in the language that <i>need</i> to be implemented ASAP for the rust + linux kernel story to truly work.<p>Panics (Rust&#x27;s term for exiting a program when encountering an unhandled error) are a good idea in most environments - instead of reading or writing past a vector&#x27;s last element, the program immediately exits. This approach falls through when you&#x27;re in an incredibly high stakes environment that must absolutely avoid crashes. Sure, you can catch <i>some</i> panics [0], but you can not easily avoid them entirely. There is no surefire way to know if subroutines any level deep may panic. Linus himself mentioned this problem, so I think handling it should be a top priority.<p>What&#x27;s also definitely missing is an allocator strategy. Zig is a good example for this, you can choose the exact allocation method that fits your model.<p>[0]: <a href="https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;panic&#x2F;fn.catch_unwind.html#notes" rel="nofollow">https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;panic&#x2F;fn.catch_unwind.html#not...</a>
评论 #35239253 未加载
评论 #35230443 未加载
techdragon大约 2 年前
Great! Multiple implementations are an important part of a healthy long term sustainable language. Even when they are niche offshoots that don’t gain wide adoption, they represent enough of a demand in terms of people writing code in that language and a supply of engineering talent and time to make a solution that better fits the niche they need filled. Just look at Python, there’s Jython, IronPython, PyPy, nuikta, Cython, micropython, and so many others all with varying degrees of longevity and success. All of which started with an unfulfilled need and some development efforts to supply that need.<p>Rust by way of GCC is great news and will do wonders for helping Rust expand further into the C&#x2F;C++ dominated world of embedded programming where a lot of hardware lacks the support of LLVM and thus Rust proper.
19h大约 2 年前
I wonder though --- will GCC have to comply with a specific API of cargo? Wondering if this will end up being an awkward kind-of RUSTC=&quot;gcc rust&quot; cargo build thing, or if this will be some lower level API.
评论 #35230447 未加载
worldsavior大约 2 年前
Why are they dedicating work for this? Is there something wrong with rustc?