Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Maturation of Swift

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

The Maturation of Swift

In 2018, Swift has stretched its wings into a truly widespread language. Join me as we take a look at how mobile apps, servers, functions, and even data science can be written in one language.

David Okun

June 11, 2018

Transcript

120 slides
  1. @dokun24 @mccoyjus The History of Swift • June 2014 -

    Swift is released • June 2015 - Swift on Linux is announced
  2. @dokun24 @mccoyjus The History of Swift • June 2014 -

    Swift is released • June 2015 - Swift on Linux is announced • December 2015 - swift.org goes live
  3. @dokun24 @mccoyjus The History of Swift • June 2014 -

    Swift is released • June 2015 - Swift on Linux is announced • December 2015 - swift.org goes live • March 2016 - First Linux build available
  4. @dokun24 @mccoyjus The History of Swift • June 2014 -

    Swift is released • June 2015 - Swift on Linux is announced • December 2015 - swift.org goes live • March 2016 - First Linux build available • June 2016 - Kitura at WWDC
  5. @dokun24 @mccoyjus The History of Swift • June 2014 -

    Swift is released • June 2015 - Swift on Linux is announced • December 2015 - swift.org goes live • March 2016 - First Linux build available • June 2016 - Kitura at WWDC • October 2017 - Kitura 2.0
  6. @dokun24 @mccoyjus Objective-C’s Place In iOS • Smalltalk + C

    • “Easy” interoperability with C++ • Created in 1981
  7. @dokun24 @mccoyjus Objective-C’s Place In iOS • Smalltalk + C

    • “Easy” interoperability with C++ • Created in 1981 • Licensed by NeXT in 1988
  8. @dokun24 @mccoyjus Objective-C’s Place In iOS • Smalltalk + C

    • “Easy” interoperability with C++ • Created in 1981 • Licensed by NeXT in 1988 • GCC extended to support it
  9. @dokun24 @mccoyjus Objective-C’s Place In iOS • Then…Clang and support

    for LLVM • iOS developers’ first choice • Still focused on manual memory management via reference counting
  10. @dokun24 @mccoyjus 2014 • Craig Federighi announced Swift • A

    focus on functions as first class objects
  11. @dokun24 @mccoyjus 2014 • Craig Federighi announced Swift • A

    focus on functions as first class objects • Type-safety, automatic memory management
  12. @dokun24 @mccoyjus Swift 2 • Focus on basic language needs

    • try • throw • catch • Protocol extensions
  13. @dokun24 @mccoyjus Swift 2 • Focus on basic language needs

    • try • throw • catch • Protocol extensions • Open source announcement
  14. @dokun24 @mccoyjus Swift 3 • Focus on stability, ABI (application

    binary interface) • The great NS removal
  15. @dokun24 @mccoyjus Swift 3 • Focus on stability, ABI (application

    binary interface) • The great NS removal • NSUserDefaults -> UserDefaults
  16. @dokun24 @mccoyjus Kitura - The Swift RESTful API Framework •

    Written just like Express.js • Works on macOS and Linux
  17. @dokun24 @mccoyjus Kitura - The Swift RESTful API Framework •

    Written just like Express.js • Works on macOS and Linux • Front-end templating
  18. @dokun24 @mccoyjus Kitura - The Swift RESTful API Framework •

    Written just like Express.js • Works on macOS and Linux • Front-end templating • ORM capabilities
  19. @dokun24 @mccoyjus Kitura - The Swift RESTful API Framework •

    Written just like Express.js • Works on macOS and Linux • Front-end templating • ORM capabilities • Client SDK generation
  20. @dokun24 @mccoyjus import Kitura let router = Router() router.get("/") {

    request, response, next in response.send("Hello world") next() } Kitura.addHTTPServer(onPort: 8080, with: router) Kitura.run()
  21. @dokun24 @mccoyjus Cloud Functions / FaaS • AKA Serverless •

    Serverless is…just another server • Focus on your functions
  22. @dokun24 @mccoyjus The Key of FaaS • Don’t worry about

    your server • Worry about your code
  23. @dokun24 @mccoyjus struct Record: Codable { var name: String var

    office: String } enum RecordError: Error { case newRecordError } func main(input: Record, respondWith: (Record?, RecordError?) -> Void) { let newRecord = Record(name: “David”, office: “IBM”) respondWith(newRecord, nil) }
  24. @dokun24 @mccoyjus Python • The Data Science Language • Meant

    for heavy computation • Focused on usability, above all
  25. @dokun24 @mccoyjus The Jupyter Project • Notebook driven development •

    Easy to share experiments & documentation • Portable, web-based environment
  26. @dokun24 @mccoyjus Watson Studio • Data science and IBM Cloud

    • Democratizes the model training process
  27. @dokun24 @mccoyjus Watson Studio • Data science and IBM Cloud

    • Democratizes the model training process • Built on open source
  28. @dokun24 @mccoyjus Watson Studio • Data science and IBM Cloud

    • Democratizes the model training process • Built on open source • No native support for Swift…yet
  29. @dokun24 @mccoyjus MB 0 175 350 525 700 Node.js Ruby

    Python Swift Memory Benchmarking
  30. @dokun24 @mccoyjus MB 0 175 350 525 700 Node.js Ruby

    Python Swift 658.324 Memory Benchmarking
  31. @dokun24 @mccoyjus MB 0 175 350 525 700 Node.js Ruby

    Python Swift 511.724 658.324 Memory Benchmarking
  32. @dokun24 @mccoyjus MB 0 175 350 525 700 Node.js Ruby

    Python Swift 280.624 511.724 658.324 Memory Benchmarking
  33. @dokun24 @mccoyjus MB 0 175 350 525 700 Node.js Ruby

    Python Swift 192.436 280.624 511.724 658.324 Memory Benchmarking
  34. @dokun24 @mccoyjus Seconds 0 25 50 75 100 Node.js Ruby

    Python Swift 45.41 Speed Benchmarking
  35. @dokun24 @mccoyjus Seconds 0 25 50 75 100 Node.js Ruby

    Python Swift 50.97 45.41 Speed Benchmarking
  36. @dokun24 @mccoyjus Seconds 0 25 50 75 100 Node.js Ruby

    Python Swift 93.55 50.97 45.41 Speed Benchmarking
  37. @dokun24 @mccoyjus Seconds 0 25 50 75 100 Node.js Ruby

    Python Swift 5.05 93.55 50.97 45.41 Speed Benchmarking

More Decks by David Okun

Other Decks in Programming