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

Swift on Linux

Swift on Linux

Presented at CocoaConf Austin 2016 and Pragmaconf '16 in Verona, Italy

023a6a37e8177cb2f84a236bbce643cf?s=128

Ben Scheirman

October 13, 2016
Tweet

Transcript

  1. Swift on Linux

  2. Hi, I’m Ben @subdigital

  3. None
  4. None
  5. Written in Swift

  6. Running on $5/mo Linux VPS

  7. (my little secret)

  8. Swift 1.0 Sept 2014 Swift 2.0 Swift Open Sourced Swift

    3.0! Sept 2015 Dec 2015 Sept 2016
  9. … but what does that mean? + github.com/apple

  10. 1. Swift Language, Compiler, & Debugger (with full commit history!)

  11. None
  12. None
  13. None
  14. 2. Swift Core Libraries

  15. *not on Linux (yet) github.com/apple/swift-corelibs-foundation github.com/apple/swift-corelibs-xctest github.com/apple/swift-corelibs-libdispatch Foundation XCTest libDispatch*

  16. 3. Swift Package Manager github.com/apple/swift-package-manager

  17. • Defines how modules are built • Resolves Dependencies •

    Convention over Configuration
  18. // Package.swift import PackageDescription let package = Package( name: “Foo”,

    dependencies: [] )
  19. None
  20. 4. Swift Evolution github.com/apple/swift-evolution

  21. None
  22. let’s play

  23. vagrantup.com

  24. git.io/vwJ4g

  25. “Trusty Tahr” trusty(14.04) 64-bit

  26. None
  27. None
  28. $ sudo apt-get install -y \ git \ clang \

    libicu-dev
  29. $ Demo

  30. github.com/subdigital/ nsdateformatter

  31. What Else?

  32. ?

  33. Wrap your favorite C library!

  34. Create a modulemap: module CCurl [system] { header "/usr/include/curl/curl.h" link

    "curl" export * }
  35. Add a git tag…. $ git add . $ git

    commit -m “Initial commit” [master (root-commit) fa72d04] initial commit 1 file changed, 1 insertion(+) $ git tag 0.0.1
  36. Reference from your Package.swift .Package(url: “../CCurl”, majorVersion: 0)

  37. Doing active development? Don’t forget to update the tag…. every

    time…
  38. None
  39. Thanks! @subdigital nsscreencast.com