(no title)
pizlonator | 6 days ago
Dynamic linking with a safe ABI, where if you change and recompile one library then the outcome has to obey some definition of safety, and ABI stability is about as good as C or Objective-C or Swift.
Until that happens, it'll be hard to adopt Rust in a lot of C/C++ strongholds where C's ABI and dynamic linking are the thing that enables the software to get huge.
elteto|6 days ago
Wait, Rust can already communicate using the C ABI. In fact, it offers exactly the same capabilities as C++ in this regard (dynamic linking).
pizlonator|6 days ago
jjmarr|6 days ago
You cannot change anything that would affect the class layout of something in the STL. For templated functions where the implementation is in the header, ODR means you can't add optimizations later on.
Maybe this was OK in the 90s when companies deleted the source code and laid off the programmers once the software was done, but it's not a feature Rust should ever support or guarantee.
The "stable ABI" is C functions and nothing else for a very good reason.
pizlonator|6 days ago
In lots of domains, having a language that doesn't change very much, or that only changes very carefully with backcompat being taken super seriously, is more important than the memory safety guarantees Rust offers.
dpc_01234|6 days ago
nicoburns|5 days ago
1. Have the stable ABI be opt-in similarly to how the C ABI is opt-in in Rust (`#[repr(stable)]` or similar)
2. Have the stable ABI be versioned. So it would actually be `#[repr(stable_2026)]` or whatever
pjmlp|6 days ago
lelanthran|5 days ago
That's not important. What I want to see is the Rewrite-it-in-Rust movement move towards GPL.
GPL is pro-user. MIT is pro-business.
In their zeal to convert, they are happily replacing pro-user software with pro-business software. Their primary goal is to convert, not to safeguard.
If they shifted their goal from spreading Rust to protecting users, I'd be a lot happier about the community.
bayindirh|5 days ago
This is one of the two main reasons I'm not using Rust. Second reason is being addressed by gccrs team, so I have no big gripes there, since they are progressing well.
bigstrat2003|5 days ago
a456463|5 days ago
choeger|6 days ago
This means that any Rust ABI would have to cater for link-time specialization. I think this should be doable, but it would require a solution that's better than just to move the code generation into the linker. Instead, one would need to carefully consider the usage of the "shape" of all parameters of a function.
hyperman1|6 days ago
It should extend the C ABI with things like strings, arrays, objects with a way to destruct them, and provide some safety guarantees.
As an example, the windows world has COM, which is at the core pretty reasonable for its design constraints, even if gnarly sometimes.
ahartmetz|6 days ago
PaulDavisThe1st|6 days ago
eptcyka|6 days ago
pizlonator|6 days ago
It's also as bad as C.
I'm saying that the chasm to cross is a safe ABI.
ozgrakkurt|6 days ago
Also unsafe rust has always on strict-aliasing, which makes writing code difficult unless you do it in certain ways.
Having glue libraries like pyo3 makes it good in rust. But that introduces bloat and other issues. This has been the biggest issue I had with rust, it is too hard to write something so you use a dependency. And before you know it, you are bloating out of control
ahartmetz|6 days ago
pjmlp|6 days ago
They have been working around it with DLLs, and COM/WinRT, but still the tooling isn't ideal.
rhdunn|6 days ago
You can also access .NET/C# objects/interfaces via COM. It has an interface to allow you to get the type metadata but that isn't necessary. This makes it possible to e.g. get the C#/.NET exception stack trace from a C/C++ application.
cryptonector|6 days ago
Or maybe we can some how get used to living with static linking. (I don't think so, but many seem to think so in spite of my advice to the contrary!)
Another possibility is to use IPC as the dynamic linking boundary of sorts, but this will consume lots more memory, and as is stated elsewhere in this thread, memory ain't cheap no more.