Server Side Swift Conference 2024

Server Side Swift Conference 2024

2024, Sep 27    

On September 26 and 27, 2024 the fourth Server Side Swift conference was held. This time in London.

The special thing about this conference, is that Apple was a main sponsor. Apple normally does not sponsor conferences outside wwdc. There were also about 20 people from Apple walking around, devs, managers, developer relations and even legal. Apparently it is a hot topic!

All available videos are referenced under this logo:

Swift Server Conf logo

Day 1

Day one started with a talk by Tony Parker and Ben Cohen from Apple. Tony described how they were able to rewrite the Foundation library fully in swift, by replacing C++ code step-by-step. Making some code 100x faster!

  • All C and ObjC Foundation is now rewritten in swift, with shims for ObjC and C
  • Foundation is now fully open source
  • better performance!, JSONDecode is 2-3x faster
  • URLComponents: 250x faster!
  • Papercuts initiative; painful small occurrences for new developers

FormatStyle performance vs DateFormatter

Ben dropped the bomb on the swift-java interoperability: You can now include swift in java and vice-versa, using the swift-java library.

Swift + Java interoperability

Youtube


Next Daniel Steinberg gave an insightful talk about swift macros. Explaining about freestanding and attached macros and several gotchas. And of course he elaborated on his hate driven development paradigm.

Swift Macros

  • remember to control-click on the preview macro
  • he created an SFSymbol name macro
  • remember to use the swift.ast-explorer.com website to examine the swift syntax tree
  • freestanding macro, always starts with #, it replaces the macro with a string
  • attached macros start with @, adds or supplements the code

Youtube


One thing that is nice about the Server Side Swift conference are the many and long coffee breaks. Allowing you to meet and talk with all the other developers.


The next talk was about generating static websites using the Toucan markdown to html converter in swift, by Tibor Bödecs. Toucan is different from Paul Hudson’s Publish, in that it uses standard css, javascript and markdown, instead of swift code.

Toucan markdown to html converter

Youtube


After lunch a talk on how to ship a SAAS backend with Vapor, by Petr Pavlik. This was more a summing-up of all the tools he used.

IndiePitcher

Youtube


The talk by Leo Dion about how to write a backend for an exercise app, complete with websockets integration with a website, directly from an Apple Watch was very interesting and complete.

Server Side Swift Workout in the Real World

an architecture overview

an architecture overview

Youtube


The talk by Mikaela Caron about how to save a file from an API was a bit…inconclusive. She had to ask the audience how to actually do it. Luckily there was a guy from AWS in the audience. Her potential app Fruitful sounds promising though: an easy way to keep up with people you meet at conferences.

Youtube


The final talk of the day was by Franz Busch from Apple’s Swift on Server Team, on how to leverage concurrency in a correct way in your app. e.g. how to cancel background tasks that are not needed anymore in a correct fashion. This had some excellent points.

  • Avoid unstructured concurrency (dispatchqueue blocks)
  • unstructured: cannot be cancelled
  • do NOT create Tasks alone, store them and cancel them
  • provide run methods
  • default methods are ‘nonisolated’
  • handle graceful shutdown
  • swift service lifecycle on github: ServiceRunCycle

different tasks table

build-up of proper cancellable Task

different tasks table

Youtube


In the evening there were drinks. The funniest moments were when Georg Tuparev impressed an NSLondon organiser with memories from his days using NeXTStep, and various meetings with Steve Jobs.


Day 2

The second day started strong with a talk about serverless computing using swift lambdas on AWS, by Sébastian Stormacq from AWS Developer Relations. He also showed how to make the packages even smaller and more responsive using the new swift package AWS Lambda Runtime. And a VSCode plugin to more easily create the necessary Serverless Application Model yaml config file.

aws lambda

aws lambda vscode plugin

aws demos

Youtube


Thomas Durand gave a quick introduction for iOS developers on what comprises a backend system. Talking about routes, middleware, authentication, best practices etc.

Thomas Durand

Youtube


Then there was a nice talk from Steven van Impe who created courseware material for SwiftWASM: Swift for Webassembly. As a lecturer at the HOGENT he explained the setup very clearly and had demo repos ready for people to start with.

Steven van Impe

Toolchains and kits

Demos

Youtube


Just before lunch Adegboyega Olusunmade talked about a pub-quiz app he created. With a website build in vapor.

Misadventures and adventures of Building a Trivia App with Vapor

Youtube


After lunch there were four shorter lightning talks.

An interesting talk by Euan Harris from Apple, on how to publish to a cloud with only one step.

  • streamline the containerisation process using swift package manager
  • cross compiling: Swift-SDK -> cross compile to linux
  • build your own Docker image using swift
  • podman, to test containers with on the command line

Swift to the cloud

Swift to the cloud

Swift to the cloud

Youtube


Then a real life implementation of vapor from Vojtech Rylko from Cultured Code, for Things. They migrated their backend fully to swift and it is now handling 500 requests/second for the last 10 months.

  • resilience!
  • “theory of operational information”
  • mail - to Things
  • At first they needed 50 Google compute instances
  • they use swift-slim container image
  • they use the swift prometheus package

Things Cloud

They have one codebase, which can present itself as 4 different services:

  • Services API
  • Background
  • Things Cloud API
  • APNs Worker

They use chaos engineering on their internal development environment!

Youtube

Student Babeth Velghe explained how to automatically create vapor code from an OpenAPI specification file (née JSONSpec).

OpenAPI spec sample

Youtube


And finally Joannis Orlandos announced Hummingbird 2. A different web application technology, build from the ground up using swift 6 and async-await.

  • Swift 6 web framework
  • 100% structured concurrency
  • no event loop futures
  • Swift HTTP types
  • up to 8x less code! (than Vapor?)

Hummingbird 2 slide Youtube


The last two talks were amazing.

A high-paced talk from Nick Lockwood titled “So you think you know swift”, with a cornucopia of swift gotchas and better code styles. Nick wrote the SVGPath package and ShapeScript

  • for case let string in undundun
  • labels, for loops and if
  • strings
  • optionals
  • enum associated values is also called tagged unions?

Great talk to watch again with a lot of low-level swift explanation. Struct with optional variable

Terrible if case let syntax

Double Switch

Youtube


And the last talk by Cory Benfield from Apple‘s Swift on the Server team, on how Apple deploys swift on the server itself. He talked about various anonymising algorithms, to power Private Cloud Compute. It handles, among others:

  • icloud keychain,
  • shareplay
  • noted
  • private cloud compute

Lots of privacy acronyms mentioned, Hybrid Public Key encryption, KEM, KDF, AEAD. I might have gotten some wrong.

Idea: eliminate force-unwraps using a finite state machine ← look at that explanation again.

Private cloud compute handles 1000000 requests per second!

Youtube