Re:The Rust Calling Convention We Deserve
by __s on Friday April 19, 2024 @09:06AM
(#40086328)
Dynamic calling conventions also won't work with dynamic linking
[ Parent
| on HN ]
Re:The Rust Calling Convention We Deserve
by kevincox on Saturday April 20, 2024 @04:42PM
(#40100853)
Even when dynamic linking a lot of calls will be internal to each library. So you can either:
1. Use a stable calling convention for external interfaces.
2. Use a stable calling convention for everything, but generate trampolines for external calls.
Swift is actually pretty cool here. It basically does 2. But you can also specify which dependencies are "pinned" so that even if they are dynamically linked they can't be updated without a recompile. Then you can use the unstable calling convention when calling those dependencies.