News for hackers. Stuff that matters.
Re:How I Wrote a Modern C++ Library in Rust by IshKebab on Monday December 03, 2018 @11:36AM (#18590091)
Rust has things that at a binary level are the same as classes, so they could easily be part of a cross-language ABI.

And so what if std::vector isn't primative. It's an extremely common construct that should be part of a cross-language ABI. Hell, it's simpler than strings and they are part of the C ABI.

This is one of those things that everyone is going to nay-say until someone actually does it. The same happened with webassembly. I remember when it was deemed impossible and PNaCl would never work etc. etc.

Re:How I Wrote a Modern C++ Library in Rust by msbarnett on Monday December 03, 2018 @12:28PM (#18590665)
> 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.

Re:How I Wrote a Modern C++ Library in Rust by int_19h on Monday December 03, 2018 @06:05PM (#18594071)
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.
Re:How I Wrote a Modern C++ Library in Rust by msbarnett on Thursday December 06, 2018 @06:51PM (#18623730)
> 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.