| 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:
| |