~/talk

Swift type metadata

Talkat try! Swift Tokyo 2019 · 2019-03-21..03-22· [swift]

Claims that Swift runtime exposes usable type metadata and reads type metadata via unsafeBitCast to extract names and layout. Demonstrates reproducing the metadata memory model, reproduces runtime memory layout and implements a prototype that prints type names and instantiates values by walking descriptors, so builds a stub generator to instantiate types. It executes successfully but warns metadata format changes (Swift 4 → 5), is fragile and inefficient, and method rewrites or optimizer-driven static dispatch can break hacks.

AI-written summary · about

  1. 0:00Introduction
  2. 0:53Getting type name
  3. 1:39What is type metadata
  4. 4:06Swift runtime
  5. 4:58Type
  6. 8:50Relative pointer
  7. 9:27Extract type name
  8. 10:35Get type name
  9. 11:35Mirror API
  10. 12:04Recreate memory layout
  11. 13:08OSS metadata
  12. 13:45JSON metadata
  13. 14:23rust usage
  14. 19:15summary
~/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.