Re: [swift-dev] Thread safety of weak properties

2015-12-12 Thread Kevin Ballard via swift-dev
On Fri, Dec 11, 2015, at 07:00 AM, Mike Ash via swift-dev wrote: > > Increasing the inline size of weak references opens up the possibilities a > bit. I can think of at least four fixes: > > 1. Delete the zeroing, and otherwise leave things as-is. This extends the > life of the object husk (by

Re: [swift-dev] Thread safety of weak properties

2015-12-12 Thread Kevin Ballard via swift-dev
On Sat, Dec 12, 2015, at 12:01 AM, Kevin Ballard wrote: > Another possible fix is to just atomically load/store the Value pointer > itself (assuming all platforms Swift runs on supports lock-free atomic > pointers). This way if the object is deallocating, it would attempt an atomic > CAS on the

Re: [swift-dev] Thread safety of weak properties

2015-12-12 Thread Mike Ash via swift-dev
On Dec 12, 2015, at 3:29 AM, Kevin Ballard via swift-dev wrote: > > On Sat, Dec 12, 2015, at 12:01 AM, Kevin Ballard wrote: >> Another possible fix is to just atomically load/store the Value pointer >> itself (assuming all platforms Swift runs on supports lock-free atomic >> pointers). This wa

Re: [swift-dev] [stdlib] Array.description calls debugDescription on its contents

2015-12-12 Thread Brent Royal-Gordon via swift-dev
> Nobody should be using '.description' or '.debugDescription' directly > in any case. One should be using String(x) or String(reflecting: x), > because that works with any instances, including those cases when the > runtime will synthesize the string representation for you. It would similarly be

[swift-dev] Swift's code in VSCode

2015-12-12 Thread Piero Sabino via swift-dev
Is it possible develop swift's code into Visual Studio Code? Inviato da iPhone Piero Sabino ___ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev

Re: [swift-dev] Pointers vs. References?

2015-12-12 Thread Michael Gottesman via swift-dev
In general, we have not been particularly disciplined in this regard. I would suggest following what is being done locally in the file you are modifying, i.e. FuncDecl */TypeChecker & as per the LLVM style guide. Michael > On Dec 12, 2015, at 3:15 PM, Jacob Bandes-Storch via swift-dev > wrote

[swift-dev] [stdlib] Replace `.Some(x)` and `.None` by `x` and `nil`, respectively

2015-12-12 Thread Patrick Pijnappel via swift-dev
The standard library already predominantly uses the latter form but still contains regular usages of the former. For consistency and reduced clutter I'd propose to use the latter form throughout. The SIL for both forms is identical. Also Optional takes precedence over any other nil literal converti

Re: [swift-dev] Thread safety of weak properties

2015-12-12 Thread Chris Lattner via swift-dev
#3 sounds like a great approach to me. I agree with Kevin that if we keep the object husk approach that any use of a weak pointer that returns nil should drop any reference to a husk. -Chris > On Dec 11, 2015, at 7:00 AM, Mike Ash via swift-dev > wrote: > > 3. Borrow a bit from the weak poi

[swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Davide Italiano via swift-dev
Hi, I'm a FreeBSD developer who has been working on porting swift to FreeBSD. I'm at a point where with a local patch ( https://people.freebsd.org/~davide/swift/build_freebsd.diff ) to fix build errors I'm able to build the compiler itself on FreeBSD 11 (-CURRENT). The compiler itself seems to wor

Re: [swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Dmitri Gribenko via swift-dev
On Sat, Dec 12, 2015 at 8:29 PM, Davide Italiano via swift-dev wrote: > Hi, > I'm a FreeBSD developer who has been working on porting swift to FreeBSD. > I'm at a point where with a local patch ( > https://people.freebsd.org/~davide/swift/build_freebsd.diff ) to fix > build errors I'm able to buil

Re: [swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Davide Italiano via swift-dev
On Sat, Dec 12, 2015 at 11:45 PM, Dmitri Gribenko wrote: > On Sat, Dec 12, 2015 at 8:29 PM, Davide Italiano via swift-dev > wrote: >> Hi, >> I'm a FreeBSD developer who has been working on porting swift to FreeBSD. >> I'm at a point where with a local patch ( >> https://people.freebsd.org/~davide

Re: [swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Dmitri Gribenko via swift-dev
On Sat, Dec 12, 2015 at 9:09 PM, Davide Italiano wrote: > On Sat, Dec 12, 2015 at 11:45 PM, Dmitri Gribenko wrote: >> On Sat, Dec 12, 2015 at 8:29 PM, Davide Italiano via swift-dev >> wrote: >>> Hi, >>> I'm a FreeBSD developer who has been working on porting swift to FreeBSD. >>> I'm at a point

Re: [swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Davide Italiano via swift-dev
On Sun, Dec 13, 2015 at 12:22 AM, Dmitri Gribenko wrote: > On Sat, Dec 12, 2015 at 9:09 PM, Davide Italiano > wrote: >> On Sat, Dec 12, 2015 at 11:45 PM, Dmitri Gribenko >> wrote: >>> On Sat, Dec 12, 2015 at 8:29 PM, Davide Italiano via swift-dev >>> wrote: Hi, I'm a FreeBSD develop

Re: [swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Dmitri Gribenko via swift-dev
On Sat, Dec 12, 2015 at 9:26 PM, Davide Italiano wrote: > On Sun, Dec 13, 2015 at 12:22 AM, Dmitri Gribenko wrote: >> On Sat, Dec 12, 2015 at 9:09 PM, Davide Italiano >> wrote: >>> On Sat, Dec 12, 2015 at 11:45 PM, Dmitri Gribenko >>> wrote: On Sat, Dec 12, 2015 at 8:29 PM, Davide Italia

Re: [swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Davide Italiano via swift-dev
On Sun, Dec 13, 2015 at 12:26 AM, Davide Italiano wrote: > On Sun, Dec 13, 2015 at 12:22 AM, Dmitri Gribenko wrote: >> On Sat, Dec 12, 2015 at 9:09 PM, Davide Italiano >> wrote: >>> On Sat, Dec 12, 2015 at 11:45 PM, Dmitri Gribenko >>> wrote: On Sat, Dec 12, 2015 at 8:29 PM, Davide Itali

Re: [swift-dev] Porting swift to FreeBSD

2015-12-12 Thread Davide Italiano via swift-dev
On Sun, Dec 13, 2015 at 12:30 AM, Dmitri Gribenko wrote: > On Sat, Dec 12, 2015 at 9:26 PM, Davide Italiano > wrote: >> On Sun, Dec 13, 2015 at 12:22 AM, Dmitri Gribenko >> wrote: >>> On Sat, Dec 12, 2015 at 9:09 PM, Davide Italiano >>> wrote: On Sat, Dec 12, 2015 at 11:45 PM, Dmitri Gr

Re: [swift-dev] Allowing extensions of bound generic types

2015-12-12 Thread Jacob Bandes-Storch via swift-dev
Hi Doug, thanks for the response! There’s a path through TypeChecker::handleSILGenericParams() that you need > to consider, which is triggered when parsing SIL. It’s an odd case because > you get all of the generic parameter lists up front. I suspect you would > just always allow type parameters t