Swift Runtime

Swift has great support for interfacing with C and Objective-C. The Swift compiler ingests any C headers you provide and will generate the right machine code to call those C functions, no need for you to write any manual bindings like in other languages. It is not foolproof- it can only decipher constants from the C preprocessor, for example- but works very well.

Right now, there is even work under way to go the other way more easily, ie write your code in Swift and call it from C. :smiling_face_with_sunglasses:

Oh, there is definitely a Swift runtime, you can find its source here. It is written in a mix of Swift and C++. I was merely pointing out that it builds on top of your OS C library on most platforms, except maybe less for the embedded targets.

Not that I know of, but difficult to keep track of all the Swift articles and blogs out there. :wink: Use your favorite search engine and see what you find.

1 Like