-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Extern/native function reform #3678
Copy link
Copy link
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-codegenArea: Code generationArea: Code generationA-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-codegenArea: Code generationArea: Code generationA-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Per some meeting or other, we discussed a plan to reform how how C functions work. I have been laying some of the groundwork for this but I think there is no meta-bug discussing it and bringing together the various things that need to be done.
The plan is:
extern "abi" fn(S) -> Twhereabiis one of the Rust-supported ABIs, and defaults toC. (Addextern "abi" fntype to represent C pointers #3321)extern fntype (Remove bare function types, replace with inference #3320) andextern fn(crust fn) declarationsextern fntype; in trans, we generate a wrapper at that timeextern fntype, we will generate inline the C-abi style invocation, perhaps generating wrappers