Swift at Apple: Migrating the TrueType hinting interpreter(swift.org)
235 points by DASD 2 days ago | 123 comments
tl;dr: Apple rewrote the TrueType font hinting interpreter from C to Swift for Fall 2025 releases, achieving memory safety while running 13% faster on average than the C version it replaced. Key optimizations included using noncopyable value types (~Copyable), Span for safe sequence access, projection types to avoid copying data across the C/Swift boundary, and continuation-passing patterns to eliminate heap allocations. Apple has open-sourced the implementation on GitHub as a reference, and notes that LLM coding assistants helped accelerate the C-to-Swift migration.
HN Discussion:
  • Apple security team recruiting pitch leveraging the article's credibility
  • ~Swift's optimization workarounds reveal compiler shortcomings that shouldn't be necessary
  • Swift's new lifetime features are buggy and not production-ready in general use
  • This migration is part of a broader, credible Swift adoption trend across Apple's OS
  • ~Speculation that Rust might have been a better default choice than Swift