> You can look to Swift for prior art on how this can be done: https://faultlore.com/blah/swift-abi/
> It would be very hard to accomplish.
Since Rust cares very much about zero-overhead abstractions and performance, I would guess if something like this were to be implemented, it would have to be via some optional (crate/module/function?) attributes, and the default would remain the existing monomorphization style of code generation.