For the long-term success of this project, it should allow for exposing functions in Rust that can be called in Swift via the Swift function ABI as well as calling functions declared in Swift directly from Rust without an intermediate C or Objective-C layer. LLVM currently supports the Swift calling convention, also known as swiftcc. In order to expose Swift functions and call them directly in an FFI-safe manner, the Rust compiler needs to be taught Swift's function call ABI.
rust-lang/rust#64582 implements the basic function ABI in rustc via LLVM. This would allow for:
extern "Swift" {
fn foo();
}
extern "Swift" fn bar() {
// ...
}
type F = extern "Swift" fn();
For the long-term success of this project, it should allow for exposing functions in Rust that can be called in Swift via the Swift function ABI as well as calling functions declared in Swift directly from Rust without an intermediate C or Objective-C layer. LLVM currently supports the Swift calling convention, also known as
swiftcc. In order to expose Swift functions and call them directly in an FFI-safe manner, the Rust compiler needs to be taught Swift's function call ABI.rust-lang/rust#64582 implements the basic function ABI in
rustcvia LLVM. This would allow for: