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

swift-for-backend-SNAPSHOT-2016-03

 swift-for-backend-SNAPSHOT-2016-03

The open-sourcing of Swift brought lots of love for non-OSX programmers. Linux support is a huge step for making Swift a full stack language, equally suited for server and client side applications. While it's very much a work in progress, there's already been built a vibrant landscape of backend-oriented frameworks and libraries, coming both from the community and the enterprises. Let's see what tools are available, how they can be used and why Swift on server side might be a good idea, despite the early stage.

43d2bef703ec7165166f161f137ac54f?s=128

Krzysztof Siejkowski

March 31, 2016
Tweet

Transcript

  1. swift-for-backend SNAPSHOT-2016-03 .tar.gz by Krzysztof Siejkowski (siejkowski.net)

  2. swift ❤ linux

  3. None
  4. server! framework! but which one? https://github.com/ matteocrippa/awesome- swift#network

  5. Kitura github.com/IBM-Swift/Kitura Perfect perfect.org Vapor github.com/qutheory/vapor

  6. Zewo zewo.io Currasow github.com/kylef/Curassow Swifter github.com/httpswift/swifter

  7. Taylor github.com/izqui/Taylor Swifton github.com/necolt/Swifton Express swiftexpress.io Nest Project (Nest +

    Frank) github.com/nestproject
  8. blackfish github.com/elliottminns/blackfish Dynamo github.com/johnno1962/Dynamo Kunugi github.com/novi/Kunugi Trevi github.com/Trevi-Swift/Trevi

  9. Hello World! !

  10. Perfect perfect.org

  11. how to set up? 1.Download Perfect 2.Create Xcode workspace 3.Add

    Perfect as subprojects 4.Setup targets (see tutorial) 5.Run!
  12. Hello world in Perfect demo code at github.com/siejkowski/SwiftForBackend/tree/master/Hello

  13. enterprise-ish and feature-rich...

  14. .. but not very swifty

  15. recap » yes we can! » many libraries » easy

    to try
  16. Slack bot! !

  17. Zewo zewo.io

  18. Set up 1.Install swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a 2.Install "Swift Command Line Application" template

    3.Create Xcode project with SPM folders and targets 4.Install Zewo dependencies 5.Install zewodev 6.Checkout & generate Zewo using zewodev 7.Add Zewo to my Xcode project 8.RUN!
  19. None
  20. !1. Install swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a Swift? Which Swift? https://swift.org/download/

  21. swift-2.2-RELEASE swift-2.2-SNAPSHOT-2016-03-01-a swift-2.2.1-SNAPSHOT-2016-03-28-a swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a swift-DEVELOPMENT-SNAPSHOT-2016-03-16-a swift-DEVELOPMENT-SNAPSHOT-2016-02-25-a swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a

  22. swiftenv Swift Version Manager by Kyle Fuller $ swiftenv install

    swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a $ swiftenv global DEVELOPMENT-SNAPSHOT-2016-02-08-a
  23. !2. Install template !3. Create Xcode / SPM project Swift

    Package Manager (aka SPM) Package !"" Package.swift !""""""""""""""""""""""""""""""""""""""" Tests #"" Sources !"" LinuxMain.swift !"" Module1 !"" Module1 $ #"" FileFromModule1.swift $ #"" TestForModule1.swift #"" Module2 #"" Module2 #"" FileFromModule2.swift #"" TestForModule2.swift
  24. Package.swift import PackageDescription let package = Package(name: "Package", targets: [

    Target(name: "Package", dependencies: [ .Target(name: "Module1"), .Target(name: "Module2") ]), Target(name: "Module1"), Target(name: "Module2"), ], dependencies: [ .Package(url: "https://github.com/SwiftyLib/Lib.git", majorVersion: 0) ] )
  25. !2. Install "Swift Command Line Application" template !3. Create Xcode

    project with SPM folders and targets Xcode ! SPM
  26. !5. Install zewodev !6. Checkout & generate Zewo using zewodev

    !7. Add Zewo to my Xcode project Make Xcode ❤ SPM $ sudo gem install zewo-dev
  27. !4. Install Zewo dependencies SPM wants to ❤ C libraries

    and external dependencies $ brew install zewo/tap/zewo
  28. !8. RUN!

  29. Slack bot in Zewo demo code at github.com/siejkowski/SwiftForBackend/tree/master/Hackathon

  30. very modular

  31. much swifty

  32. How to deploy it? docker heroku

  33. recap » swiftenv » SPM & modularity » Xcode /

    SPM » SPM / C libs » Docker, Heroku
  34. App backend! !

  35. How many of you use Mac for Swift development?

  36. JetBrains CLion with Swift plugin

  37. Perfect: 6487 Vapor: 3455 ! Kitura: 2631 ! Swifton: 1806

    ! Swifter: 1579 !
  38. github.com/qutheory/vapor

  39. github.com/IBM-Swift/Kitura

  40. None
  41. what could possibly go wrong?

  42. ! package name conflict ! Swift version requirement

  43. ! Swift / SPM maturity ! Cross-project standards SwiftX

  44. Backend in Kitura & Vapor demo code at github.com/siejkowski/SwiftForBackend/tree/master/Prototype/Backend

  45. Full stack Swift !

  46. Things missing Opportunities ! » utilities of all kind »

    ports from other platforms » architecture models (like actor model) » monitoring tools » SwiftJS (ShiftJS) » performance » many more
  47. recap » development on Linux » mix and match !

    » full stack » opportunities!
  48. None
  49. Conwey's law “organizations which design systems (in the broad sense

    used here) are constrained to produce designs which are copies of the communication structures of these organizations” Melvin E. Conway, April, 1968
  50. backend for frontend diagram and further info at samnewman.io/patterns/ architectural/bff/

  51. SNAPSHOT-2016-03 obsolete tomorrow! contact the community!

  52. Thank you! Questions?