Measuring Swift compile times in Xcode 9

Xcode Swift compile times are still a source of frustration for developers. The Swift type-checker, although improving with every Swift release, is a bottleneck. In this short post, Jesse Squires shows us how we can use two frontend Swift compiler flags to measure Swift compile times. We can then identify functions and expressions which take a long time to type-check, and update our code with explicitly type annotations. By doing so, we reduce the amount of type inference needed, which should lead to a reduction in compile times.

Swift Local Refactoring

Great post on the official Swift blog by Xi Ge in which he looks at the new Swift refactoring engine available in Xcode 9. This new engine can perform both local and global transformations of our code, and the logic behind local refactoring actions is implemented entirely in the Swift compiler and SourceKit, and is open source. This is great as it means we can contribute refactoring actions. Xi examines the kinds of local refactoring actions available and shows us how we can get started adding our own.

A story about Swift source compatibility

The Swift source compatibility suite is a community owned project which serves to regression test changes to the Swift compiler. Projects added are periodically built against the latest development versions of Swift, helping us to better understand the impact of changes to the language. In this post, Jesse Squires tells the story of one of his own open source projects, and why adding it to the compatibility suite sooner rather than later would have prevented a regression in the Swift compiler.