SlideShare a Scribd company logo
1 of 39
Server Side Swift
Hüseyin APTİOĞLU | Software Infrastructure
Agenda
• Crash-Course Swift
• Swift Package Manager
• Server Side
• Benchmarking
Swift
• 1940s -> 9 programming languages
• 1950s -> 58 programming languages
• Fortran (concept)
• Fortran II
• Lisp
• …
• 1960s -> 113 programming languages
• Fortran IV
• Basic
• Cobol
• …
• 1970s -> 170 programming languages
• Pascal
• Smaltalk
• C
• ….
• 1980s -> 231 programming languages
• Turbo Pascal
• Erlang
• C ++
• Objective C
• ….
http://www.slideshare.net/GiordanoScalzo/the-joy-of-serverside-swift-development?qid=c2bc7c73-5bac-47e1-b834-45ac4b35edde&v=&b=&from_search=7
Swift
• 1990s -> 292 programming languages
• Python
• Java
• Ruby
• Visual Basic
• Delphi
• ….
• 2000s -> 339 programming languages
• C#
• Scala
• Go
• ….
• 2010s -> 354 programming languages
• Rust
• Kotlin
• Elm
• ….
http://www.slideshare.net/GiordanoScalzo/the-joy-of-serverside-swift-development?qid=c2bc7c73-5bac-47e1-b834-45ac4b35edde&v=&b=&from_search=7
Swift
• 355. Swift
• v1.0 in September 2014
• Opened in Dec 2015
• v2.2 first ver. in the Open
• v3.0.1
Swift Tour
Mutable
Variables
Immutable
Swift Tour
Mutable
Type Inference
Immutable
Swift Tour
Optionals
Swift Tour
Function parameter names
Swift Tour
Guard Statement
Swift Tour
Closures
Swift Tour
Tuples
Swift Tour
Extensions
Swift Tour
and more …
• Enumerations
• Inheritance
• Initialization
• Error Handling
• Type Casting
• Generics
• Access Control
• …
• …
Swift
Why is Swift a good choice for server-side ?
• Fast
• Modern
• Safe
• Interactive
• Open Source
• Apple
Server-side App Trade Off
Why is Swift a good choice for server-side ?AppPerformance
Developer Productivity
C
C++
Obj.C
Java
Perl
JavaScript
Python
Ruby
Lua
Groovy
ARC
Automatic Reference Counting (ARC)
Swift manages the memory for you, but unlike many other high level
languages, it doesn’t use a garbage collector to do this.
- No periodically running
- No pause
- The CPU cycles for your own program
Automatic Reference Counting (ARC)
LLVM
LLVM is actually an umbrella project that includes a variety of compilers and low
level tools
In short, LLVM compiles your code to a platform-neutral Intermediary Representation (IR), which can then be
optimised and converted to the desired architecture. This allows all platform optimisation efforts to be
concentrated in one place
For Swift, Apple added a new layer to this architecture: the Swift Intermediate Language (SIL).
SPM
Swift Package Manager
• Part of Swift 3
• Init project
• Generate Xcode Proj
• Resolve dependencies
The Swift Package Manager is a tool for managing the distribution of Swift
code. It’s integrated with the Swift build system to automate the process
of downloading, compiling, and linking dependencies.
Package.swift
Swift
• Swift is easier to read
• Swift is easier to maintain
• Swift is safe
• Swift is unified with memory management
• Swift requires less code
Swift vs Objective-C
Swift
Swift vs Java
Swift version 3.0-dev (LLVM 491f98861f, Clang 2ff6ce54d0, Swift fd4bd4c965)
swift-DEVELOPMENT-SNAPSHOT-2016-11-29-a-ubuntu16.04
Target: x86_64-unknown-linux-gnu
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
https://benchmarksgame.alioth.debian.org/u64q/swift.html
II. Most Loved
GitHub - apple/swift
Server Side Swift
open-source
Officially, only Linux is supported
open-source
Unofficially
Swift on Android
Install swift to linux
• Install required dependencies
$ sudo apt-get install clang libicu-dev
• Download the latest swift binary release from https://swift.org/download/#releases
• Extract the archive
$ tar xzf swift-<VERSION>-<PLATFORM>.tar.gz
• Add the Swift toolchain to your path
$ export PATH=/path/to/usr/bin:"${PATH}"
• Test with REPL (Read Eval Print Loop)
Swift Scripts
#!/usr/bin/env swift
let fruits = ["Banana", "Mango", "Apple", "Orange"]
let sortedFruits = fruits.sorted{$0 < $1}
print(sortedFruits)
chmod +x sort.swift
./sort.swift
Creating an Executable
Contents of file hello.swift
println("Hello world")
$ swiftc hello.swift
$ ./hello Hello world
Web Frameworks
• Perfect (9871)
• Vapor (7786)
• IBM Kitura (5002)
• Swifton (2042)
• Swifter (1852)
• Zewo (1502)
• …
• ...
• ...
Perfect 2.0
Vapor
Kitura
Benchmarking
wrk -d 10m -t 4 -c 20 http://10.0.1.11:(PORT)/blog
Benchmarking
wrk -d 10m -t 4 -c 20 http://10.0.1.11:(PORT)/json
Ready for Production?
Not Yet !!!
- Web frameworks < 1 year
- Server = Maturity
IBTECH

More Related Content

What's hot

Eclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesEclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesMark Stoodley
 
RISC-V software state of the union
RISC-V software state of the unionRISC-V software state of the union
RISC-V software state of the unionRISC-V International
 
Continuous Integration with Puppet
Continuous Integration with PuppetContinuous Integration with Puppet
Continuous Integration with PuppetMiguel Zuniga
 
Repository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryRepository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryStephen Chin
 
RISC-V 30910 kassem_ summit 2020 - so_c_gen
RISC-V 30910 kassem_ summit 2020 - so_c_genRISC-V 30910 kassem_ summit 2020 - so_c_gen
RISC-V 30910 kassem_ summit 2020 - so_c_genRISC-V International
 
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...Stefan Teixeira
 
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...GlobalLogic Ukraine
 
Iceberg
IcebergIceberg
IcebergESUG
 

What's hot (8)

Eclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimesEclipse OMR: a modern toolkit for building language runtimes
Eclipse OMR: a modern toolkit for building language runtimes
 
RISC-V software state of the union
RISC-V software state of the unionRISC-V software state of the union
RISC-V software state of the union
 
Continuous Integration with Puppet
Continuous Integration with PuppetContinuous Integration with Puppet
Continuous Integration with Puppet
 
Repository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryRepository Management with JFrog Artifactory
Repository Management with JFrog Artifactory
 
RISC-V 30910 kassem_ summit 2020 - so_c_gen
RISC-V 30910 kassem_ summit 2020 - so_c_genRISC-V 30910 kassem_ summit 2020 - so_c_gen
RISC-V 30910 kassem_ summit 2020 - so_c_gen
 
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-s...
 
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
 
Iceberg
IcebergIceberg
Iceberg
 

Viewers also liked

Enumはデキる子 ~ case .Success(let value): ~
 Enumはデキる子 ~ case .Success(let value): ~ Enumはデキる子 ~ case .Success(let value): ~
Enumはデキる子 ~ case .Success(let value): ~Takaaki Tanaka
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to MicroservicesCisco DevNet
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2Aaron Parecki
 
Server-side Swift
Server-side SwiftServer-side Swift
Server-side SwiftDaijiro Abe
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongDerek Perkins
 
IBM Presentation
IBM PresentationIBM Presentation
IBM Presentationrolsen3
 

Viewers also liked (8)

Server Side? Swift
Server Side? SwiftServer Side? Swift
Server Side? Swift
 
Enumはデキる子 ~ case .Success(let value): ~
 Enumはデキる子 ~ case .Success(let value): ~ Enumはデキる子 ~ case .Success(let value): ~
Enumはデキる子 ~ case .Success(let value): ~
 
Server-side Swift
Server-side SwiftServer-side Swift
Server-side Swift
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2
 
Server-side Swift
Server-side SwiftServer-side Swift
Server-side Swift
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong
 
IBM Presentation
IBM PresentationIBM Presentation
IBM Presentation
 

Similar to Server Side Swift

Honza Dvorský: Swift Package Manager
Honza Dvorský: Swift Package ManagerHonza Dvorský: Swift Package Manager
Honza Dvorský: Swift Package Managermdevtalk
 
Rapid application development with spring roo j-fall 2010 - baris dere
Rapid application development with spring roo   j-fall 2010 - baris dereRapid application development with spring roo   j-fall 2010 - baris dere
Rapid application development with spring roo j-fall 2010 - baris dereBaris Dere
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 WorkflowsRyan Street
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack SummitMiguel Zuniga
 
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar Sangeeth K Sivakumar
 
Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017Amy Cheong
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Railselliando dias
 
Introduction to Java(1) - CPPT+opy.Jpptx
Introduction to Java(1) - CPPT+opy.JpptxIntroduction to Java(1) - CPPT+opy.Jpptx
Introduction to Java(1) - CPPT+opy.Jpptxshesnasuneer
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
 
Swift Buildpack for Cloud Foundry
Swift Buildpack for Cloud FoundrySwift Buildpack for Cloud Foundry
Swift Buildpack for Cloud FoundryRobert Gogolok
 
Open Source Swift Under the Hood
Open Source Swift Under the HoodOpen Source Swift Under the Hood
Open Source Swift Under the HoodC4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01Scott Miao
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSAWS Vietnam Community
 
Show and Tell: Building Applications on Cisco Open SDN Controller
Show and Tell: Building Applications on Cisco Open SDN Controller Show and Tell: Building Applications on Cisco Open SDN Controller
Show and Tell: Building Applications on Cisco Open SDN Controller Cisco DevNet
 
[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge framework[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge frameworkOWASP
 
CocoaConf DC - Automate with Swift - Tony Ingraldi
CocoaConf DC -  Automate with Swift - Tony IngraldiCocoaConf DC -  Automate with Swift - Tony Ingraldi
CocoaConf DC - Automate with Swift - Tony IngraldiTony Ingraldi
 
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platformIntroducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platformJeffrey T. Fritz
 
Scalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex GryzlovScalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex GryzlovVasil Remeniuk
 
Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Vinay Kumar
 

Similar to Server Side Swift (20)

Honza Dvorský: Swift Package Manager
Honza Dvorský: Swift Package ManagerHonza Dvorský: Swift Package Manager
Honza Dvorský: Swift Package Manager
 
Rapid application development with spring roo j-fall 2010 - baris dere
Rapid application development with spring roo   j-fall 2010 - baris dereRapid application development with spring roo   j-fall 2010 - baris dere
Rapid application development with spring roo j-fall 2010 - baris dere
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
 
Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
 
Introduction to Java(1) - CPPT+opy.Jpptx
Introduction to Java(1) - CPPT+opy.JpptxIntroduction to Java(1) - CPPT+opy.Jpptx
Introduction to Java(1) - CPPT+opy.Jpptx
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Swift Buildpack for Cloud Foundry
Swift Buildpack for Cloud FoundrySwift Buildpack for Cloud Foundry
Swift Buildpack for Cloud Foundry
 
Open Source Swift Under the Hood
Open Source Swift Under the HoodOpen Source Swift Under the Hood
Open Source Swift Under the Hood
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
 
Show and Tell: Building Applications on Cisco Open SDN Controller
Show and Tell: Building Applications on Cisco Open SDN Controller Show and Tell: Building Applications on Cisco Open SDN Controller
Show and Tell: Building Applications on Cisco Open SDN Controller
 
[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge framework[OWASP Poland Day] Security knowledge framework
[OWASP Poland Day] Security knowledge framework
 
CocoaConf DC - Automate with Swift - Tony Ingraldi
CocoaConf DC -  Automate with Swift - Tony IngraldiCocoaConf DC -  Automate with Swift - Tony Ingraldi
CocoaConf DC - Automate with Swift - Tony Ingraldi
 
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platformIntroducing ASP.NET vNext - A tour of the new ASP.NET platform
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
 
Scalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex GryzlovScalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex Gryzlov
 
Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17
 

More from Software Infrastructure (20)

Kotlin
KotlinKotlin
Kotlin
 
NoSql
NoSqlNoSql
NoSql
 
Stream Analytics
Stream AnalyticsStream Analytics
Stream Analytics
 
Quartz Scheduler
Quartz SchedulerQuartz Scheduler
Quartz Scheduler
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Deep Learning
Deep Learning Deep Learning
Deep Learning
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Java9
Java9Java9
Java9
 
Machine learning
Machine learningMachine learning
Machine learning
 
Raspberry PI
Raspberry PIRaspberry PI
Raspberry PI
 
Golang
GolangGolang
Golang
 
Codename one
Codename oneCodename one
Codename one
 
Hazelcast sunum
Hazelcast sunumHazelcast sunum
Hazelcast sunum
 
Microsoft bot framework
Microsoft bot frameworkMicrosoft bot framework
Microsoft bot framework
 
Blockchain use cases
Blockchain use casesBlockchain use cases
Blockchain use cases
 
The Fintechs
The FintechsThe Fintechs
The Fintechs
 
Push Notification
Push NotificationPush Notification
Push Notification
 
.Net Core
.Net Core.Net Core
.Net Core
 
Java Batch
Java BatchJava Batch
Java Batch
 
Big Data & Hadoop
Big Data & HadoopBig Data & Hadoop
Big Data & Hadoop
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Recently uploaded (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Server Side Swift

  • 1. Server Side Swift Hüseyin APTİOĞLU | Software Infrastructure
  • 2. Agenda • Crash-Course Swift • Swift Package Manager • Server Side • Benchmarking
  • 3. Swift • 1940s -> 9 programming languages • 1950s -> 58 programming languages • Fortran (concept) • Fortran II • Lisp • … • 1960s -> 113 programming languages • Fortran IV • Basic • Cobol • … • 1970s -> 170 programming languages • Pascal • Smaltalk • C • …. • 1980s -> 231 programming languages • Turbo Pascal • Erlang • C ++ • Objective C • …. http://www.slideshare.net/GiordanoScalzo/the-joy-of-serverside-swift-development?qid=c2bc7c73-5bac-47e1-b834-45ac4b35edde&v=&b=&from_search=7
  • 4. Swift • 1990s -> 292 programming languages • Python • Java • Ruby • Visual Basic • Delphi • …. • 2000s -> 339 programming languages • C# • Scala • Go • …. • 2010s -> 354 programming languages • Rust • Kotlin • Elm • …. http://www.slideshare.net/GiordanoScalzo/the-joy-of-serverside-swift-development?qid=c2bc7c73-5bac-47e1-b834-45ac4b35edde&v=&b=&from_search=7
  • 5. Swift • 355. Swift • v1.0 in September 2014 • Opened in Dec 2015 • v2.2 first ver. in the Open • v3.0.1
  • 14. Swift Tour and more … • Enumerations • Inheritance • Initialization • Error Handling • Type Casting • Generics • Access Control • … • …
  • 15. Swift Why is Swift a good choice for server-side ? • Fast • Modern • Safe • Interactive • Open Source • Apple
  • 16. Server-side App Trade Off Why is Swift a good choice for server-side ?AppPerformance Developer Productivity C C++ Obj.C Java Perl JavaScript Python Ruby Lua Groovy
  • 17. ARC Automatic Reference Counting (ARC) Swift manages the memory for you, but unlike many other high level languages, it doesn’t use a garbage collector to do this. - No periodically running - No pause - The CPU cycles for your own program
  • 19. LLVM LLVM is actually an umbrella project that includes a variety of compilers and low level tools In short, LLVM compiles your code to a platform-neutral Intermediary Representation (IR), which can then be optimised and converted to the desired architecture. This allows all platform optimisation efforts to be concentrated in one place For Swift, Apple added a new layer to this architecture: the Swift Intermediate Language (SIL).
  • 20. SPM Swift Package Manager • Part of Swift 3 • Init project • Generate Xcode Proj • Resolve dependencies The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. Package.swift
  • 21. Swift • Swift is easier to read • Swift is easier to maintain • Swift is safe • Swift is unified with memory management • Swift requires less code Swift vs Objective-C
  • 22. Swift Swift vs Java Swift version 3.0-dev (LLVM 491f98861f, Clang 2ff6ce54d0, Swift fd4bd4c965) swift-DEVELOPMENT-SNAPSHOT-2016-11-29-a-ubuntu16.04 Target: x86_64-unknown-linux-gnu java version "1.8.0_92" Java(TM) SE Runtime Environment (build 1.8.0_92-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode) https://benchmarksgame.alioth.debian.org/u64q/swift.html
  • 29. Install swift to linux • Install required dependencies $ sudo apt-get install clang libicu-dev • Download the latest swift binary release from https://swift.org/download/#releases • Extract the archive $ tar xzf swift-<VERSION>-<PLATFORM>.tar.gz • Add the Swift toolchain to your path $ export PATH=/path/to/usr/bin:"${PATH}" • Test with REPL (Read Eval Print Loop)
  • 30. Swift Scripts #!/usr/bin/env swift let fruits = ["Banana", "Mango", "Apple", "Orange"] let sortedFruits = fruits.sorted{$0 < $1} print(sortedFruits) chmod +x sort.swift ./sort.swift
  • 31. Creating an Executable Contents of file hello.swift println("Hello world") $ swiftc hello.swift $ ./hello Hello world
  • 32. Web Frameworks • Perfect (9871) • Vapor (7786) • IBM Kitura (5002) • Swifton (2042) • Swifter (1852) • Zewo (1502) • … • ... • ...
  • 34. Vapor
  • 36. Benchmarking wrk -d 10m -t 4 -c 20 http://10.0.1.11:(PORT)/blog
  • 37. Benchmarking wrk -d 10m -t 4 -c 20 http://10.0.1.11:(PORT)/json
  • 38. Ready for Production? Not Yet !!! - Web frameworks < 1 year - Server = Maturity