• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Swift generics, circular type declarations, and segfaults, oh my!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift generics, circular type declarations, and segfaults, oh my!


  • Subject: Re: Swift generics, circular type declarations, and segfaults, oh my!
  • From: Jonathan Mitchell <email@hidden>
  • Date: Sun, 06 Sep 2015 22:20:16 +0100

> On 6 Sep 2015, at 21:19, Quincey Morris <email@hidden> wrote:
>
> 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. There are several waves of consequences from the attempt:
>
> 1. You struggle to find a Swift equivalent of your Obj-C code. It takes forever.
>
> 2. You find your equivalent code ends up wordier and somehow more "unfactored" than the Obj-C code, even though it is somehow “the same”. You hate using it.
>
> 3. You fiddle with the Swift implementation (leaving Obj-C behind, finally) to make it a bit more streamlined. It takes forever.
>
> 4. You crash the compiler AND SourceKit, because you’ve ventured into uncharted territory in order to hide an Obj-C-derived mess behind Swift syntax. You have to look for workarounds at least until the next Xcode beta.
>
Very interesting indeed. This is the sort of ‘from the trenches' report we need.

I did a few days work on my own fair substantially app with regard to Swift integration / conversion and made a reluctant gut instinct decision to stay with Obj-C (even though I really wanted to utilise Swift). There was just too much stuff (KVO, bindings etc) that didn’t feel like a good fit with Swift within an established project.

Jonathan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


References: 
 >Swift generics, circular type declarations, and segfaults, oh my! (From: has <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: Fritz Anderson <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: has <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: Quincey Morris <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: has <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: Quincey Morris <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: Charles Srstka <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: has <email@hidden>)
 >Re: Swift generics, circular type declarations, and segfaults, oh my! (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Swift generics, circular type declarations, and segfaults, oh my!
  • Next by Date: Getting a Popover's frame
  • Previous by thread: [postscript] Re: Swift generics, circular type declarations, and segfaults, oh my!
  • Next by thread: Re: Swift generics, circular type declarations, and segfaults, oh my!
  • Index(es):
    • Date
    • Thread