Swift 6.4 Programming in 21 Days: A Hands-On Course in Protocol-Oriented Programming and Strict Concurrency (Learn Programming in 21 Days)
ANT
• Instant access to your digital edition.
• Read anytime, anywhere, on your favorite device.
• No shipping — your book is delivered digitally.
• Simple, secure access after purchase.
Instant digital delivery after purchase.
Discover another great read to add to your digital library.
Description
Twenty-one days. One project, quarry, a search engine grown day by day. Every line obeys the Swift 6 language mode from Day 1.
Swift 6's strict concurrency checking rejects code that Swift 5 accepted without complaint, turning a data race that used to run into a compiler error instead of a 3 a.m. crash. Value semantics change what changed even means: a struct that looks shared is copied, and a class that looks copied is shared, and the difference is invisible until it is measured.
Day 1 sets the language mode to Swift 6 before a single line of quarry exists. By Day 11 quarry has an inverted index and ranks results with BM25. By Day 16 that index builds in parallel with structured concurrency, at the speedup Day 14 measured was available. Day 21 ships quarry as a real Swift package.
234 figures across 21 chapters, one beside almost every idea. 227 listings compile under the Swift 6 language mode, and 211 output blocks were captured from a real swift run rather than typed. Quarry is one running project, grown for 21 days straight, never restarted.
YOUR 21-DAY PATH
Day 1 - The Toolchain, the Module, and the First Program: building and running Swift from the command line.
Day 2 - Values, References, and Copy-on-Write: choosing struct versus class, and measuring when a copy happens.
Day 3 - Optionals, and the Absence of Nothing: replacing a sentinel, and keeping the happy path flat with guard.
Day 4 - Errors Are Values: throws, typed throws, and knowing when Result is the better tool.
Day 5 - Collections and the Algorithms on Them: picking the right collection over an index loop.
Day 6 - Generics and Constraints: writing a generic type with real constraints.
Day 7 - Protocols and Protocol-Oriented Design: designing against a protocol, and what some costs against any.
Day 8 - Strings, Unicode, and the Grapheme Cluster: tokenizing text without assuming a character is a byte.
Day 9 - Codable and the On-Disk Format: persisting and reloading the index, with control over its shape.
Day 10 - Files, Paths, and the File System: walking a directory tree portably, without corrupting anything.
Day 11 - The Inverted Index and BM25: the data structure that makes search fast, ranked defensibly.
Day 12 - Value Semantics at Scale: keeping value semantics without paying for them.
Day 13 - Testing With swift-testing: tests that state intent, parameterized instead of looped.
Day 14 - Performance, Measure Before You Guess: measuring honestly, and finding the real hot spot.
Day 15 - Tasks and Async, Await: reading asynchronous code, and what suspension actually means.
Day 16 - Structured Concurrency and Task Groups: parallelizing the index build for real speedup.
Day 17 - Actors and Data Isolation: protecting shared mutable state without a lock.
Day 18 - Sendable and the Swift 6 Language Mode: reading and fixing strict-concurrency diagnostics.
Day 19 - AsyncSequence and Streaming Results: streaming results instead of collecting them first.
Day 20 - The C Boundary and Memory Safety: calling C from Swift, and knowing where the guarantees stop.
Day 21 - Packaging, Shipping, and the Capstone: shipping quarry as a real package, ready to take further.
WHO IT IS FOR. A programmer who already codes in some other language and wants Swift as a serious systems and server language, not only for iOS apps. You need the Swift 6.4 toolchain and a terminal; no prior Swift, Xcode or Apple-platform experience is assumed. You do not need UIKit, SwiftUI or any Apple framework -- quarry runs from the command line on its own.
Download book source code from: /
446 pages, black and white.
Specifications
Frequently asked
Do I need an account to download?
No. After purchase, you can access your ebook directly from the order confirmation or download page.
What if a copy arrives damaged?
Contact us and we’ll help you access the file or provide a replacement download if needed.