Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Chris Lattner via swift-evolution
SGTM! -Chris > On Jan 17, 2018, at 3:14 PM, Connor Wakamo wrote: > > > >> On Jan 12, 2018, at 11:02 PM, Chris Lattner > > wrote: >> >>> On Jan 12, 2018, at 6:22 PM, Connor Wakamo >> > wrote: >>> > The second case, and the one I’m mor

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Connor Wakamo via swift-evolution
> On Jan 13, 2018, at 2:18 PM, Erica Sadun wrote: > > On Jan 11, 2018, at 1:40 PM, Jonathan Hull via swift-evolution > mailto:swift-evolution@swift.org>> wrote: >> >> >>> On Jan 11, 2018, at 11:22 AM, Connor Wakamo via swift-evolution >>> mailto:swift-evolution@swift.org>> wrote: >>> >>> T

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Connor Wakamo via swift-evolution
> On Jan 13, 2018, at 8:20 AM, Karl Wagner wrote: > > > >> On 13. Jan 2018, at 03:22, Connor Wakamo via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> >> >>> On Jan 11, 2018, at 11:51 PM, Chris Lattner >> > wrote: >>> >>> On Jan 11, 2018, a

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-17 Thread Connor Wakamo via swift-evolution
> On Jan 12, 2018, at 11:02 PM, Chris Lattner wrote: > >> On Jan 12, 2018, at 6:22 PM, Connor Wakamo > > wrote: >> The second case, and the one I’m more worried about, is subclassing. If, for instance, you have the following: class FooView: UI

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-13 Thread Erica Sadun via swift-evolution
On Jan 11, 2018, at 1:40 PM, Jonathan Hull via swift-evolution wrote: > > >> On Jan 11, 2018, at 11:22 AM, Connor Wakamo via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> That’s very reasonable. I’ll update the proposal to use >> CustomPlaygroundConvertible (unless I or

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-13 Thread Erica Sadun via swift-evolution
Perhaps bring the three special case literals into this as well? (File, image, color) -- E > On Jan 9, 2018, at 4:53 PM, Ben Cohen via swift-evolution > wrote: > > Big +1 to this. Getting these types out of the standard library and into a > more suitable domain-specific framework, prior to d

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-13 Thread Karl Wagner via swift-evolution
> On 13. Jan 2018, at 03:22, Connor Wakamo via swift-evolution > wrote: > > > >> On Jan 11, 2018, at 11:51 PM, Chris Lattner > > wrote: >> >> On Jan 11, 2018, at 11:22 AM, Connor Wakamo > > wrote: > I don’t think we can change this t

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-12 Thread Chris Lattner via swift-evolution
> On Jan 12, 2018, at 6:22 PM, Connor Wakamo wrote: > >>> The second case, and the one I’m more worried about, is subclassing. If, >>> for instance, you have the following: >>> >>> class FooView: UIView, CustomPlaygroundRepresentable { >>> var playgroundRepresentation: Any { >>>

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-12 Thread Connor Wakamo via swift-evolution
> On Jan 11, 2018, at 11:51 PM, Chris Lattner wrote: > > On Jan 11, 2018, at 11:22 AM, Connor Wakamo > wrote: I don’t think we can change this to return `Any` instead of `Any?`. I think there are potentially cases where a developer might want to selec

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-11 Thread Chris Lattner via swift-evolution
On Jan 11, 2018, at 11:22 AM, Connor Wakamo wrote: >>> I don’t think we can change this to return `Any` instead of `Any?`. I think >>> there are potentially cases where a developer might want to selectively >>> opt-in to this behavior. >> >> Which cases? How important are they? > > I can thin

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-11 Thread Saagar Jha via swift-evolution
CustomPlaygroundRepresentationConvertible? Saagar Jha > On Jan 11, 2018, at 11:22, Connor Wakamo via swift-evolution > wrote: > > > >> On Jan 10, 2018, at 4:21 PM, Chris Lattner > > wrote: >> >>> On Jan 10, 2018, at 2:10 PM, Connor Wakamo >>

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-11 Thread Jonathan Hull via swift-evolution
> On Jan 11, 2018, at 11:22 AM, Connor Wakamo via swift-evolution > wrote: > > That’s very reasonable. I’ll update the proposal to use > CustomPlaygroundConvertible (unless I or someone else can come up with a > really good “Thing” for a name like CustomPlaygroundThingConvertible, as that >

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-11 Thread Connor Wakamo via swift-evolution
> On Jan 10, 2018, at 4:21 PM, Chris Lattner wrote: > >> On Jan 10, 2018, at 2:10 PM, Connor Wakamo > > wrote: >>> What is the use-case for a type conforming to this protocol but returning >>> nil? If there is a use case for that, why not have such an implementation

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Chris Lattner via swift-evolution
> On Jan 10, 2018, at 2:10 PM, Connor Wakamo wrote: >> What is the use-case for a type conforming to this protocol but returning >> nil? If there is a use case for that, why not have such an implementation >> return “self” instead? > > Riley and Saagar answered this down-thread, but to confirm

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Connor Wakamo via swift-evolution
> On Jan 10, 2018, at 2:34 PM, Saagar Jha wrote: > > > Saagar Jha > >> On Jan 10, 2018, at 14:10, Connor Wakamo > > wrote: >> >>> On Jan 10, 2018, at 12:39 PM, Saagar Jha >> > wrote: >>> >>> Well, in my experience performance issues ten

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Saagar Jha via swift-evolution
Saagar Jha > On Jan 10, 2018, at 14:10, Connor Wakamo wrote: > >> On Jan 10, 2018, at 12:39 PM, Saagar Jha > > wrote: >> >> Well, in my experience performance issues tend to come not from trying to >> display a single object, but when you have an aggregation of ma

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Connor Wakamo via swift-evolution
> On Jan 10, 2018, at 12:39 PM, Saagar Jha wrote: > > Well, in my experience performance issues tend to come not from trying to > display a single object, but when you have an aggregation of many objects. > For example, displaying one Int is pretty lightweight, as is an [Int] with a > handful

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Connor Wakamo via swift-evolution
> On Jan 10, 2018, at 1:58 AM, Ian Partridge wrote: > > On 9 January 2018 at 23:19, Connor Wakamo via swift-evolution > wrote: >> To that end, I am proposing the following: >> >> - Introduce a new protocol, CustomPlaygroundRepresentable, in the >> PlaygroundSupport library in Swift 4.1: >> >

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Connor Wakamo via swift-evolution
> On Jan 9, 2018, at 10:02 PM, Chris Lattner wrote: > > On Jan 9, 2018, at 3:19 PM, Connor Wakamo via swift-evolution > mailto:swift-evolution@swift.org>> wrote: >> Good afternoon, > > Hi Connor, > > Huge +1 for this proposal, I’m thrilled you’re cleaning this up. Couple of > detail questi

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Saagar Jha via swift-evolution
Well, in my experience performance issues tend to come not from trying to display a single object, but when you have an aggregation of many objects. For example, displaying one Int is pretty lightweight, as is an [Int] with a handful of elements, but displaying an [Int] with million elements is

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Chris Lattner via swift-evolution
> On Jan 10, 2018, at 10:10 AM, Riley Testut wrote: > > On Jan 9, 2018, at 10:02 PM, Chris Lattner via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > >> What is the use-case for a type conforming to this protocol but returning >> nil? If there is a use case for that, why not h

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Riley Testut via swift-evolution
> On Jan 9, 2018, at 10:02 PM, Chris Lattner via swift-evolution > wrote: > What is the use-case for a type conforming to this protocol but returning > nil? If there is a use case for that, why not have such an implementation > return “self” instead? I assumed it could be used if a type’s p

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Chris Lattner via swift-evolution
> On Jan 9, 2018, at 11:30 PM, Saagar Jha wrote: >> >> In short, can we change playgroundRepresentation to return Any instead of >> Any?. Among other things, doing so could ease the case of playground >> formatting Optional itself, which should presumably get a conditional >> conformance to t

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-10 Thread Ian Partridge via swift-evolution
On 9 January 2018 at 23:19, Connor Wakamo via swift-evolution wrote: > To that end, I am proposing the following: > > - Introduce a new protocol, CustomPlaygroundRepresentable, in the > PlaygroundSupport library in Swift 4.1: > > protocol CustomPlaygroundRepresentable { > /// Returns an alternate

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Saagar Jha via swift-evolution
Saagar Jha > On Jan 9, 2018, at 22:02, Chris Lattner via swift-evolution > wrote: > > On Jan 9, 2018, at 3:19 PM, Connor Wakamo via swift-evolution > mailto:swift-evolution@swift.org>> wrote: >> Good afternoon, > > Hi Connor, > > Huge +1 for this proposal, I’m thrilled you’re cleaning this

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Chris Lattner via swift-evolution
On Jan 9, 2018, at 3:19 PM, Connor Wakamo via swift-evolution wrote: > Good afternoon, Hi Connor, Huge +1 for this proposal, I’m thrilled you’re cleaning this up. Couple of detail questions: > >

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Connor Wakamo via swift-evolution
> On Jan 9, 2018, at 4:21 PM, Ben Rimmington wrote: > > Something like this was attempted (and reverted) for Swift 3: > > > >

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Ben Rimmington via swift-evolution
Something like this was attempted (and reverted) for Swift 3:

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Connor Wakamo via swift-evolution
Yes, it will — if a type does not conform to `CustomPlaygroundRepresentable`, PlaygroundLogger will continue to log it structurally. Connor > On Jan 9, 2018, at 3:56 PM, Saagar Jha wrote: > > I’ve just glanced through this, so I apologize if this was already addressed, > but will the default

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Saagar Jha via swift-evolution
I’ve just glanced through this, so I apologize if this was already addressed, but will the default behavior (i.e. that of something that doesn’t conform to CustomPlaygroundRepresentable) remain the same? Saagar Jha > On Jan 9, 2018, at 15:19, Connor Wakamo via swift-evolution > wrote: > > Go

Re: [swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Ben Cohen via swift-evolution
Big +1 to this. Getting these types out of the standard library and into a more suitable domain-specific framework, prior to declaring ABI Stability, will give us flexibility to evolve them appropriately over time. > On Jan 9, 2018, at 3:19 PM, Connor Wakamo via swift-evolution > wrote: > > G

[swift-evolution] [Proposal] Revamp the playground quicklook APIs

2018-01-09 Thread Connor Wakamo via swift-evolution
Good afternoon, In preparation for ABI stability, I’ve reviewed the API exposed by the standard library for providing customized “quick looks” in playgrounds. This is exposed as the PlaygroundQuickLook enum and the CustomPlaygroundQuickLookable protocol. The PlaygroundQuickLook has a handful of