Presented at CocoaConf Austin 2016 and Pragmaconf '16 in Verona, Italy
Swift on Linux
View Slide
Hi, I’m Ben@subdigital
Written in Swift
Running on $5/moLinux VPS
(my little secret)
Swift 1.0Sept 2014Swift 2.0Swift Open Sourced Swift 3.0!Sept 2015Dec 2015 Sept 2016
… but what does that mean?+github.com/apple
1. Swift Language,Compiler, & Debugger(with full commit history!)
2. Swift Core Libraries
*not on Linux (yet)github.com/apple/swift-corelibs-foundationgithub.com/apple/swift-corelibs-xctestgithub.com/apple/swift-corelibs-libdispatchFoundationXCTestlibDispatch*
3. Swift Package Managergithub.com/apple/swift-package-manager
• Defines how modules are built• Resolves Dependencies• Convention over Configuration
// Package.swiftimport PackageDescriptionlet package = Package(name: “Foo”,dependencies: [])
4. Swift Evolutiongithub.com/apple/swift-evolution
let’s play
vagrantup.com
git.io/vwJ4g
“Trusty Tahr”trusty(14.04) 64-bit
$ sudo apt-get install -y \git \clang \libicu-dev
$ Demo
github.com/subdigital/nsdateformatter
What Else?
?
Wrap your favorite C library!
Create a modulemap:module CCurl [system] {header "/usr/include/curl/curl.h"link "curl"export *}
Add a git tag….$ git add .$ git commit -m “Initial commit”[master (root-commit) fa72d04] initial commit1 file changed, 1 insertion(+)$ git tag 0.0.1
Reference from your Package.swift.Package(url: “../CCurl”,majorVersion: 0)
Doing active development?Don’t forget to update the tag…. every time…
Thanks!@subdigitalnsscreencast.com