Stability • Balance between correctness and usability • Vastly improved flexibility and expressiveness • Exposing optimization “magic” • Enhancements to the standard library
• Result type • @dynamicCallable • Simplification of protocols such as Sequence and Collection • Cool optimization attributes (@inlinable, @usableFromInline etc.) • Enhancements to math types/protocols (+ SIMD vectors) • … and a bunch of other stuff
• It is a specification. • Things this specification describes: - Calling conventions - Type metadata - Name mangling - Runtime APIs - Standard library APIs
iOS 12.2 will ship with Swift 5 • About 7-10MB size reduction • Widespread usage of Swift throughout the OS in the near future • Swift-ier APIs for cocoa/touch frameworks (hopefully)
of the function • Exported functions are stored as SIL in the module file • SIL stands for Swift Intermediate Language • “A Swift module file is a binary serialization of the AST- level declarations from one or more source files, together with the SIL instructions from the bodies of any inlinable functions.” - Slava Pestov
• Standard library provides a default implementation • Default implementation is… DefaultStringInterpolation • You can create custom interpolation structures • Custom interpolation structures can capture richer information
String...) { appendInterpolation("(?:\(strings.joined(separator: "|")))") } } var regex = "I like \(oneOf: "cats", "dogs", "parrots")" var string = "I like dogs" string.range(of: regex, options: .regularExpression) != nil // true var regex = "I like (?:cats|dogs|parrots)" var string = "I like dogs" string.range(of: regex, options: .regularExpression) != nil // true to…
concurrency support • Swift memory ownership manifesto - highly optimized memory management • Swift generics manifesto - vastly richer, more expressive type system
Derived Collection of Enum Cases • SE-0212 Compiler Version Directive • SE-0229 SIMD Vectors • SE-0233 Make Numeric Refine a new AdditiveArithmetic Protocol