News for hackers. Stuff that matters.
Re:Swift 6.3 Released by sirwhinesalot on Thursday March 26, 2026 @05:48AM (#47528443)
> 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.

Re:Swift 6.3 Released by hrmtst93837 on Thursday March 26, 2026 @06:23AM (#47528684)
C++ interop got attention because it helps Apple absorb low-level codebases that already moved past pure C. Exporting Swift to plain C mostly means more DIY FFI spaghetti.

Once enums, ownership rules, and nullability cross that boundary, the generated header stops looking like a neat bridge and starts looking like one more place for ABI bugs to hide. Closures make it weirder fast, because now your error handling and calling conventions can drift just enough to produce the kind of bug that wastes a whole afernoon.

Re:Swift 6.3 Released by saagarjha on Thursday March 26, 2026 @05:56AM (#47528479)
They had it earlier, as an underscored attribute.
Re:Swift 6.3 Released by asimovDev on Thursday March 26, 2026 @08:26AM (#47529620)
it's been there for a while as an experimental feature. I used it in a project
Re:Swift 6.3 Released by dagmx on Thursday March 26, 2026 @10:24AM (#47530854)
You already had ObjC export so it was arguably low priority given the crossover