-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add swift backend? #32
Comments
Dumping some thoughts here in case you or someone else ever gets to this:
|
|
As of #39 we've made a pretty significant shift in the """semantics""" of KDLScript to make it more useful for testing non-C-ABIs and layouts. We now take a single type declaration and use it to test both C reprs and Rust reprs, as well as C conventions and Rust conventions. (this is useful for i.e. cranelift which should ideally be ABI-compatible with the llvm-based rustc backend). Basically at this point it's basically giving you the shape of types and interfaces, and the harness is free to take that shape and apply modifiers like "...with $LANG-style repr" or "...with $LANG calling convention". So yeah we could have a repr(Swift) and Convention::Swift which reflect what happens when you just Write Some Normal Swift Code and ask it to generate two (swift?)staticlibs that get linked into one (swift?)dylib. And if anyone ever has a wild project to add Swift interop to Rust or whatever then hey we're ready to deal with that! It's interesting to hear that the header importer is still the only decent way to ask Swift to give things C-style layout, but we could maybe handle that..? I was sure one day we'd need to deal with a staticlib needing multiple source files, but adding that is still gonna be a pain in the ass. |
FWIW this kind of thing is actually awesome/great, for abi-cafe to slam face first into without adjustment. The original problem statement of the tool was to demonstrate these kinds of mismatches for decision-makers! It's still an open question as to what level we should mark these kinds of issues as "known bad" on (as we ran into with the new f16/f128 support), but I think it's broadly desirable to be able to ask for them and have them blow up. |
I'm not sure how much work this is but it sure would be neat!
The text was updated successfully, but these errors were encountered: