Hacker News new | ask | show | jobs
by sirwhinesalot 92 days ago
> Swift 6.3 introduces the @c attribute, which lets you expose Swift functions and enums to C code in your project. Annotating a function or enum with @c prompts Swift to include a corresponding declaration in the generated C header that you can include in your C/C++ files

Why did this take so long to be added? Such strange priorities. Adding an entire C++ compiler for C++ interoperability before adding... C exports. Bizarre.

3 comments

They had it earlier, as an underscored attribute.
it's been there for a while as an experimental feature. I used it in a project
You already had ObjC export so it was arguably low priority given the crossover