Server Side Swift Conference 2024
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 developer’s 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:
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
Ben dropped the bomb on the swift-java interoperability: You can now include swift in java and vice-versa, using the swift-java library.
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.
- 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
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.
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.
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.
an architecture overview
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.
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
build-up of proper cancellable Task
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.
Thomas Durand gave a quick introduction for iOS developers on what comprises a backend system. Talking about routes, middleware, authentication, best practices etc.
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.
Just before lunch Adegboyega Olusunmade talked about a pub-quiz app he created. With a website build in vapor.
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
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
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!
Student Babeth Velghe explained how to automatically create vapor code from an OpenAPI specification file (née JSONSpec).
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?)
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.
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!