Rearranging across the interface
Rearranging across the interface
Posted Feb 26, 2025 22:46 UTC (Wed) by Wol (subscriber, #4433)In reply to: Rearranging across the interface by excors
Parent article: Rewriting essential Linux packages in Rust
> So you'd have to invent a new category of interface boundary, which is both an internal API and an ABI, with stability guarantees (including for the non-machine-checkable safety preconditions) and with tooling to help you fulfil those guarantees, which sounds really hard.
Like putting the equivalent of a C .h in the crate?
But I would have thought if the compiler can prove the preconditions as part of a monolithic compilation, surely it must be able to encode them in some sort of .h interface in a library crate?
Of course, if you get two libraries calling each other, then the compiler might have to inject glue code to rearrange the structures passed bwtween the two :-)
Cheers,
Wol
