Improving the usability of C libraries in Swift

(swift.org)

63 points | by timsneath 3 hours ago

2 comments

  • skrrtww 18 minutes ago
    This is pretty great stuff, I knew about the raw interop features but had no idea what API Notes offered. Quite cool.

    I can't help but feel that Swift will ultimately be the "slow and steady wins the race" safe language of the future. Swift steadily working "first" on both tooling and cohabitability with existing ecosystems is a huge boon for adoption. It understands what an ABI is! If I were doing a greenfield cross platform application I think Swift would be the first thing I reach for now.

    The qualms I have with Swift are mostly some of the more recent complex language features that can make Swift code much harder to understand and read, as well as the brainpower required to use Swift concurrency. That and some performance concerns, though many of those seem like they may be solvable with optimizations in LLVM.

  • handstitched 33 minutes ago
    This was a great read. I've used the naive approach shown in the first example before and its always felt a bit clunky, but I wasnt aware of most of these language features. I'm definitely going to try this out next time I have to write C bindings