Pragma mark— Server Side Swift Workshop

Stefano Frosoni
If let swift = Programming!

--

This year I partecipated to the “Pragma Mark” Conference in Verona, Italy (11–12–13 October 2017).

This conference was introduced by 1 day of workshop about different topics. I chose to partecipate to the “Server Side Swift” workshop.

Why Swift on server side?

Swift on server side has been a very exciting project, since Apple officially released an open source linux version in december 2015.

There are many advantages on using swift on server side:

  • Writing your server in Swift in addition to an iOS or macOS app allows the two to share code and frameworks
  • It’s easier to stay consistent by sticking to one language and style
  • It also reduces the overhead in terms of testing

All of this is particularly appealing to an indie developer, but can be beneficial also to larger enterprises.

But there also another important reason to use swift: Swift is strongly typed.

This generally increases the level of automation, code generation, tool support. It also produces more stable code.

Open source community

The open source community has been working hard at building libraries using Swift for Server.

At the time of writing this article, the top Server-Side Swift Frameworks (listed in order of Stars on GitHub) are:

  • Perfect (12271 ⭐)
  • Vapor (11406 ⭐)
  • Kitura (6019 ⭐)
  • Zewo (1718 ⭐)

This useful article by Ryan Collins tested performances of all those Frameworks and compared them with Node.js . His conclutions are that all of these frameworks performed very well and Node.js was beaten by at least two of them in every test.

This mean that swift has very good performances on served side.

Vapor

While each of those framework has something unique to offer, the workshop was about Vapor created by Tanner Nelson (@tanner0101), an American software engineer based in New York City.

After officially releasing Vapor 1.0 in September, 2016, the team has been working hard and the current version available is Vapor 2.2.2 . They are already working on Vapor 3.

Why Vapor?

Vapor has many advantages:

  • Enormous and very active community
  • Very simple syntax
  • Being written purely in Swift
  • Very readable and understandable API and no dependence with third parties libraries

Being only Swift allows them to focus on keeping their APIs simple, readable, and keeping their naming and other conventions in line with the language. The only weakness is that: they sacrifice a little bit of speed and performance in favour of being pure Swift.

Links

To conclude this article I agreee with the words by Ryan Collins saying that Server-Side Swift is well on its way to being a very big contender in the programming arena.

Thanks for your time! I hope you find this article useful.

Get in touch on Twitter: stefanofrosoni

--

--