Bare-metal Raspberry Pi Pico entirely in Swift, no C code at all. Vector table, boot2, startup code, runtime stubs, all written in Swift using @\section, @\_extern, and @\c.
Bare-metal Raspberry Pi Pico entirely in Swift, no C code at all. Vector table, boot2, startup code, runtime stubs, all written in Swift using @\section, @\_extern, and @\c.
Your favorite C library, now with Swift superpowers. 🦸
New post: how to transform C APIs into idiomatic Swift, with enums, automatic reference counting, and argument-labeled methods. Best of all: no header changes needed, thanks to API notes! 🥳 https://www.swift.org/blog/improving-usability-of-c-libraries-in-swift/

There are many interesting, useful, and fun C libraries in the software ecosystem. While one could go and rewrite these libraries in Swift, usually there is no need, because Swift provides direct interoperability with C. With a little setup, you can directly use existing C libraries from your Swift code.
Got unreasonably excited about this new, incredibly straightforward count-distinct algorithm. The CVM algorithm is a direct replacement for HyperLogLog, it nerd-sniped Donald Knuth for weeks, *and* it can easily be taught in an entry-level CS course.
h/t @munin
https://www.quantamagazine.org/computer-scientists-invent-an-efficient-new-way-to-count-20240516/