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.

Experimental Rust Feature: Safer Interoperable ABI

210 pointsby mvelbaumover 2 years ago

10 comments

the_mitsuhikoover 2 years ago
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.
raydiatianover 2 years ago
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 未加载
mlindnerover 2 years ago
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 未加载
kevincoxover 2 years ago
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 未加载
afranchukover 2 years ago
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).
amlutoover 2 years ago
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 未加载
pabs3over 2 years ago
Would this allow Rust libraries to be dynamically linked like C libraries are often?
评论 #34147124 未加载
评论 #34147482 未加载
评论 #34146924 未加载
评论 #34147371 未加载
shmerlover 2 years ago
This looks very cool. Can it help Rust &#x2F; C++ interop?
评论 #34147390 未加载
brundolfover 2 years ago
Would this simplify things like wasm-bindgen too?
ianlevesqueover 2 years ago
So, COM?
评论 #34146971 未加载