Hi everyone,
I've been putting together swiftlings-linux, a set of small, fix-the-broken-file exercises for learning Swift, in the style of Rustlings. You open one exercise at a time, make it compile and pass its checks, and the watcher moves you on to the next. Every exercise links to the matching chapter of The Swift Programming Language.
It is a fork of Swiftlings by Tornike Gomareli. The exercises and the runner come from there; what this fork adds is making the whole thing build and run cleanly on Linux with Swift 6.1, with no Xcode and no Apple-only runtime behaviour.
Why a Linux-first version? Most people reaching for Swift on Linux are not writing iOS apps: server-side Swift (Vapor, Hummingbird), contributing to the toolchain, CI in the official Swift Docker images, or just learning the language without a Mac. The exercises are tuned so they actually run in that environment: anything that needs a main run loop or an Apple-platform API has been reworked into a CLI-friendly equivalent.
What's covered: 23 topics, from the basics up through optionals, structs/classes, protocols, generics, error handling, memory management, Codable, property wrappers, concurrency (async/await, actors, AsyncSequence), result builders, and advanced types, plus a bonus dsa_queue track that builds a FIFO queue up to Collection conformance. Every exercise also ships a worked solution in solutions/.
Here's the link: GitHub - lucasly-ba/swiftlings-linux: Small exercises to get you used to reading and writings Swift code! · GitHub
Feedback I'm most interested in: whether the pacing works for someone coming from another language, and whether the Linux-specific reworks (concurrency, property wrappers) feel natural or forced. Bug reports and PRs are welcome too.