How Swift Achieved Dynamic Linking Where Rust Couldn't
> For those who don’t follow Swift’s development, ABI stability has been one of its most ambitious projects and possibly it’s defining feature, and it finally shipped in Swift 5. The result is something I find endlessly fascinating, because I think Swift has pushed the notion of ABI stability farther than any language without much compromise.
> Swift 5 switches the preferred encoding of strings from UTF-16 to UTF-8 while preserving efficient Objective-C-interoperability. Because the String type abstracts away these low-level concerns, no source-code changes from developers should be necessary*, but it’s worth highlighting some of the benefits this move gives us now and in the future.
Real time numbers recognition (MNIST) on an iPhone with CoreML from A to Z
> Learn how to build and train a deep learning network to recognize numbers (MNIST),how to convert it in the CoreML format to then deploy it on your iPhoneX and make it recognize numbers in realtime!
String Representations and String APIs
C, swift, rust, unicode, etc. link collection.
Locks, Thread Safety, and Swift: 2017 Edition
> Swift has no language facilities for thread synchronization, but the APIs make up for it. GCD remains one of Apple’s crown jewels, and the Swift API for it is great.
Swift 4 Weak References
> Swift’s new implementation of weak references brings with it the concept of side tables. A side table is a separate chunk of memory which stores extra information about an object. It’s optional, meaning that an object may have a side table, or it may not. Objects which need the functionality of a side table can incur the extra cost, and objects which don’t need it don’t pay for it.
> One of Swift’s great strengths is the smoothness with which it interoperates with C code. The Unmanaged API is a key component of that. Unfortunately, it requires the programmer to make memory management decisions as pointers move in and out of Swift, but that’s an inherent part of the job it does. Once you have the memory management figured out, it’s mostly straightforward to use.
> One of the interesting additions to Swift 4 is the Codable protocol and the machinery around it. This is a subject near and dear to my heart, and I want to discuss what it is and how it works today.
Undefined Behavior != Unsafe Programming
> Undefined behavior (UB) in C and C++ is a clear and present danger to developers, especially when they are writing code that will execute near a trust boundary. A less well-known kind of undefined behavior exists in the intermediate representation (IR) for most optimizing, ahead-of-time compilers.
Swift: Challenges and Opportunity for Language and Compiler Research
Intro to swift and its approach to a number of open issues.
Method Dispatch in Swift
> Knowing how method dispatch works is vital when writing performant code, and can illuminate some of the confusing behavior found in Swift.
There’s quite a lot too it. Long article.
Swift and the Legacy of Functional Programming
Functional techniques in the still not actually functional swift.