Declarative Programming in Swift
summary
Argues that Swift’s protocols, generics and operator overloading let developers express the “what” instead of the “how,” and demonstrates concrete implementations: replacing loops with map/filter/reduce patterns, building a Visual Format Language DSL via an overloaded infix operator that generates typed constraints (it works), creating an AbsolutePath type that validates on init to eliminate runtime throws, and a cross‑platform UIView/NSView wrapper. Emphasizes pushing semantics into types and protocols and shows working prototype code and slides.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 0:55Declarative Programming
- 1:15Declarative Language
- 1:36Implicit vs Declarative
- 3:05What is Declarative
- 3:34Advantages
- 6:10Imperative vs Declarative
- 7:47Avoid Loops
- 9:03Language Primitives
- 10:24DSL
- 11:22Apples Documentation
- 12:46Mental Model
- 13:15Declarative UI
- 15:06Semantics and Row Types
- 16:47Generics
- 17:40Protocols
- 18:30Generic Data Structures
- 21:58Conclusion
related talks
20mHow Not to Write Swift
17mFinally Solving the Expression Problem
34mSwift: New Paradigms for iOS Development
18mScientific Swift
19mFinally Solving the Expression Problem
48mLearning From Our Elders: Applying functional insights without losing Swift
53mSwift: New Paradigms for iOS Development
16mElements of Functional Programming
