C++ officially does not have a documented ABI. The ISO C++ standard intentionally omits an Application Binary Interface (ABI), leaving binary-level rules entirely to compiler vendors and operating systems. A massive PITA, because so many wonderful papers are rejected or take years (even decades!) because of "will break ABI" - leaving their authors in tears as their work of years go up in smoke.
But, what ABI precisely ? There is nothing a consumer can truly depend on since it is never truly defined. All libraries which truly offer ABI compatibility as a contract just leverage the C ABI.
C++ committee should have permitted their "mythical C++ ABI that exists but not really" to break across odd standard releases (once every 6 years) so to fix severe and glaring deficiencies in the standard library. This was done so successfully in the past and compiler vendors had no issues doing so. But in the last decade, the C++ committee has sadly gotten ossified and even tyrannical.
MANY prominent developers and committee contributors have walked away from the C++ standardization process (WG21) or pivoted away from C++ altogether after their major proposals were rejected or stalled. Most of them have moved away from C++.
And Rust will now rule the roost while C++ slowly petrifies and dies.
The funny thing is that after ALL that hoopla, C++ stdlib is actually smaller than Rust std. Rust has TCP networking, UDP networking, IP address manipulation, Child process management, Environment variables, Concurrent channels, Unicode-aware strings, proper Futures, limited Date and calendar operations, Lazy iterator pipelines.
I would say that ICE arresting STEM university professors itself is stupid. There should be a long grace period before immigration status becomes a problem.
Its kind of amazing. Can write bespoke Clojure code for game mods, neovim text editor, dotnet/java services, etc thanks to embracing its host. Sure, without type-safety, there is an upper complexity limit to the code-base size you can comfortably grok. However its immutability, cohesive core and stable+mature libraries puts that grokkability bar far higher compared to other dynamic ecosystems.
I think immutability comes with an implicit requirement: Having a good number of immutable data structures in the standard library. Clojure seems to have that.
Maybe. I don't expect this feature to have wide appeal. It's not useless, there are cases where you want this and it's great that it stabilized, but I think they're not very common and so in most cases as with everything else you shouldn't do this until you've got a problem it can solve.
People have been able to do this in Rust for longer than Zig has existed. What this new development brings is a standardized interface to streamline interoperability, not any new language capability. The bumpalo crate has been the standard bearer here for nearly a decade now, currently counting 778 million downloads on crates.io.
Without standardized interfaces, custom allocators have limiteduse. bumpalo could only be used seamlessly with its own custom types (like bumpalo::collections::Vec or bumpalo::boxed::Box.
bumpalo::collections::Vec<'bump, T> is a completely distinct type from std::vec::Vec<T>. You cannot pass an arena-allocated Vec or String to third-party libraries that expect standard library types without copying or converting them to slices first
> You cannot pass an arena-allocated Vec or String to third-party libraries that expect standard library types without copying or converting them to slices first
Slices are already the standard for interoperability between Rust libraries, and always have been. There may very well be libraries out there whose APIs expect you to pass Vecs into them, but that would be highly atypical.
Dozens of example of very popular rust libraries. Usage is regular, not atypical. The slice variants generally require allocating and copying data or produces a borrowed object. Ownership transfer without copying is a problem.
allocator-aware APIs can enable zero-copy ownership transfer across library boundaries, even when the memory was allocated using a custom allocator. This is wowza power.
That's six, which is hardly dozens. All of the examples you gave aren't allocator aware. They will reject a Vec<T,Goose> unless Goose is actually the Global allocator. Even if Goose is equivalent by Rust's allocator rules that's not good enough, the type matching wants an exact match not just allocator equivalence.
And this makes some sense because Vec<T,Global> has properties they may care about since they're the new owners of this Vec, they don't want a Vec<T,Goose> which might have very different ideas about allocation.
As your parent says, most APIs care about slices and thus do not communicate an allocator, so they're agnostic to allocation.
Rust's async is 1000x more complicated than mere custom allocators, so the complexity argument is invalid. You are complaining about a mote of sand when there is a gigantic mammoth stomping on your head.
It is indeed a mote of sand that will actually simplify Rust libs. Arena or bump allocators can tie memory lifetimes to a scope/region, transforming complex ownership and object-lifetime problems into simpler region-lifetime problems.
Can Rust’s borrow checker actually take notice of those transformations. I was not aware that using a bump allocator via the allocator API would allow for the static checks to reason about all intra-region allocations as a single entity.
If you know where there is any information on the borrow checker’s ability to check ‘under’ an allocator Id love to read about their strategy.
Compared to what ? Code has a lot of longevity compared to modern appliances. Still have to make a fix or enhancement on ~25-year old Java codebases some-days. AI has made this easier but it still has a tendency to make stupid mistakes.
But, what ABI precisely ? There is nothing a consumer can truly depend on since it is never truly defined. All libraries which truly offer ABI compatibility as a contract just leverage the C ABI.
C++ committee should have permitted their "mythical C++ ABI that exists but not really" to break across odd standard releases (once every 6 years) so to fix severe and glaring deficiencies in the standard library. This was done so successfully in the past and compiler vendors had no issues doing so. But in the last decade, the C++ committee has sadly gotten ossified and even tyrannical.
MANY prominent developers and committee contributors have walked away from the C++ standardization process (WG21) or pivoted away from C++ altogether after their major proposals were rejected or stalled. Most of them have moved away from C++.
And Rust will now rule the roost while C++ slowly petrifies and dies.
"Rubigina in pace, C++"
reply