Skip to content

Instantly share code, notes, and snippets.

@svevang
Last active February 6, 2018 18:33
Show Gist options
  • Save svevang/3ce043b0eeba87eb2bf3da0c3771c868 to your computer and use it in GitHub Desktop.
Save svevang/3ce043b0eeba87eb2bf3da0c3771c868 to your computer and use it in GitHub Desktop.
Notes on Objective C runtime

Objective runtime

SICP

Reading up on the objective c runtime, the runtime uses something like what was described in SICP: 2.4.3 Data-Directed Programming and Additivity. Properties, ivars, and classes can be created dynamically at runtime, meaning that there is an abstraction built around the class name and the data (ivars, etc) that are associated with that class. At least the size of a object is not fixed at compile time.

There's some really good analysis of the Objc runtime here: https://www.mikeash.com/pyblog/friday-qa-2009-03-13-intro-to-the-objective-c-runtime.html

And of course with Rust being the preeminent "glue" code, theres a great implementation of the objc bindings here: https://github.com/SSheldon/rust-objc#declaring-classes

I started up on a new tool to print out some pretty graphs of the runtime here: https://github.com/svevang/objective-c-class-printer

with resulting visualization: http://blotzy.com/objc_runtime_plus_foundation.svg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment