The experimental Rust PR to add a more expressive "interop" ABI on top of the C ABI is IMHO the most exciting new effort that happened in Rust in the last few years.

Thanks to @josh and others for starting this very important work 🥳​

https://github.com/rust-lang/rust/pull/105586

Also @Mara's reply seems to indicate that some serious thought is now also put into other related areas, especially for handling Rust dynamic libraries.

https://github.com/rust-lang/rust/pull/105586#issuecomment-1349332850

Very exciting stuff for making Rust a better choice in various areas where exactly these topics were slowing down or hindering adoption.

#Rust #RustLang

Experimental feature gate proposal `crabi` by joshtriplett · Pull Request #105586 · rust-lang/rust

Summary This experimental feature gate proposal proposes developing a new ABI, extern "crabi", and a new in-memory representation, repr(crabi), for interoperability across high-level prog...

GitHub
@slomo @josh @Mara I hope work happens on the side of other languages to enable this too.
@slomo @josh @Mara Has this potential to be a GObject/GIR replacement?

@ntonnaett It depends on what exactly you mean with that.

GObject/GIR gives you an ABI to describe OOP interfaces, while this is a bit lower-level. For some APIs that might be exactly what is needed though.

I think GIR could make use of this for being able to directly pass more complex types around, and if it gains some degree of lifetime/ownership semantics then this could also be used in GIR.

@slomo @josh @Mara finally, this is happening. I had a discussion in the matrix room afew days ago about the possibility to link rust crates dynamically and all the benefits of at least having that possibility, people told me that will never happen because not wanting to define an ABI is actually a good thing, since there are no constraints, and that everyone is happy with the way things are now. Well, here we are, glad there are other people who want to eventually be able to dynamically link rust crates to their program. My biggest questions about this are how are generics gonna be handled, what about trait bounds? are we gonna do the same thing as swift and basically kinda pass opaque pointers across the boundary, therefore guaranteeing abi stability at runtime? Probably the only way to tell for sure is to read the pr, which I'm gonna do rn.
@bgtlover @slomo @josh @Mara The RFC says that v1 will not handle generics (except for Option<T> and Result<T, E>, or other trivial cases), no trait objects.
@slomo @josh @Mara This sounds really interesting!