logoalt Hacker News

Xirdus • today at 6:52 PM • 6 replies • view on HN

An actual stable native Rust ABI is a prerequisite for distributing libraries as anything other than source code.


Replies

ChadNauseam • today at 7:43 PM

What is the advantage of doing so? Is it for cases where your source code is confidential but you want to sell access to your library?

➕ show 1 reply
SkiFire13 • today at 7:15 PM

It's not a strict prerequisite, you can just require the library being distributed to use extern "C".

➕ show 2 replies
wahern • today at 7:10 PM

Another year or three of insane memory and disk prices and people will come around.

A stable Rust ABI would be nice for not just Rust, especially if they refine or extend (formally or de facto) the SysV ABI to optimize passing and returning of discriminants. That could then smooth the way for developing these features in C and C++, such as a primitive error-result type that saw some brief attention in both C and C++ WGs a couple of years ago. Doing it properly--absolute minimum cost, ABI stable, and cross-language--seemed to require too much orchestration across the ecosystem so enthusiasm and ambition seemed to peter out. The work required for a stable Rust ABI could provide the inertia to get that done.

afdbcreid • today at 7:34 PM

Rust will almost certainly never have a stable ABI by default, and libraries will continue to be compiled from source by default. It might one day have an opt-in stable ABI.

fallingbananna • today at 7:39 PM

If you can drop the "native" requirement, then Wasm is also a way.

redox99 • today at 7:09 PM

Why would you want libraries in any other format?

➕ show 1 reply