~/talk

Wrapping an OO API in a Functional Way

Talkat Lambda World 2015 · on Saturday, 2015-10-24· [swift]
slides:none on file

Shows how Swift gives structs with value semantics over existing Cocoa NS(Mutable)Data by wrapping NSMutableData in a Swift struct that exposes a bytes array and a mutating append. Demonstrates unsafe C byte access, initializer and mutating methods constrained by let/var, and the performance fix: put the ObjC object in a Swift Box wrapper + isUniquelyReferencedNonObjC check so copy-on-write avoids N copies during repeated appends (one real copy only).

AI-written summary · about

  1. 0:00Intro
  2. 1:55Eric Meyer
  3. 3:24My story
  4. 7:17Burnout
  5. 8:13ObjectiveC Denio
  6. 10:05ObjectOriented Programming
  7. 10:36ObjectiveC Code
  8. 11:54ObjectiveC vs Cocoa
  9. 14:10Cocoa Protocols
  10. 15:42Swift
  11. 17:38Functional Programming a Swift
  12. 19:10Demo Time
  13. 19:55structs
  14. 25:28Creating a struct
  15. 27:22Variables are immutable
  16. 28:32Copyonwrite
  17. 29:26Initializer
  18. 30:20Reference Types
  19. 33:08Making Data
  20. 34:04Printing Data
  21. 34:41Making a Copy
  22. 42:14The Mistake
  23. 43:49Efficiency
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.