Swift at Apple: Migrating the TrueType hinting interpreter
Posted by DASD 4 days ago
Comments
Comment by jacquesgt 4 days ago
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.
We’re hiring for roles in kernel/systems and userspace. Like the Platforms SOTU mentioned, we’re using Swift at all layers of the software stack now. https://www.youtube.com/live/yl2jsIoMfDU
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.
Comment by rfc3092 3 days ago
Comment by musicale 3 days ago
I may be wrong about this, but I don't think Apple bans you from applying to multiple positions within the same year the way some companies do.
There also seems to be a decent pipeline for new graduates (though I think highlighting relevant academic, research, and open source projects can still help.) Internships can also be a path if you are currently in school.
I don't know if Apple recruits on linkedin, but that might also be an option.
Of course connecting right here on HN seems like a great idea as well.
Comment by rfc3092 3 days ago
> However, applying to the right position, with a good resumé that highlights experience/skills/projects/open source contributions/education/etc. that are directly related to the position, also matters.
I assume that Apple is even more competitive, than my current place. But even here it is not realistic: I heard we’re getting 500+ applications/position/day and _nobody_ looks at them unless there’s a lead/recommendation.
Comment by musicale 3 days ago
Of course in an alternate universe where macOS (and iOS etc.) was based on Multics rather than Unix, it would have had essentially zero buffer overflows - which are hard to create in PL/I but hard to avoid in C. Even Apple's Pascal compilers from the 1980s had range checking...
But legacy C code can/should absolutely use things like clang's -fbounds-safety (has been in clang on macOS for years) etc. Fil-C is another option.
Comment by byproxy 4 days ago
Comment by rinon 4 days ago
Comment by Degorath 3 days ago
Comment by ComputerGuru 3 days ago
Comment by KolmogorovComp 4 days ago
It does feel like a compiler/optimiser failure to have to rewrite those cases.
Comment by leecommamichael 1 day ago
Comment by Altern4tiveAcc 4 days ago
Though, it probably wouldn't work if user code modified the Array prototype.
Comment by comex 4 days ago
That said, I’m looking forward to using Swift lifetimes once they actually work!
Comment by stephencanon 4 days ago
Comment by monster_truck 4 days ago
Comment by pjmlp 4 days ago
RIS is happening across all OS levels, if the keynote is to be believed.
Comment by MBCook 4 days ago
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.
That said I don’t think I’ve heard of it in the kernel of MacOS on the main processor. That may be new.
Either way this is certainly the most concrete announcement I remember them ever giving on this stuff.
Comment by commandersaki 4 days ago
Edit: This is the guy: https://rustcurious.com/course/
Comment by pjmlp 4 days ago
However I miss them actually having had one of those 15 - 30m WWDC sessions, where they could have gone a bit deeper into the keynote examples
Comment by DASD 4 days ago
Comment by pjmlp 4 days ago
In any case I would have liked to have more info during the deep dive sessions.
As it is, Meet with Apple on security (a 5h long event) had much more information.
Comment by JimDabell 4 days ago
https://blog.timac.org/categories/reverse-engineering/
And frequently discussed on Hacker News:
https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
Comment by pjmlp 3 days ago
Comment by hirvi74 4 days ago
Comment by gyomu 4 days ago
Comment by willXare 4 days ago
Comment by cwillu 4 days ago
Comment by steve1977 4 days ago
Comment by ahartmetz 4 days ago
Comment by tonyedgecombe 4 days ago
Comment by thewebguyd 4 days ago
Comment by saagarjha 4 days ago
Comment by JumpCrisscross 4 days ago
Comment by drob518 4 days ago
Comment by favorited 4 days ago
Comment by zdw 4 days ago
Apache2's license I'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.
So Apache2 offers little benefit here, and MIT may get it into more hands?
Comment by mrpippy 4 days ago
Comment by dpark 3 days ago
This is the most interesting bit to me. Engineers consistently underestimate the amount of effort that testing demands for projects that need truly high quality, it’s nice to see this shared.
Comment by weinzierl 4 days ago
I'm not sure what became of it and if it ever shipped. If anyone knows I'd be curious.
Comment by DASD 4 days ago
Comment by ks2048 4 days ago
Comment by dcrazy 3 days ago
Comment by yyyk 4 days ago
Did they need a fuzzer for that? They could've render them all and see what's exercised?
Comment by thechao 4 days ago
Comment by troupo 4 days ago
Comment by saagarjha 4 days ago
Comment by airstrike 4 days ago
Comment by AceJohnny2 4 days ago
https://faultlore.com/blah/swift-abi/ (written by a core Rust developer)
[1] apart from the basic/universal C one, which prevents exposing any useful Rust semantics over the interface
Comment by afavour 4 days ago
Rust is also just a more complex language. I’m not convinced the benefits would have been worth it.
Comment by inkyoto 4 days ago
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.
Rust offers a different approach: recompile everything and static linking.
Comment by pjmlp 4 days ago
You missed Java as well.
Comment by jadengeller 4 days ago
Comment by airstrike 4 days ago
The gap between the two languages is quite small, it just makes me wish Apple was also all-in on Rust
Comment by MBCook 4 days ago
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.
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.
It’s still probably my favorite language right now though I don’t get to write in it much.
Comment by geodel 3 days ago
Comment by inkyoto 4 days ago
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.
One of the main advantages of Rust is a more developed and thriving ecosystem.
Comment by stasomatic 3 days ago
Comment by steveklabnik 3 days ago
Comment by stasomatic 3 days ago
Comment by kibwen 3 days ago
Comment by stasomatic 2 days ago
The “Rust” branding, to this rando, implies corrosion, oxidation, decay, regardless of the true origin of the name. Swift is “quick”, Java is “caffeine”, Rust is something I need kerosene for.
Comment by steveklabnik 2 days ago
Comment by stasomatic 20 hours ago
Comment by steveklabnik 19 hours ago
Comment by airstrike 2 days ago
Comment by DenisChetwynd 4 days ago
Comment by airstrike 4 days ago
I use it for making user-facing desktop applications, to name one example.
Comment by ecshafer 4 days ago
Comment by pohl 4 days ago
Comment by zarzavat 4 days ago
Comment by pjmlp 4 days ago
Many features that get discussed as being Swift/Rust, trace back to one of those languages.
Comment by est31 4 days ago
Comment by DenisChetwynd 4 days ago
Comment by vardump 4 days ago
Comment by tialaramex 4 days ago
Comment by airspeedswift 4 days ago
Comment by pjmlp 4 days ago
Being more ergonomic is relevant enough for increasing language adoption, that possible improvements are now on Rust roadmap.
Comment by MBCook 4 days ago
Comment by anextio 4 days ago
Comment by pjmlp 4 days ago
Rust 2026 roadmap has language ergonomics on it for a reason.
That said, outside Apple ecosystem you probably better with Rust, or if one has no GC issues, OCaml, Haskell, F#, Scala, C#.
Comment by jounker 4 days ago
Comment by LoganDark 4 days ago
Comment by airspeedswift 4 days ago
Comment by ahartmetz 4 days ago
Comment by dcrazy 3 days ago
Comment by dgellow 4 days ago
Comment by wahnfrieden 4 days ago
It worries me. I hope Codex adoption picks up there.
Comment by andrekandre 4 days ago
Comment by dcrazy 3 days ago
Comment by wahnfrieden 3 days ago
Comment by wahnfrieden 4 days ago
Comment by LoganDark 4 days ago
Comment by wahnfrieden 3 days ago
Comment by LoganDark 3 days ago
Comment by wahnfrieden 3 days ago
Comment by Caracas288 4 days ago
Comment by raphlinus 4 days ago
Comment by masiulis 4 days ago
Vello has been a big inspiration and source of knowledge for my own webgpu text renderer, thank you for that!
Comment by WalterGR 4 days ago
Just strings or rendering strings?
If the latter, who are the other members of the club?
Comment by raphlinus 3 days ago
There's also, very relevantly, the DWriteCore work from Microsoft. My understanding is that there's been some talk of open sourcing that, but it's still proprietary.
There are other things that count as high performance text in memory safe languages, for example implementations in Go, but in general those are not a good candidate to replace C and C++ in environments like operating systems and browsers.
Comment by WalterGR 15 hours ago
Skrifa - Skia in Rust. https://github.com/googlefonts/fontations/tree/main/skrifa , https://developer.chrome.com/blog/memory-safety-fonts
Harfrust - HarfBuzz in Rust. https://github.com/harfbuzz/harfrust , https://github.com/googlefonts/oxidize
Parley - text layout in Rust. https://github.com/linebender/parley
DWriteCore - the Windows App SDK implementation of DirectWrite. https://learn.microsoft.com/en-us/windows/win32/directwrite/...
Comment by AndriyKunitsyn 4 days ago
It looks like this hinter will be used only in rendering PDFs, because that's where they test the performance.
Comment by jacquesgt 4 days ago
Comment by nomel 4 days ago
Comment by afavour 4 days ago
https://www.dell.com/en-us/shop/dell-laptops/dell-15-laptop/...
It is very, very common. Just not in the Mac world.
Comment by kbolino 4 days ago
Comment by import 4 days ago
Comment by bigyabai 4 days ago
Comment by SSLy 4 days ago
1920 x 1080 51.89%
2560 x 1440 21.20%
3840 x 2160 5.00%
Comment by carlosjobim 4 days ago
Comment by AndriyKunitsyn 4 days ago
To me, it's more about what I'm used to. I have a perfectly fine several years-old monitor, so why should I throw it away?
Comment by nomel 3 days ago
Comment by yjftsjthsd-h 4 days ago
Comment by incanus77 4 days ago
Comment by mschuster91 4 days ago
Other way around, most Mac software is not tested how it behaves on inferior external monitors.
Comment by AndriyKunitsyn 4 days ago
Comment by mschuster91 4 days ago
Comment by AndriyKunitsyn 2 days ago
Comment by dcrazy 3 days ago
Comment by AndriyKunitsyn 3 days ago
Comment by dcrazy 3 days ago
Mac OS X 10.4 tried the same thing (Quartz2D scaling) and it was so damn difficult that they threw it out and went for simple 1x/2x/3x auto-scaling. Even 3x was a challenge because of pixel alignment.
Comment by AndriyKunitsyn 2 days ago
>Have you ever tried to write HiDPI-aware Win32 code?
I haven't. I don't think there's any reason to, I'm more of a wxwidgets fan. I don't think even Microsoft makes applications in raw WinAPI.
>I suggest enabling HiDPI in Control Panel sometimes and marveling at how many Win32 apps just don’t notice and draw as postage stamps.
The default behaviour of a DPI-unaware app in Windows is to scale everything by the scale factor. Which - yes, looks completely awful and blurry, but that's not what you describe.
Comment by wmedrano 3 days ago
Edit: Guess it depends on the app
Comment by TazeTSchnitzel 4 days ago
Comment by bschwindHN 4 days ago
Comment by kccqzy 4 days ago
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.
Comment by carlosjobim 4 days ago
If you work with text and fine UI elements, do yourself a favour and get proper tools for the job. Get an ergonomic mouse and a good keyboard while you're at it. In every other field professionals use high quality tools to do their jobs, IT shouldn't be any different.
A plumber has equipment worth tens of thousands of dollars, while IT professionals think it's outrageous to pay a few hundred for equipment which is undeniably an improvement.
Comment by kbolino 4 days ago
Comment by wg0 4 days ago
Comment by numist 4 days ago
But I personally reviewed every line that shipped and was absolutely insufferable about testing.