4 ms·
> Rust has things that at a binary level are the same as classes, so they could easily be part of a cross-language ABI. They are not "at a binary level the sam
by msbarnett 8y ago
> Rust has things that at a binary level are the same as classes, so they could easily be part of a cross-language ABI.
They are not "at a binary level the same as classes" (whose classes? C++'s classes?), at least not the moment things like vtables get involved.
- int_19h 8y agoPresumably this would be classes in whatever sense the ABI would define them. Which could be defined in such a way that they can be mapped straightforwardly to Rust structs and traits.
- msbarnett 8y ago> Presumably this would be classes in whatever sense the ABI would define them. Which could be defined in such a way that they can be mapped straightforwardly to Rust structs and traits. Which would then not map straightforwardly to C++ classes, because the vtable pointer would be in the wrong spot. You can't have an ABI that makes two things that represent things in concretely different ways somehow resolve that inherent contradiction.