On 06/09/2015 21:19, Quincey Morris wrote:

I'm getting that sinking Radar feeling too. But since I'm relatively new to Swift, I'm just holding out a vain hope that there's some sort of solution that's embarrassingly obvious to everyone else but me.

I’ve been thinking about the implications of this for a couple of days now. Of course, you should file a Radar if you see some compiler behavior that looks like it ought to work. But I think there’s a higher order problem that’s worth noting.

In my experience (which is to say, after a couple of months spent converting a fair-sized app from Obj-C to Swift), converting an Obj-C implementation to directly an “equivalent” Swift implementation is a lousy experience with poor results.

Yeah, don't worry about that; it's not my first port project.:) It's already been heavily redesigned in order to simplify the implementation, and there's lots of reworking to tie it into Swift's static typing. Ironically, it's trying to Swiftify it that's causing all the pain. I'd already be done if I'd just stuck to using a single glue class as a dumb 'implements all operations, whether appropriate or not' wrapper around the real mechanics (as the prototype does), rather than have the type system intelligently enforce the rules on which operations can be performed on what (which requires more complex class and protocol structures, and circular type references).

Anyway, I think this pretty much wraps it up: Swift's type system is not (yet?) as great as it ought to be (but that's maybe not surprising as the language is still not properly baked) and just isn't going to cooperate at this point. So I guess it's Plan B for now: forget about generics-based reusability, and just duplicate (ugh) all the base methods within the code-generated glues and put the correct signatures on those. What matters most is that the UX works; code purity will just have to wait.

Many thanks to all,

has
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to