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'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.
Relevant/related topic & 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://faultlore.com/blah/c-isnt-a-language/" rel="nofollow">https://faultlore.com/blah/c-isnt-a-language/</a><p><a href="https://news.ycombinator.com/item?id=33509223" rel="nofollow">https://news.ycombinator.com/item?id=33509223</a>
This is huge news!! I'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't rely on the boat anchor of the legacy C ABI that all languages are tied to!<p>This is the most important "feature" of Rust for it's long term success.<p>Edit: It looks like this is still using C ABI as it's base, which increases the burden for other languages to implement it. What a let down...
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't solve anything about versioning. I honestly quite like the Swift approach. It isn'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'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't know the size of a type) but then they have tags that you can apply to trade compatibility/flexibility to get those features back.
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).
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.