Hacker News new | past | comments | ask | show | jobs | submit login
Understanding the Objective-C Runtime (2010) (cocoasamurai.blogspot.com)
76 points by beefhash on May 26, 2019 | hide | past | favorite | 11 comments



I like the way Objective-C made me "think different" compared to more straight C-syntax style languages like Java, PHP or even superficially JavaScript (ironically none of them actually had the C support level Objective-C had!). The quirky syntax, longDescriptiveMethodNames:andProperties: and the relatively flexible type system and run-time capabilities, a strange throwback to the 80's of a different fork from C.

It still makes me feel warm and fuzzy inside seeing it or doodling around with it.

But building applications outside of the ones that have heavy C(++) interop or do really weird stuff run-time I really don't miss working with it and moved almost completely to Swift's "it compiles, it works" capabilities.


> A C struct can't forward requests to perform a function onto other targets.

That'd be true if methods were called statically, but with dynamic linking this is no longer the case.

Also, obligatory reminder: much of the interface covered here is runtime implementation–don't mess with it! Some of the stuff mentioned is already outdated.


A lot of the information here is about the (relatively stable) hooks the objc runtime gives programmers into its internals. If you’re writing ffi code to interact with the objc runtime, a lot of the functions referenced here are reasonable to call directly in the interop layer


The functions the the runtime exposes are relatively stable API. It’s the implementation details and structure layouts that are subject to change.


I see the article is from 2010. Is that before or after Objective-C 2.0?


Objective-C 2.0 came with 64-bit, IIRC, so 10.6 should be using it.


Objective-C 2.0 was part of 10.5 in 2007. It’s not directly tied to 64-bit support. You’re thinking of features that require the “modern runtime” which is only available on 64-bit Mac. Those features came after ObjC 2.0.


You're right, I mixed those two up. That's a bit too far back for me :)


"Objective-C 2.0" was a marketing term for a bunch of features added in 10.5, some big (e.g. nonfragile ivars, garbage collection) others not so big (e.g. for..in loops, synthesized ivars). The language+runtime has evolved tremendously since then without a new marketing name. Generics and ARC were added, garbage collection and vtable dispatch have been removed.


It is very good.

I think the delay to execute and non-top down is the key feature of objective C, vs those so called objective languages. It is more Smalltalk and more flexible.

Still, any more updated one just in case the shift to llvm affect it say ...


Great read, but can this person please just use a grammar checker? Their inconsistent, but repetitive incorrect use of apostrophes ruins the whole post.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: