Slide 1

Slide 1 text

140 proposals in 30 minutes Jesse Squires jessesquires.com • @jesse_squires • @swiftlybrief

Slide 2

Slide 2 text

swift evolution “The Swift evolution process aims to leverage the collective ideas, insights, and experience of the Swift community to improve the Swift development experience.” 1.Engage community 2.Maintain vision and conceptual coherence 3.Core team responsible for strategic direction

Slide 3

Slide 3 text

In other words... Turn our* ideas Into Improvements * Anyone can participate!

Slide 4

Slide 4 text

Make Swift Great Again

Slide 5

Slide 5 text

Swift 1.0 to 3.0 ~2 years of Swift

Slide 6

Slide 6 text

How did we get here? Swift 3.0 has arrived! ! But how did that happen? ! Let's analyze swift-evolution proposals! !

Slide 7

Slide 7 text

// swift-proposal-analyzer.playground final class Proposal { let title: String let seNumber: String // SE-0001, SE-0002, etc. let authors: [Author] let status: Status // .inReview, .accepted, etc. let fileName: String let fileContents: String let wordCount: Int }

Slide 8

Slide 8 text

Proposal metadata What can we learn?

Slide 9

Slide 9 text

"It's just metadata" LOL

Slide 10

Slide 10 text

Proposals 140

Slide 11

Slide 11 text

98 implemented 10 accepted1 10 deferred 19 rejected 3 withdrawn 1 But not yet implemented

Slide 12

Slide 12 text

Acceptance: 77% Implementation: 70%

Slide 13

Slide 13 text

Word Counts 1191 avg 7300 max 769 median 167 min

Slide 14

Slide 14 text

Word / Topic frequency 873 API 384 objective-c 135 bridging 6 swifty Searching the entire proposal corpus

Slide 15

Slide 15 text

Authors 78

Slide 16

Slide 16 text

100 one author 30 two authors 9 three authors 1 nine authors 1.79 avg per proposal

Slide 17

Slide 17 text

Top Authors / Co-authors 25 Erica Sadun 13 Doug Gregor 12 Joe Groff 10 Dave Abrahams 10 Chris Lattner

Slide 18

Slide 18 text

How did each release evolve?

Slide 19

Slide 19 text

Swift 1.0 to 2.1 no proposals #yatusabes (not open source yet)

Slide 20

Slide 20 text

Swift 2.2 8 Proposals implemented

Slide 21

Slide 21 text

Swift 3.0 89 Proposals implemented

Slide 22

Slide 22 text

11x more !

Slide 23

Slide 23 text

1012% increase

Slide 24

Slide 24 text

Swift 3.0 1012% more swifty™ Proposals define and refine what "swifty" means.

Slide 25

Slide 25 text

Original Goals » Stable ABI (Application Binary Interface) » Resilience (Fragile binary interface problem) » Portability (Linux) » Type system cleanup and docs » Complete generics » Focus and refine language » API design guidelines

Slide 26

Slide 26 text

What actually happened? !

Slide 27

Slide 27 text

Swift 3: Nothing compiles lol

Slide 28

Slide 28 text

Talking about new iPhone... or Swift 3? ¯\_(ϑ)_/¯

Slide 29

Slide 29 text

Overwhelming community participation and feedback! Proposals everywhere

Slide 30

Slide 30 text

5 Types of proposals » Syntax refinements » API improvements, redesigns » Bridging with Objective-C » Features (new or refined) » "Bug fixes"

Slide 31

Slide 31 text

New Goals » API design guidelines » Automatic application of naming guidelines to imported Objective-C APIs » Adoption of naming guidelines in key APIs » "Swiftification" of imported Objective-C APIs » Focus and refine language » Improvements to tooling quality » Source Stability

Slide 32

Slide 32 text

very important proposals VIP's

Slide 33

Slide 33 text

SE-0005 Better Translation of Objective-C APIs Into Swift Make Cocoa/Objective-C APIs Great Again!™ // Example: let text = "Hello, FrenchKit! !" // Before let content = text.stringByTrimmingCharactersInSet( NSCharacterSet.whitespaceAndNewlineCharacterSet()) // After let content = text.trimming(.whitespaceAndNewlines)

Slide 34

Slide 34 text

SE-0023 API Design Guidelines ("The Great API transformation") Make Swift APIs Great Again!™ // Example: var array = [34, 79, 12, 3, 2, 56] // sort in-place (present tense) array.sort() // return new, sorted array (past tense) let sorted = array.sorted()

Slide 35

Slide 35 text

SE-0025 Scoped Access Level Make Access Control Specifiers Great Again!™ // Before public > internal > private // (to file) // After public > internal > fileprivate > private // (to scope)

Slide 36

Slide 36 text

SE-0117 Allow distinguishing between public access and public overridability Make Subclassing Great Again!™ // Before public class ViewController: UIViewController { } // After open class ViewController: UIViewController { }

Slide 37

Slide 37 text

Access control in Swift 3 open public internal fileprivate private

Slide 38

Slide 38 text

SE-0069 Mutability and Foundation Value Types Make Foundation Great Again!™ // Before let myDate = Date() let myLaterDate = myDate.dateByAddingTimeInterval(60) // After var myDate = Date() myDate.addTimeInterval(60) // OK let myOtherDate = Date() myOtherDate.addTimeInterval(60) // Error (let constant)

Slide 39

Slide 39 text

SE-0065 A New Model for Collections and Indices Make Collections and Indices Great Again!™ // Example: let collection = /* some collection */ var index = collection.index(where: { /* condition */ }) // Before index.successor() // After collection.index(after: index)

Slide 40

Slide 40 text

SE-0116 Import Objective-C id as Swift Any type Make Polymorphic Obj-C Interfaces Great Again!™ // Objective-C lol - (BOOL)isEqual:(id)object; // Before func isEqual(_ object: AnyObject?) -> Bool // After func isEqual(_ object: Any?) -> Bool

Slide 41

Slide 41 text

The cost of Swift Evolution

Slide 42

Slide 42 text

Opportunity Cost what did we give up?

Slide 43

Slide 43 text

Was it worth it?

Slide 44

Slide 44 text

Yes! Swift 3.0 is much better (but still work to do! !) Source-stable (mostly? !) No more expensive, painful migrations (hopefully !) Better APIs, better Objective-C inter-op ! Community learned about Swift-evolution process !

Slide 45

Slide 45 text

Merci!

Slide 46

Slide 46 text

Resources Me: @jesse_squires jessesquires.com github.com/jessesquires/swift-proposal-analyzer Swift Weekly Brief: swiftweekly.github.io @swiftlybrief swift-evolution: github.com/apple/swift-evolution