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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Experimental Rust Feature: Safer Interoperable ABI

210 点作者 mvelbaum超过 2 年前

10 条评论

the_mitsuhiko超过 2 年前
This is an incredible exciting development. One thing I would like to point out is that the existence and progress of this PR is showing that there has been a change in approach in Rust over the last year or so which wasn&#x27;t there previously. A lot of long standing issues were basically blocked on them just being too big to solve due to the surface area. Now the Rust project is more willing to slice problems down into smaller sets and giving those a try.<p>This ABI will be limited, but despite those limits it has a lot of utility.
raydiatian超过 2 年前
Relevant&#x2F;related topic &amp; HN discussion which can help contextualize the value add I think maybe<p>“C isnt a programming language, it’s a protocol”<p><a href="https:&#x2F;&#x2F;faultlore.com&#x2F;blah&#x2F;c-isnt-a-language&#x2F;" rel="nofollow">https:&#x2F;&#x2F;faultlore.com&#x2F;blah&#x2F;c-isnt-a-language&#x2F;</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33509223" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33509223</a>
评论 #34147583 未加载
mlindner超过 2 年前
This is huge news!! I&#x27;ve been waiting for something like this from the Rust team for years! I hope libraries can be built for other languages that would allow cleaner interfacing directly with Rust that doesn&#x27;t rely on the boat anchor of the legacy C ABI that all languages are tied to!<p>This is the most important &quot;feature&quot; of Rust for it&#x27;s long term success.<p>Edit: It looks like this is still using C ABI as it&#x27;s base, which increases the burden for other languages to implement it. What a let down...
评论 #34148649 未加载
评论 #34149822 未加载
评论 #34149802 未加载
kevincox超过 2 年前
This is interesting but seems very basic. It looks like it is just lowering types that were previously too complex into C ABI.<p>Notably it doesn&#x27;t solve anything about versioning. I honestly quite like the Swift approach. It isn&#x27;t zero overhead but it defaults to really good comparability. Basically it adds a vtable for everything including member offsets and object sizes.<p>But the really nice thing is that you can tell the compiler when you don&#x27;t need compatibility (code and types in the same library, or a library that you statically link) and the overhead just disappears.<p>Of course you lose a few language features (you can&#x27;t know the size of a type) but then they have tags that you can apply to trade compatibility&#x2F;flexibility to get those features back.
评论 #34148479 未加载
afranchuk超过 2 年前
This is great!<p>For those unaware, the abi_stable crate makes stable ABIs (even with complex features like trait objects) pretty easy and, importantly, verifiable. It is primarily useful for rust-to-rust abi stability (for instance when creating a plugin system).
amluto超过 2 年前
I think it would be amazing if there was also a way to export a machine readable description of the layout of an interoperable object. Then other languages could parse it instead of needing to parse Rust code and know all the ABI rules.
评论 #34150433 未加载
pabs3超过 2 年前
Would this allow Rust libraries to be dynamically linked like C libraries are often?
评论 #34147124 未加载
评论 #34147482 未加载
评论 #34146924 未加载
评论 #34147371 未加载
shmerl超过 2 年前
This looks very cool. Can it help Rust &#x2F; C++ interop?
评论 #34147390 未加载
brundolf超过 2 年前
Would this simplify things like wasm-bindgen too?
ianlevesque超过 2 年前
So, COM?
评论 #34146971 未加载