Tuesday, June 17, 2014

Swift: Objective-C Without the Smalltalk

David Owens II has some criticisms along this line that differ from those I mentioned before (via Christoffer Lernö):

Gone is the dynamic nature of ObjC; it has instead been replaced by a rigid, generic based type system. I know the world of C++, Java, and C# programmers have rejoiced. Myself, having worked in Visual Studio building tools for .NET and Windows developers for many years and leaving that for the world of Cocoa and ObjC, I am greatly saddened by this turn of events.

I do not think we got “ObjC without the C”, rather, we got something much more like C# that compiles on clang and bridges into Cocoa a bit haphazardly.


Yes, generics can be useful in particular cases. However, they are not helpful, ironically, in the generic use case. I would argue that simply sticking with a stronger-type base instead of fully type-safe and generic based language would have been a more pragmatic route to take.


I have to wonder, what is the pragmatic goal of Swift? From where I sit, it gets all of the defaults wrong because the defaults should have been about the interaction with the Cocoa API. Until there are native Swift versions of those, all of code looks and feels much messier and far less elegant than what we have today.

Christoffer Lernö:

I realize that it’s a vain hope that this bug report will be anything than summarily dismissed, but I feel I have to make the attempt nonetheless.


My conclusion is that dynamic dispatch must be a first class citizen in order to make Swift suitable for UI programming. Also, the generics must be much simplified and permissive in order to not obstruct and complicate the day-to-day programming work.

Update (2014-06-17): See more about the JSON example and also Edge Cases on Swift and C++ culture.

Update (2014-06-22): David Owens II has a further update on the JSON example.

3 Comments RSS · Twitter

I like ObjC and I like C++ - so I'm relatively neutral about Swift. But how am I supposed to classload without ugly hacks?

If you appreciate anagrams and do not really enjoy Swift so far:


[...] Is Swift ObjC without the Smalltalk? I think it’s a worry. However most of the Smalltalkish things seem still there to me. Although some things clearly don’t work. (Thus why Scripting Bridge and a few other technologies appear not to work) Hopefully this will change over the next year or so. As I said though, I’d really kill for Python’s iterators and yield in Swift.  [...]

Leave a Comment