Greg Parker
sealiesoftware.com · Personal blog · on HN since 2008
Greg Parker, an Apple engineer who worked on the Objective-C runtime, writes about runtime internals, debugging, and macOS behavior.
What HN saysCommenters link his posts on non-pointer isa, fork() in macOS, and debugging stories, and recommend his work for understanding the Objective-C runtime.
31HN people shared it
22linked it in comments
11stories submitted
201story points
8 months agolast shared
2008people per year2026
Most-shared posts
- 1Objective-C and fork() in macOS 10.136 people · 5 points · first shared 2017 · discussion on HN
- 2Selector uniquing in the dyld shared cache (Snow Leopard performance)4 people · 25 points · first shared 2009 · 1 comments on HN
- 3An Illustrated History of objc_msgSend3 people · 110 points · first shared 2013 · 42 comments on HN
- 4Hamster Emporium: [objc explain]: Non-pointer isa3 people · 1 points · first shared 2013 · discussion on HN
- 5Blog3 people · first shared 2013
- 6Fun with debugging a complex Cocoa app, with Dr. Greg Parker2 people · 2 points · first shared 2010 · 1 comments on HN
- 7Experimental Port of Valgrind Memory Debugger for Mac OS X2 people · 1 points · first shared 2008 · discussion on HN
- 8Objc explain Non fragile ivars2 people · first shared 2016
- 9Fringe2 people · first shared 2017
- 10An Illustrated History of Objc_msgSend1 people · 55 points · first shared 2015 · 11 comments on HN
- 11Compare historical maps of Mars to the real thing1 people · 2 points · first shared 2020 · discussion on HN
- 12Index1 people · first shared 2016
- 13Objc explain objc msgSend stret1 people · first shared 2014
- 14Objc explain So you crashed in objc msgSend1 people · first shared 2014
- 15X86 mavericks1 people · first shared 2016
What HN people wrote when they linked it
btrask · 2016-05-06
If you are already familiar with high-level Objective-C, I would recommend looking at the headers for the language runtime. All of the inner workings are exposed as C functions you can play with. Also take a look at Mike Ash's blog, which dives into a lot of details: https://mikeash.com/pyblog/?tag=objectivec
Also: http://www.sealiesoftware.com/blog/archive/index.html
masklinn · 2024-05-08
Apple's been using that for more than a decade: https://www.mikeash.com/pyblog/friday-qa-2012-07-27-lets-build-tagged-… http://www.sealiesoftware.com/blog/archive/2013/09/24/objc_explain_Non…
OCaml's also been using tagging to mark unboxed type pretty much from the start, nearly 30 years ago: https://dev.realworldocaml.org/runtime-memory-layout.html#:~:text=OCam…
notbeuller · 2023-03-07
I ran into this one the other day[1] - similarly amusing iOS / macOS debugging (by the guy that wrote much of the modern objc runtime)
[1] http://www.sealiesoftware.com/blog/archive/2010/09/01/Dr_Gregory_Parke…
1over137 · 2022-07-27
That's my understanding too, and I believe you're referring Greg Parker:
http://www.sealiesoftware.com/valgrind/
int_19h · 2022-06-14
It's not just SQLite in macOS.
http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_i…
In general, I don't see how one could safely rely on a third-party library spawning or not spawning threads unless they explicitly make guarantees regarding not using them as part of their public contract.
saagarjha · 2020-06-24
Here's one optimization: http://sealiesoftware.com/blog/archive/2009/09/01/objc_explain_Selecto…
jrochkind1 · 2018-01-28
At first I remembered this and wondered if it was related:
"The rules for using Objective-C between fork() and exec() have changed in macOS 10.13. Incorrect code that happened to work most of the time in the past may now fail. Some workarounds are available."
http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_i…
But seems like no, actually, at least not obviously.
0x0 · 2017-12-13
There's some good info on that here:
"Dissecting objc_msgSend on ARM64"
https://www.mikeash.com/pyblog/friday-qa-2017-06-30-dissecting-objc_ms…
"Let's Build objc_msgSend"
https://www.mikeash.com/pyblog/friday-qa-2012-11-16-lets-build-objc_ms…
There's also the "Illustrated history of objc_msgSend", although it appears a bit dated, it has some nice commentary on the evolution of this very performance-critical part of the objective-c runtime:
http://sealiesoftware.com/msg/index.html
pavel_lishin · 2017-08-01
There's a github repo trying to rewrite it for the web: https://github.com/jackinloadup/lunatic-fringe
There's also this, which I vaguely remember working for me years ago, but can't vouch for now: http://www.sealiesoftware.com/fringe/
I have incredibly fond memories of playing Lunatic Fringe, despite being very bad at it, and despite catching a ridiculously bad case of strep throat one year shortly after discovering it, and having some bad, vaguely-related fever dreams about.
salgernon · 2017-08-01
I haven't tried this since the PPC days:
http://sealiesoftware.com/fringe/
Ben Haller still maintains a version of Satori and Rose for Mac OS X:
http://www.sticksoftware.com
corysama · 2016-12-06
For the under-the-hood details of message dispatch, see "An Illustrated History of objc_msgSend"
http://sealiesoftware.com/msg/index.html
pcwalton · 2016-05-26
> IDL operations are not particularly slow. Last I measured, a call from JS into C++ is between 10 and 40 CPU instructions of fixed overhead
To put that in perspective, that's the same number of instructions as objc_msgSend, which every Objective-C method call in native iOS or Mac apps goes through [1]. "The DOM is slow compared to native" is a common meme, but it's not that simple.
[1]: http://sealiesoftware.com/msg/x86-mavericks.html
panic · 2016-05-20
Objective-C (and Swift) don't have the fragile base class problem: http://www.sealiesoftware.com/blog/archive/2009/01/27/objc_explain_Non…
bdash · 2015-09-01
The vtable-based dispatch (described in detail at http://www.sealiesoftware.com/blog/archive/2011/06/17/objc_explain_obj… is no longer in use.
micampe · 2014-12-09
The calling conventions are described here https://developer.apple.com/library/ios/technotes/tn2239/ with links to more in depth descriptions and other useful informations.
This article has some more good tips on extracting information from those registers. http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_…
Osmium · 2014-10-20
It's a bit more complicated than that. There's a really good discussion here:
http://www.sealiesoftware.com/blog/archive/2013/09/24/objc_explain_Non…
and here:
https://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and-you.html
Basically, as I understand it, 64-bit pointers on iOS can actually act to decrease memory pressure because the extra bits can be used to store object class information that would otherwise have to be stored separately.
simscitizen · 2014-10-08
The man behind Objective-C these days (and for the past decade plus) is this guy: http://www.sealiesoftware.com/blog/.
chc · 2014-04-09
It's not that easy. I mean, just sending a message could entail one of objc_msgSend, obj_msgSend_stret or objc_msgSend_fpret, and which one you want to use is not always as clear-cut as you might prefer (http://www.sealiesoftware.com/blog/archive/2008/10/30/objc_explain_obj… And then there's the hassle of defining classes dynamically, which entails six function calls just to create a class with one empty method, and one of those essential functions is not actually provided for you AFAIK unless you're using Apple's compiler where it's a builtin, so you'll need to write it yourself.
It's not ridiculously hard, but it's somewhat less easy than normal C FFI.
bri3d · 2026-03-03
I'm very familiar with CFG flattening and other obfuscation techniques, thanks.
That's interesting; I suppose I must not have touched the parts of the platform that use them, and I've touched a fair amount of the platform.
Again, I _have_ seen plenty of obfuscation techniques in DRM/FairPlay, but otherwise I have not, and again, I am entirely sure the ANE toolchain from CoreML down through Espresso and into AppleNeuralEngine.framework definitely does not employ anything I would call an obfuscation technique.
> Ever wonder why Apple stopped shipping system frameworks as individual .dylib files?
If the dyld cache was supposed to be an obfuscation tool, shipping the tools for it as open source was certainly... a choice. Also, the reason early tools couldn't preserve selector information was selector uniqueing, which was an obvious and dramatic performance improvement and explained fairly openly, for example - http://www.sealiesoftware.com/blog/archive/2009/09/01/objc_explain_Sel… . If it was intended to be an obfuscation tool, again it was sort of a baffling one, and I just don't think this is true - everything about the dyld cache looks like a performance optimization and nothing about it looks like an obfuscator.
krackers · 2024-08-23
Dyld (dynamic linker) does this I think, it's effectively similar to other relocations. Each dynamic library brings its own set of selectors (I just think of them as strings in the data section of the binary, referenced indirectly via a pointer in the objc_selrefs section of the binary which can be updated as needed) and at runtime they're uniqueified.
See https://www.sealiesoftware.com/blog/archive/2009/09/01/objc_explain_Se… and https://www.mulle-kybernetik.com/weblog/2015/mulle_objc_selectors_are_…
I actually can't find much authoritative discussion about this on the internet, just those two posts. But since the objc-runtime is open source, you can probably find it there. I think it might be this method?
https://github.com/opensource-apple/objc4/blob/cd5e62a5597ea7a31dccef0…
--
But I'm not sure what GP meant by "at compilation". I suppose the compiler could be smart by reading the selectors of any shared libraries you link against and avoid duplicates in _your_ binary, but that wouldn't work for two shared libraries that know nothing about each other nor anything mapped in via dlopen.
davemp · 2019-04-13
Top three replies to the PS thread:
> . . . It's a miserable language, full of unexpected behaviors and badly designed features. . .
> I haven't met a single person who likes PowerShell. It's perhaps the textbook example of ugly design that looks technically consistent but utterly unfriendly and mind bogglingly verbose. . .
> PowerShell is one of the few bits of software which has actually made me throw a computer in anger. The idea has potential but the implementation is just bad. . .
No one is really looking into his IC but the thread is not positive. I have no idea who contributed what, but I’m not sure anyone would want to claim part of the credit for powershell.
——
Here’s a thread for man behind AMD’s zen architecture: https://news.ycombinator.com/item?id=14989551
First comment:
> Zen is the work of a huge team of talented engineers. To single one out as "the man behind Zen" seems very wrong. . .
——
The man behind objective-c: https://news.ycombinator.com/item?id=8422695
Second comment:
> The man behind Objective-C these days (and for the past decade plus) is this guy: http://www.sealiesoftware.com/blog/
——
For the other threads I saw, some were actually individual efforts, others were just ignoring “the man behind” and talking about the tech. Changing my search to “woman behind”, I saw no comments disparaging the level of contribution.
EDIT: I’m also by no means justifying the vitriol in the black hole thread or the harassment. Just doing some legwork.
jackjeff · 2013-05-15
Security
http://krebsonsecurity.com
http://www.schneier.com
http://www.lightbluetouchpaper.org
http://www.thoughtcrime.org/blog/
Apple
http://www.marco.org
http://daringfireball.net
http://www.mondaynote.com
http://reverse.put.as
Programming
http://blog.barthe.ph
http://herbsutter.com
http://thedailywtf.com
http://www.sealiesoftware.com/blog/
http://mrale.ph
Other
http://torrentfreak.com
http://googleresearch.blogspot.co.uk