~/talk

Swift Secrets: Unlocking the Power of 'Any' and 'Some'

Talkat Swift Heroes 2023 · 2023-05-04..05-05· [swift]
name:Yuki Aki
github:freddi-kit
slides:none on file

Explains that Swift’s any creates an existential container = 40 bytes (64-bit) which stores small structs inline and moves large values to the heap, causing hidden allocations; method calls through existentials use dynamic dispatch via witness table, while some (opaque) avoids the container and keeps static dispatch. Uses the Swift compiler and SIL to show the optimizer can specialize any/some into static calls for monomorphic call sites, but specialization often fails across modules unless symbols are opened or inlinable.

AI-written summary · about

  1. 0:00Intro & Agenda
  2. 1:36“any” and “some” revolution
  3. 3:05Existential Type’s
  4. 6:41How Generics working?
  5. 7:55Protocol abstraction
  6. 11:45“any” Mechanism with Existential Container
  7. 13:50Object in Existential Container (struct)
  8. 16:35Method Dispatch of Existential Container
  9. 19:01Metadata
  10. 20:05How Existential Containers actually works?
  11. 26:00Specialisation of function argument with Generics
  12. 27:27Limitation of argument Specialization
  13. 29:15Summary: Optimization
~/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.