13 comments

  • jacquesgt5 hours ago
    If you want to help improve the security of OS software through the magic of memory safe languages, the team that did this work is hiring: <a href="https:&#x2F;&#x2F;jobs.apple.com&#x2F;en-us&#x2F;search?search=Spear&amp;sort=relevance&amp;location=united-states-USA" rel="nofollow">https:&#x2F;&#x2F;jobs.apple.com&#x2F;en-us&#x2F;search?search=Spear&amp;sort=releva...</a><p>Knowledge of Swift not required. If you know your way around OS software, can reason about the security of the code you write, and are excited about writing exhaustively tested software, we’d love to talk to you.<p>We’re hiring for roles in kernel&#x2F;systems and userspace. Like the Platforms SOTU mentioned, we’re using Swift at all layers of the software stack now. <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;live&#x2F;yl2jsIoMfDU" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;live&#x2F;yl2jsIoMfDU</a><p>I had the pleasure of leading the effort to ship Swift in the Secure Enclave back in 2022. Now I have multiple teams working on accelerating the transition to memory safe languages. We’re showing that with good planning and a relentless focus on testing, we can improve security, performance, and functionality. And we get to have a ton of fun working with some amazing colleagues. It’s the most enjoyable and impactful work I’ve ever done in my career.
    • byproxy1 hour ago
      Any resources you&#x27;d recommend for learning about reasoning about the security of code?
      • rinon24 minutes ago
        For low-level system security, I&#x27;m a fan of <a href="https:&#x2F;&#x2F;llsoftsec.github.io&#x2F;llsoftsecbook&#x2F;LLSoftSecBook.pdf" rel="nofollow">https:&#x2F;&#x2F;llsoftsec.github.io&#x2F;llsoftsecbook&#x2F;LLSoftSecBook.pdf</a> as an overview for any systems developer, not just compiler devs. It might not be the most approachable, but it&#x27;s got great info on everything memory corruption.
  • comex5 hours ago
    Beware: As of a few months ago, when I tried to use the lifetime features shown off in this post, I ran into constant compiler crashes with very simple programs, until I gave up and wrote off the features as unusable. This happened on both stable and nightly compilers. I guess they work well enough for this TrueType interpreter, but I suspect they’re using a narrow subset of what the features are supposed to support. Or maybe things have been fixed very recently.<p>That said, I’m looking forward to using Swift lifetimes once they actually work!
    • stephencanon5 hours ago
      The work discussed in this post shipped in the OS last year (fall 2025), so nothing here is dependent on very recent changes.
  • pjmlp10 hours ago
    During the State of Platform keynote, on the subject of Swift adoption across macOS, several examples were given, not only TrueType engine.<p>RIS is happening across all OS levels, if the keynote is to be believed.
    • MBCook7 hours ago
      They’ve been doing it for years. I don’t remember how we first knew, but I know they’ve been using Swift in kernels for at least some of the other chips like the Secure Enclave or whatever.<p>I’m not sure exactly which. I assume it’s some of the code and not all. But it’s not new in the abstract.<p>That said I don’t think I’ve heard of it in the kernel of MacOS on the main processor. That may be new.<p>Either way this is certainly the most concrete announcement I remember them ever giving on this stuff.
      • commandersaki6 hours ago
        I know internally they use an IPsec implementation written by Rust (I think in the iCloud infra). Heard this from an ex-Apple engineer Ben (forgot his last name) that did a wonderful presentation of Rust from first principles. He said that it was hard to get people in on Rust when most would argue for Swift.<p>Edit: This is the guy: <a href="https:&#x2F;&#x2F;rustcurious.com&#x2F;course&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rustcurious.com&#x2F;course&#x2F;</a>
    • DASD10 hours ago
      Curious the direction of Webkit as there was a nebulous mention of select portions being rewritten from C++ to Swift. And yet, the new ECMAScript module (ESM) loader for Safari 27 is implemented in C++ (<a href="https:&#x2F;&#x2F;webkit.org&#x2F;blog&#x2F;17967&#x2F;news-from-wwdc26-webkit-in-safari-27-beta&#x2F;" rel="nofollow">https:&#x2F;&#x2F;webkit.org&#x2F;blog&#x2F;17967&#x2F;news-from-wwdc26-webkit-in-saf...</a>).
      • pjmlp9 hours ago
        No idea, maybe the private parts of the code, Safari isn&#x27;t open source, or is coming later.<p>In any case I would have liked to have more info during the deep dive sessions.<p>As it is, Meet with Apple on security (a 5h long event) had much more information.
    • hirvi748 hours ago
      What does RIS stand for?
      • gyomu8 hours ago
        Rewrite in Swift
        • willXare8 hours ago
          So RIS is Apple’s version of RiiR, but with better fonts.
          • cwillu5 hours ago
            s&#x2F;better&#x2F;blurrier&#x2F;
            • steve19772 hours ago
              Life without retina displays is possible, but pointless.
            • thewebguyd5 hours ago
              Careful, you’ll bring out all the “but it’s true to print media” people.
  • mrpippy10 hours ago
    The author discussed this a bit on Mastodon as well:<p><a href="https:&#x2F;&#x2F;xoxo.zone&#x2F;@numist&#x2F;116716469017975106" rel="nofollow">https:&#x2F;&#x2F;xoxo.zone&#x2F;@numist&#x2F;116716469017975106</a>
    • numist9 hours ago
      I&#x27;m also here :)
      • atdt6 hours ago
        Excellent write-up!
  • saagarjha10 hours ago
    Interesting that this is published under the MIT, rather than Apple’s more favorite Apache 2, license
    • JumpCrisscross9 hours ago
      Why is it interesting?
      • drob5189 hours ago
        Presumably because MIT is even more permissive and it’s a change in Apple’s behavior.
        • favorited8 hours ago
          Some corporations prefer Apache 2.0 for projects where they&#x27;ll be accepting contributions, because it includes patent protection and retaliation clauses. In case like this, where source code is just being published for reference and contributions aren&#x27;t accepted, those risks don&#x27;t exist.
        • zdw8 hours ago
          Given the age of TrueType, wouldn&#x27;t nearly all patents be expired already?<p>Apache2&#x27;s license I&#x27;ve heard described as mutually-assured-patent-destruction - if you use the code and make a patent claim, your rights to use the code go away.<p>So Apache2 offers little benefit here, and MIT may get it into more hands?
  • weinzierl9 hours ago
    Back in 2023 there was talks about Microsoft rewriting the font stuff in Rust for similar reasons Apple is now doing the Swift move.<p>I&#x27;m not sure what became of it and if it ever shipped. If anyone knows I&#x27;d be curious.
    • DASD9 hours ago
      Russinovitch (Azure&#x27;s CTO&#x2F;CISO) gave a speech at RustConf 2025 and mentions it(DirectWriteCore) took 2 engineers 6 months resulting in 154K LOC and 5-15 percent performance increase for font shaping. <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=uDtMuS7BExE&amp;list=PL2b0df3jKKiRFEuVNk76ufXagOgEJ9sBZ&amp;index=4" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=uDtMuS7BExE&amp;list=PL2b0df3jKK...</a>
  • ks20485 hours ago
    So, hinting only takes place at low resolutions, I believe. How often is it used, eg viewing “typical” PDFs on “typical” screens?
  • airstrike9 hours ago
    As much as I enjoyed Swift, one can only wonder what the world would look like if they had gone with Rust as their default language instead.
    • AceJohnny28 hours ago
      Rust doesn&#x27;t have an ABI [1]. Swift needed one to be a useable application language:<p><a href="https:&#x2F;&#x2F;faultlore.com&#x2F;blah&#x2F;swift-abi&#x2F;" rel="nofollow">https:&#x2F;&#x2F;faultlore.com&#x2F;blah&#x2F;swift-abi&#x2F;</a> (written by a core Rust developer)<p>[1] apart from the basic&#x2F;universal C one, which prevents exposing any useful Rust semantics over the interface
    • afavour8 hours ago
      One of the genius things about Swift is its interop with Objective C. Made the switch over considerably easier for developers. I’m not sure what that looks like in a Rust world.<p>Rust is also just a more complex language. I’m not convinced the benefits would have been worth it.
      • inkyoto1 hour ago
        Not just interoperability with Objective C but with C (full) and C++ (increasingly better but not full) as well.<p>Swift is also interoperable with different versions of itself courtesy of the Swift stable ABI (Application Binary Interface)[0], which they invested a significant amount of time into at the expense of adding other new features to the language, which have come along later.<p>Rust offers a different approach: recompile everything and static linking.<p>[0] <a href="https:&#x2F;&#x2F;faultlore.com&#x2F;blah&#x2F;swift-abi&#x2F;" rel="nofollow">https:&#x2F;&#x2F;faultlore.com&#x2F;blah&#x2F;swift-abi&#x2F;</a>
    • jadengeller9 hours ago
      Modern Swift borrows a lot from Rust! And it also has its own benefits, both ergonomic and also supporting eg generic in dynamic libraries
      • ecshafer9 hours ago
        Swift and Rust were developed at similar times. I think of them more as having similar influences than borrowing from each other.
        • pohl6 hours ago
          There’s no reason to invent your own head canon, the influence was openly acknowledged when Swift was new and it continues now that the language is developed out in the open (see Swift Ownership Manifesto)
          • zarzavat3 hours ago
            Obviously Rust was first but over time both languages have been taking inspiration from each other. For example let-else was motivated directly because of its success in Swift: <a href="https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rfcs&#x2F;3137-let-else.html#prior-art" rel="nofollow">https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rfcs&#x2F;3137-let-else.html#prior-ar...</a>
        • est319 hours ago
          Similar times and the Rust originator went on to work on Swift after it.
          • DenisChetwynd8 hours ago
            Graydon Hoare&#x27;s impact on the language is marginal than that of Chris Lattner, the originator (also, Hoare joined the team much later)
      • airstrike9 hours ago
        These days I mainly write Rust but I did write a semi complex iOS app and enjoyed Swift. I just didn&#x27;t love how slow the type checker was and how it got lost. I recall having to break things into smaller bits to help the compiler, and there were some oddities about the language.<p>The gap between the two languages is quite small, it just makes me wish Apple was also all-in on Rust
        • MBCook7 hours ago
          In the last year they’ve added improvements to the type checker to speed it up, those would have been released now.<p>They have further and much more significant changes that I think might have recently landed in the development version. That should make an even bigger difference. But it’s not in a released version yet.<p>And yes, none of us like that one part of Swift. Especially the DRASTIC difference compared to objective-C which really only checked syntax and little else.<p>It’s still probably my favorite language right now though I don’t get to write in it much.
        • inkyoto1 hour ago
          I see Swift as a more approachable version of Rust.<p>If somebody is mulling over Rust but finds it too difficult to grasp, they could start off with Swift first and then move over to Rust.<p>One of the main advantages of Rust is a more developed and thriving ecosystem.
        • DenisChetwynd8 hours ago
          maybe so on the surface, but it remains quite massive underneath; these languages are fundamentally different and target entirely different use cases
          • airstrike6 hours ago
            I&#x27;m not sure Rust has one specific use case as its main goal, despite being immediately suitable for systems programming.<p>I use it for making user-facing desktop applications, to name one example.
      • vardump9 hours ago
        Does it borrow borrow checker?
        • tialaramex7 hours ago
          I believe Swift tends to use reference counting and copy-on-write strategies. This, like GC, is less for the programmer to think about and doesn&#x27;t require the semantic checks, but sometimes the performance cost is unacceptable compared to what you&#x27;d write in Rust.
          • airspeedswift7 hours ago
            You can choose to use either refcounting or unique ownership for your types. For most use cases, refcounted (+ copy-on-write) is the best choice and is the default, but the truetype interpreter made extensive use of non-refcounted types to achieve this performance.
          • MBCook7 hours ago
            They have either recently added or talked about a borrow style system in the language as a way to avoid more copies and speed things up&#x2F;lower memory usage&#x2F;help with asynchronous programming.
        • anextio8 hours ago
          Yes, it has a borrow checker.
  • raphlinus9 hours ago
    Welcome to the club of doing high performance text in a memory safe language!
    • masiulis45 minutes ago
      There are dozens of us! Dozens!<p>Vello has been a big inspiration and source of knowledge for my own webgpu text renderer, thank you for that!
    • WalterGR44 minutes ago
      &gt; high performance text<p>Just strings or <i>rendering</i> strings?<p>If the latter, who are the other members of the club?
  • LoganDark9 hours ago
    I&#x27;m surprised the code has visible LLM smells. Though, I shouldn&#x27;t be surprised. I hope the important bits are still human-controlled (and the same for Apple&#x27;s many operating systems that absolutely deserve to remain stable and understood).
    • airspeedswift9 hours ago
      I assure you, every inch of the interpreter code has been stared at by humans, a lot. TBH even the assembly generated by it has.
    • dgellow9 hours ago
      From what I got Apple is using claude code A LOT internally
      • Cassell9 hours ago
        It would be interesting to see their internal guidance on LLM use. It’s a massive amount of new power that has to be wielded carefully. That kind of guidance might mean the survival or downfall of some big corps in the next few years.
      • wahnfrieden9 hours ago
        Yes they are using Claude Code - not the Xcode agents.<p>It worries me. I hope Codex adoption picks up there.
        • andrekandre5 hours ago
          thats a shame if true, they really should be dog-fooding that horrible agent ui in xcode to bring it up to a usable state
          • wahnfrieden5 hours ago
            A lot of devs are tricked into using it because it’s official
  • AndriyKunitsyn8 hours ago
    What&#x27;s funny is from 2023 (I think), macOS just draws the UI unhinted. You have a 1080p display and you don&#x27;t want to see the letters in the UI blurred to death? Tough luck, 1080p is incompatible with macOS, everybody needs &quot;retina&quot;, and nobody cares that Windows and all Linux DEs look on 1080p just fine.<p>It looks like this hinter will be used only in rendering PDFs, because that&#x27;s where they test the performance.
    • jacquesgt4 hours ago
      While hinting is disabled for most fonts, there are some fonts that require hinting to render correctly. We have to support hinting for those fonts, and it was easier to make it secure by rewriting hinting in Swift than it would have been to comprehensively identify every font created by those foundries.
    • nomel8 hours ago
      My last 1080p monitor was around 20 years ago. I have trouble comprehending people still use them regularly.
      • yjftsjthsd-h1 hour ago
        Then let me blow your mind:) One of my daily drivers is an ex-Chromebook at 1366x768. Granted, it&#x27;s also physically smallish so the DPI isn&#x27;t <i>quite</i> as low as a macbook would be with those pixels, but still. And that&#x27;s a touch cramped but it&#x27;s fine.
        • incanus779 minutes ago
          I&#x27;m reading on that resolution right now! MacBook Air 11&quot; running Linux that I use as a quick hacking&#x2F;reading machine in bed.
      • afavour7 hours ago
        A very quick search yielded Dell selling 1080p laptops today:<p><a href="https:&#x2F;&#x2F;www.dell.com&#x2F;en-us&#x2F;shop&#x2F;dell-laptops&#x2F;dell-15-laptop&#x2F;spd&#x2F;dell-dc15250-laptop" rel="nofollow">https:&#x2F;&#x2F;www.dell.com&#x2F;en-us&#x2F;shop&#x2F;dell-laptops&#x2F;dell-15-laptop&#x2F;...</a><p>It is very, very common. Just not in the Mac world.
        • import1 hour ago
          It’s very common for the people who got their last monitor 8 years ago.
          • bigyabai7 minutes ago
            It&#x27;s still the most common resolution for people using desktop monitors today, according to: <a href="https:&#x2F;&#x2F;gs.statcounter.com&#x2F;screen-resolution-stats&#x2F;desktop&#x2F;worldwide" rel="nofollow">https:&#x2F;&#x2F;gs.statcounter.com&#x2F;screen-resolution-stats&#x2F;desktop&#x2F;w...</a>
        • kbolino7 hours ago
          It&#x27;s also the corporate standard for generic cubicle workstation monitors, though it&#x27;s unusual to find a Mac in such a place anyway.
      • AndriyKunitsyn8 hours ago
        People also use usable mice instead of touchpads, and they put the &quot;ctrl&quot; key where Apple thinks a useless &quot;fn&quot; should be. All kinds of things happen outside Apple world.<p>To me, it&#x27;s more about what I&#x27;m used to. I have a perfectly fine several years-old monitor, so why should I throw it away?
      • mschuster917 hours ago
        The problem is, as soon as you are not on a Mac but Linux or Windows, you are in for an awful, truly awful lot of pain. HiDPI support is a mess because even in the rare case applications are made with HiDPI in mind they are not <i>tested</i> on HiDPI machines.<p>Other way around, most Mac software is not tested how it behaves on inferior external monitors.
        • AndriyKunitsyn4 hours ago
          What kind of windows programs are these? HiDPI is more than a decade old. A desktop application, no matter what OS it is, should always be tested with different scaling factors.
    • TazeTSchnitzel7 hours ago
      macOS has been drawing unhinted text for an eternity, and for those who can tolerate it on low-DPI screens, it&#x27;s a great thing: the letter shapes look the same at all sizes, and the spacing between letters is consistent at all sizes.
      • bschwindHN5 hours ago
        I&#x27;m a high DPI snob so I haven&#x27;t used a low res monitor for work in forever, but isn&#x27;t the entire point of font hinting to make the text more legible at smaller pixel grid sizes? Yes, of course the shapes are more consistent since the hinter isn&#x27;t touching them, but isn&#x27;t the end result just less legible text?
        • kccqzy5 hours ago
          Hinting purposefully destroys letter shapes in exchange for crispness. People who like macOS style font rendering prioritize letter shapes faithful to the font designer more than crispness.<p>Whether good letter shapes is more legible or crisper text is more legible is basically subjective. In the 2000s before HiDPI became popular different people really thought one was more legible than the other and vice versa. HiDPI made this basically moot.
    • kbolino7 hours ago
      I had this problem on the first Apple Silicon Mac Mini in 2020 so it&#x27;s at least a little older than 2023.
  • troupo10 hours ago
    I think these are the types of things Apple should&#x27;ve focused on instead of half-heartedly barging ahead with SwiftUI and breaking the language in the process
    • saagarjha10 hours ago
      I mean they’re doing both
  • wg09 hours ago
    No mention of AI? Hand written code?
    • numist8 hours ago
      There&#x27;s mention at the end. The models (and Swift itself!) have evolved a lot since this project started, so the early code is largely hand-rolled and the later changes were mostly authored by centaurs (to steal a term from chess).<p>But I personally reviewed every line that shipped and was absolutely insufferable about testing.