Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    B

    Bill Bumgarner

    friday.com · Personal blog · on HN since 2008

    Bill Bumgarner is a former Apple engineer who writes about Objective-C internals, memory debugging, and runtime behavior.

    Visit blogHN submissions
    Mobile & AppleLanguages & CompilersSystems & Performance
    What HN says

    HN commenters repeatedly link his objc_msgSend series as a thorough explanation of how Objective-C messaging works, and list his blog among good Cocoa resources.

    Stats for nerds
    17HN people shared it
    7linked in comments
    104story points
    Apr 2014last shared
    2008people per year2014

    Top posts on HN

    1. 1
      Objc_msgSend(), instruction by instruction
      8 people · 47 points · first shared 2010 · 3 comments on HN
    2. 2
      Apple's Leopard Garbage Collector Now Open Source
      1 person · 28 points · first shared 2008 · 10 comments on HN
    3. 3
      Using Heapshot (OS X/iOS) to Find Undesirable Memory Growth
      1 person · 25 points · first shared 2011 · 1 comments on HN
    4. 4
      On Death and Taxes; Some Digital Tools to Make End-Of-Life Easier
      1 person · 2 points · first shared 2016 · Discussion on HN
    5. 5
      RetainCount is useless.
      1 person · 1 points · first shared 2011 · Discussion on HN
    6. 6
      Objective-C 2.0 Class Extensions Explained
      1 person · 1 points · first shared 2009 · Discussion on HN
    7. 7
      Bbum
      2 people · first shared 2011
    8. 8
      Objc msgsend tour part 3 the fast path
      1 person · first shared 2011
    9. 9
      Pyobjc 20 pyobjc in leopard
      1 person · first shared 2008
    10. 10
      Ios 4 3 imp implementationwithblock
      1 person · first shared 2013

    What HN people wrote when they linked it

    • rayinerJul 2013

      Practical example: objc_msgSend (which is called for every message send in an Obj-C program) is written in assembly so it can jump to the target method implementation without disturbing any caller-save/callee-save register state: http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-the-road-map (and also presumably because C won't guarantee that a tail call is actually compiled as a jump).

      Practical example: objc_msgSend (which is called for every message send in an Obj-C program) is written in assembly so it can jump to the target method implementation without disturbing any caller-save/callee-save register state: http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-the-road-map (and also presumably because C won't guarantee that a tail call is actually compiled as a jump).

      Assembly is more relevant today than it has been in awhile, largely because Intel has gone pretty gung-ho with vector instructions that compilers mostly can't figure out how to emit on their own.

      For example, say I want to convert an array of bytes into a bitmask such that every zero-valued byte is converted into a set bit. On a 64-bit system, you can do this 64-bytes at a time:

      unsigned long bits = 0;
      for(unsigned char i = 0; i < 64; ++i) {
      bits |= ((unsigned long)(bytes[i] == 0) << i);
      }

      This isn't a particularly efficient use of the CPU. If you've got a CPU that supports AVX2, you've got two very powerful instructions available to you: VPCMPEQB and VPMOVMSKB.…

    • leephillipsMay 2013

      Maybe not "daily", but very frequently: here is a small selection of some of the small sites on my newsblur newsfeed list: [0]

      http://www.jamesaltucher.com : Much self-pity, but also sometimes quite funny.

      http://www.astrobio.net/latestnews_rss/news.xml : Is there life on other planets?

      http://kaygun.tumblr.com/

      http://www.friday.com/bbum : Coding, hardware projects, generally interesting.

      http://bestyoucanbe.blogspot.com/ : Insights into the education system in regard to the raising of his neurologically non-typical son.

      http://blog.lmorchard.com

      http://ex-muslim.org.uk : Oppression of atheists in the Muslim world.

      http://clojurefun.wordpress.com : Clojure!

      http://scientopia.org/blogs/goodmath : Bad science, denialism.

      http://blog.willbenton.com : Music, logic, programming, etc.

      http://www.groklaw.net : Maybe not "small"; detailed analysis of important legal cases.

      http://hicksdesign.co.uk/journal : Web design.

      http://www.holovaty.com/ : "I'm co-creator and co-Benevolent Dictator For Life of the open-source Django Web framework"

      http://prometheus.med.utah.edu/~bwjones : Combines talented photography, photoessays, and study of the retina.

      http://lee-phillips.org : I regularly check my site to see if it's still working.

      http://chronicle.com/blogs/linguafranca : Language issues; can be amusing or stupid.

      http://freethoughtblogs.com/maryamnamazie : Freedom for women in the Muslim world.

      http://math-blog.com : Infrequently updated, but often…

    • eridiusJan 2013

      Yes, but if you message the subclass with the alias, only the superclass's method gets invoked, because the alias apparently contains the IMP of the superclass's method. Or it must, if what you said before is to be believed.

      This is pretty nasty, because it breaks the idea of message sends and subclass overrides of methods. There's two ways you could solve it:

      1. Set the IMP to a static function that looks up the method it should forward to and re-send the message there. This is hard to do in a manner that supports all arguments, and you'd need at least 2, possibly 3 versions anyway (one for regular, one for strret, and on some architectures, one for fpret). It would probably need to be written in assembly in order to forward the arguments.

      2. More recently (in iOS 4.3, and whatever the corresponding OS X release was), the runtime got a nice little function called imp_implementationWithBlock(). This takes a block and returns an IMP. Bill Bumgarner has a nice blog post about it (http://www.friday.com/bbum/2011/03/17/ios-4-3-imp_implementationwithblock/). You could use this function on every alias in order to invoke the correct method, passing along the correct arguments.

    • ootachiNov 2010

      According to the link you posted, that's over four times slower than C++ virtual method dispatch (and note that most method calls in ordinary C++ code are not virtual). Also, IMP caching is hardly easy and is quite fiddly: see for example the benchmark code in that link as well as [1].

      I highly recommend reading the tour of objc_msgSend [2]. It's very eye opening: for example, there's a cache scanning loop even in the fast case.

      [1]: http://www.mulle-kybernetik.com/artikel/Optimization/opti-3-imp-deluxe.html
      [2]: http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-the-road-map/

    • chcApr 2014

      Here are a couple of Stack Overflow answers that illustrate how you do it in Objective-C:

      http://stackoverflow.com/a/2573949

      http://stackoverflow.com/a/18689338

      If you're interested in the nitty-gritty of how objc_msgSend works, bbum from Apple wrote up a great low-level walkthrough a few years back: http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-the-road-map/

    • msbarnettOct 2011

      Awesome, I wasn't aware of that one.

      Other good ones I know of are the already mentioned Cocoa with Love

      http://cocoawithlove.com/

      Cocoa is my girlfriend

      http://www.cimgf.com/

      and bbum's weblog-o-matic

      http://www.friday.com/bbum/

    Related

    Mike Ashmikeash.com170 people

    I Do Not Agree to Your Terms

    Mike Ash
    Personal · last shared 2026
    Cocoa with Lovecocoawithlove.com69 people

    Objective-C's niche: why it survives in a world of alternatives

    Cocoa with Love
    Personal · last shared 2026
    Greg Parkersealiesoftware.com31 people

    An Illustrated History of objc_msgSend

    Greg Parker
    Personal · last shared 2026
    RoughlyDraftedroughlydrafted.com92 people

    Why is Google so hysterically hypocritical about Bing using its public data?

    RoughlyDrafted
    Personal · last shared 2025
    Shawn Blancshawnblanc.net48 people

    IPhone’s Misplaced Decline Button?

    Shawn Blanc
    Personal · last shared 2025
    Red Sweater Blogred-sweater.com47 people

    Mountain Lion quietly includes app blacklist and security restrictions

    Red Sweater Blog
    Personal · last shared 2020
    MacDaddymacdaddy.io16 people

    New Macbook Pro power efficiency and time remaining

    MacDaddy
    Personal · last shared 2025
    Bruce Tognazziniasktog.com168 people

    Apple R&D (1989): Mousing is faster than keyboarding, but users don't believe it

    Bruce Tognazzini
    Personal · last shared 2026