Performance These Days
Most of the other comments point out the idiosyncrasies of the article but I think most of the commentators are missing the point behind the author&#x27;s basic frustration. While Chris Lattner is a brilliant system&#x27;s programmer, the work he and his team did with Swift shows their focus on systems type programming. As the author points out, Objective-C was actually a _brilliant_ language for GUI&#x27;s and application design. It was hampered by C syntax cruft (easily remedied), but the proof is that Objective-C and the Cocoa Framework has had one of the best (IMHO) successes for any GUI toolkit and desktop framework.<p>Consider that Obj-C survived transitions from desktop to mobile apps, and many of the features such as modern email viewers with embedded image viewing were accomplished on NeXT long before Windows had comparable features. I think Steve Jobs realized this which was his particular genius -- choosing the right tech and focusing it with a &quot;marketing&quot; angle [8]. I think the newer shift toward Swift at Apple shows a focus on &quot;systems&quot; type of thinking, but unfortunately I&#x27;ve also notice a certain decline in application quality -- i.e. Safari search bar crashing on OS X and iOS [2].<p>If I had to speculate, I&#x27;d say the success of many of Apple&#x27;s UI were due to the SmallTalk aspects of Objective-C which focused on message passing instead of eager function binding and C++ style inheritance. Having written my own low level object system in C and LLVM for an XML processing language, my take is that while having similar intent to implement dynamic dispatching, the emphasis shift between message-passing vs virtual-tables forces a slightly different style of library and framework composition. Essentially message passing is more expressive but sacrifices potential speed, but as Wikipedia describes it:<p>&gt; Because a type can have a chain of base types, this look-up can be expensive. A naive implementation of Smalltalk&#x27;s mechanism would seem to have a significantly higher overhead than that of C++ and this overhead would be incurred for each and every message that an object receives. Real Smalltalk implementations often use a technique known as inline caching[3] that makes method dispatch very fast. Inline caching basically stores the previous destination method address and object class of the call site (or multiple pairs for multi-way caching). The cached method is initialized with the most common target method (or just the cache miss handler), based on the method selector. -- <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dynamic_dispatch" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dynamic_dispatch</a><p>However, practically speaking cache inlining can allow the language implementation to be more expressive and forgiving -- a failed method lookup can be forwarded to an &quot;unknown handler&quot; method as in Ruby&#x27;s `method_missing` unlike in C++ [3], or the situation in Swift (?) [4].<p>Basically, Haskell et al have made tremendous strides in progressing type theory and corresponding practical implementation of functional style programming with monadic theory and similar, we&#x27;re still not sophisticated enough to basically provide easily expressive statically type code which still gives the full expressiveness of dynamic languages. Humans are _really_ good at reasoning about systems of communicating components (message passing, overlapping the actor models of computation) but really not as good at category theory, which while mathematically equivalent don&#x27;t necessary make them as good for programming large, untyped information that&#x27;s present in most modern GUI&#x27;s. Thing&#x27;s like React however make a huge stride forward in some aspects in that regard. Though I&#x27;d rather program that in JavaScript (another prototype based language borrowing from the message passing tradition) than in Swift&#x2F;C++ style languages which essentially force type checking at a lower level while more complex higher abstractions remain un-type checked. So all the work of the type system while not getting benefit for higher abstractions (e.g. User clicks button which sets system into X state). I&#x27;m branching out quite a bit, but it&#x27;s actually quite a complex problem and is still very much an &quot;open problem&quot;, although one we&#x27;re getting closer to solving well. For clearer examples of what I&#x27;m talking about see some of these type of papers I found with a quick search: [5], [6]. My take is that the author is talking about a language more oriented toward system-architecting, an example approach like that taken by Ceylon [7].<p>[1]: <a href="http:&#x2F;&#x2F;arstechnica.com&#x2F;apple&#x2F;2005&#x2F;12&#x2F;2221&#x2F;" rel="nofollow">http:&#x2F;&#x2F;arstechnica.com&#x2F;apple&#x2F;2005&#x2F;12&#x2F;2221&#x2F;</a>
[2]: <a href="http:&#x2F;&#x2F;www.bbc.com&#x2F;news&#x2F;technology-35420573" rel="nofollow">http:&#x2F;&#x2F;www.bbc.com&#x2F;news&#x2F;technology-35420573</a>
[3]: <a href="https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;Respond_to_an_unknown_method_call#C.2B.2B" rel="nofollow">https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;Respond_to_an_unknown_method_ca...</a>
[4]: <a href="https:&#x2F;&#x2F;github.com&#x2F;rodionovd&#x2F;SWRoute&#x2F;wiki&#x2F;Function-hooking-in-Swift" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rodionovd&#x2F;SWRoute&#x2F;wiki&#x2F;Function-hooking-i...</a>
[5]: <a href="https:&#x2F;&#x2F;pdfs.semanticscholar.org&#x2F;8a42&#x2F;9baf82c17a936801de4e37b8bd6b5c9e077e.pdf" rel="nofollow">https:&#x2F;&#x2F;pdfs.semanticscholar.org&#x2F;8a42&#x2F;9baf82c17a936801de4e37...</a>
[6]: <a href="http:&#x2F;&#x2F;lambda-the-ultimate.org&#x2F;node&#x2F;5329" rel="nofollow">http:&#x2F;&#x2F;lambda-the-ultimate.org&#x2F;node&#x2F;5329</a>
[7]: <a href="http:&#x2F;&#x2F;ceylon-lang.org" rel="nofollow">http:&#x2F;&#x2F;ceylon-lang.org</a>
[8]: <a href="http:&#x2F;&#x2F;www.infoq.com&#x2F;news&#x2F;2011&#x2F;10&#x2F;steve-jobs-contribution" rel="nofollow">http:&#x2F;&#x2F;www.infoq.com&#x2F;news&#x2F;2011&#x2F;10&#x2F;steve-jobs-contribution</a>