[swift-dev] Crash while compiling a getter

2016-03-19 Thread Pushkar N Kulkarni via swift-dev
Hello, I tried to implement NSOrderedSet.reversedOrderSet with this code:/*@NSCopying*/ public var reversedOrderedSet: NSOrderedSet {        return NSOrderedSet.init(array: _orderedStorage.reversed())}I'm not sure about the correctness/performance of that implementation, but I see a crash while bui

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - OS X (master) #2761

2016-03-19 Thread Ted kremenek via swift-dev
I completely agree. > On Mar 16, 2016, at 10:33 PM, Chris Lattner via swift-dev > wrote: > > IMO, we should remove/disable this test unless it can be “really” fixed. It > is unacceptable to have a test that we know injects noise into our CI > systems. Having to second guess whether failures

Re: [swift-dev] missing tag

2016-03-19 Thread Drew Crawford via swift-dev
Would it be appropriate to tag https://github.com/apple/swift-compiler-rt ? Drew > On Feb 5, 2016, at 4:41 PM, Mishal Shah wrote: > > Sorry for the trouble, hopefully now all of the repos have > swift-DEVELOPMENT-SNAPSHOT-2016-02-03-a: > > https:

Re: [swift-dev] Building swift-llvm fails when using build-script to cross compile due to multiple -isysroot arguments being in CFLAGS

2016-03-19 Thread ChrisBieneman via swift-dev
> On Mar 19, 2016, at 4:30 PM, Vedant Kumar wrote: > > >> On Mar 19, 2016, at 12:05 PM, ChrisBieneman wrote: >> >> [Adding Vedant directly] >> >> I'm not super familiar with the swift build scripts, but I have a theory of >> what is going wrong. I think the problem is that compiler-rt is b

Re: [swift-dev] Building swift-llvm fails when using build-script to cross compile due to multiple -isysroot arguments being in CFLAGS

2016-03-19 Thread Vedant Kumar via swift-dev
> On Mar 19, 2016, at 12:05 PM, ChrisBieneman wrote: > > [Adding Vedant directly] > > I'm not super familiar with the swift build scripts, but I have a theory of > what is going wrong. I think the problem is that compiler-rt is being built > during the cross build, and it really shouldn't be.

Re: [swift-dev] [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Will Stanton via swift-dev
Hello Brent, Thanks for pointing it out - obvious now! Regards, Will Stanton > On Mar 19, 2016, at 6:43 PM, Brent Royal-Gordon via swift-dev > wrote: > > Actually, the code samples I gave you *do* subtly depend on > underestimatedCount being an underestimate, because the initial fast loop >

[swift-dev] Advice on SR-580?

2016-03-19 Thread Timothy Wood via swift-dev
Looking through the ‘StarterBug’ tag, I started looking into >, in which: func foo(x: Int) -> Int { var result = x + 1 #if NOT_ENABLED _ = result #endif return result } does not warn that “result" was never written t

Re: [swift-dev] [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Brent Royal-Gordon via swift-dev
> You gave cases for which `underestimatedCount()` is used: >> For sequences with easily-calculated counts, this should give us a size >> that's just right. For sequences where they can kind of estimate the right >> count (for instance, if you're decoding a fixed-size buffer of UTF-8 bytes, >> a

Re: [swift-dev] [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Will Stanton via swift-dev
Hello Brent, Thanks kindly for the flair! You gave cases for which `underestimatedCount()` is used: > For sequences with easily-calculated counts, this should give us a size > that's just right. For sequences where they can kind of estimate the right > count (for instance, if you're decoding a

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Greg Parker via swift-dev
> On Mar 16, 2016, at 1:42 PM, Brent Royal-Gordon > wrote: > > This is damned clever. > >> * Allows inexpensive per-object storage for future features like associated >> references or class extensions with instance variables. > > It sounds like you wouldn't be able to resize an out-of-band r

Re: [swift-dev] Building swift-llvm fails when using build-script to cross compile due to multiple -isysroot arguments being in CFLAGS

2016-03-19 Thread ChrisBieneman via swift-dev
[Adding Vedant directly] I'm not super familiar with the swift build scripts, but I have a theory of what is going wrong. I think the problem is that compiler-rt is being built during the cross build, and it really shouldn't be. The compiler-rt build system has some significant flaws, and it is

Re: [swift-dev] Developing Swift in Xcode

2016-03-19 Thread Greg Parker via swift-dev
> On Mar 16, 2016, at 1:54 PM, Kenny Leung via swift-dev > wrote: > > This is working for me now using > >utils/build-script -x — —reconfigure > > It takes over an hour to build because it doesn’t seem to be as parallel as > the ninja build (less than 3x parallel vs 8x parallel). > > Th

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - OS X (master) #2761

2016-03-19 Thread Ben Langmuir via swift-dev
I was tired of seeing and writing these emails: commit 24f685c1d29cd926b1674e099bfcca6ed8673491 Author: Ben Langmuir Date: Wed Mar 16 10:36:02 2016 Decrease the probability that stdlib/Hashing.swift will fail Bump the number of trials from 10 to 14, which makes the test orders of

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Greg Parker via swift-dev
> On Mar 15, 2016, at 11:59 PM, Greg Parker via swift-dev > wrote: > > I am considering a new representation for Swift refcounts and other > per-object data. This is an outline of the scheme. Comments and suggestions > welcome. > > Today, each object stores 64-bits of refcounts and flags aft

Re: [swift-dev] Building swift-llvm fails when using build-script to cross compile due to multiple -isysroot arguments being in CFLAGS

2016-03-19 Thread Andrew Hyatt via swift-dev
(From /u/thegreatbeanz on reddit.com/r/swift ) So the problem here is actually that something has gone horribly wrong when configuring compiler- rt. You'll notice in the clang commands that it is building in this directory: clang_rt.builtins_armv7_10.4.dir What that mea

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread John McCall via swift-dev
> On Mar 15, 2016, at 11:59 PM, Greg Parker via swift-dev > wrote: > I am considering a new representation for Swift refcounts and other > per-object data. This is an outline of the scheme. Comments and suggestions > welcome. There are a lot of really good ideas. I would like to see some quas

[swift-dev] Building swift-llvm fails when using build-script to cross compile due to multiple -isysroot arguments being in CFLAGS

2016-03-19 Thread Andrew Hyatt via swift-dev
Building swift-llvm fails when using build-script to cross compile because build-script wrongly gives duplicate -isysroot arguments. The full arguments that are given to clang by build-script while building LLVM are here: https://gist.github.com/ahyattdev/8ecc5d3808b9ee543a60 The command I use

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Greg Parker via swift-dev
> On Mar 16, 2016, at 2:23 PM, John McCall wrote: > >> On Mar 15, 2016, at 11:59 PM, Greg Parker via swift-dev >> wrote: >> I am considering a new representation for Swift refcounts and other >> per-object data. This is an outline of the scheme. Comments and suggestions >> welcome. > > Ther

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Joe Groff via swift-dev
> On Mar 16, 2016, at 4:08 PM, Greg Parker wrote: > > >> On Mar 16, 2016, at 9:25 AM, Joe Groff wrote: >> >> This sounds awesome. Should we still consider using a non-pointer isa >> representation on 64 bit platforms? 16 bytes per object header is still >> kinda big. If we laid out the np-i

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Brent Royal-Gordon via swift-dev
This is damned clever. > * Allows inexpensive per-object storage for future features like associated > references or class extensions with instance variables. It sounds like you wouldn't be able to resize an out-of-band refcount allocation once it's been created, though, right? There are pointe

[swift-dev] Why no FloatingPointArithmeticType and DefaultInitializable protocols in stdlib?

2016-03-19 Thread Jens Persson via swift-dev
Is there a reason why the standard library does not have a protocol like IntegerArithmeticType but for floating point types? Also, I don't know how many times I've found the need for this: protocol DefaultInitializable { init() } Yet there's nothing like that in the stdlib. Any particular reason

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Arnold Schwaighofer via swift-dev
I think maybe we also want to measure how a cmpxchg vs lck;add solution performs under contention. Objects in read only state (be it cow’ed value types or not) might be shared between threads with the expectation that they are fast, i.e. the argument if retain/release are contented something el

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Greg Parker via swift-dev
> On Mar 16, 2016, at 9:25 AM, Joe Groff wrote: > > This sounds awesome. Should we still consider using a non-pointer isa > representation on 64 bit platforms? 16 bytes per object header is still kinda > big. If we laid out the np-isa bits so that the "side allocation" bit were > the MSB, and

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - OS X (master) #2761

2016-03-19 Thread Jordan Rose via swift-dev
Unrelated and harmless: this test is probabilistic. > On Mar 16, 2016, at 10:00 , no-re...@swift.org wrote: > > [FAILURE] oss-swift-incremental-RA-osx [#2761] > > Build URL:https://ci.swift.org/job/oss-swift-incremental-RA-osx/2761/ >

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Greg Titus via swift-dev
> On Mar 16, 2016, at 1:42 PM, Brent Royal-Gordon via swift-dev > wrote: > > This is damned clever. Yes, I agree! >> The MSB bit also becomes set if you increment or decrement a retain count >> too far. That means we can implement the RR fast path with a single >> conditional branch after t

Re: [swift-dev] Advice on SR-580?

2016-03-19 Thread Greg Titus via swift-dev
Tim, FWIW, I think that one got incorrectly marked as a starter bug. I don’t think the bug is fixable as written. You are right about the immediate cause, and I think that the only thing we _can_ do is mark it conservatively, because that part of the code isn’t type-checked at all, and probably

Re: [swift-dev] Developing Swift in Xcode

2016-03-19 Thread Jordan Rose via swift-dev
> On Mar 14, 2016, at 14:05 , Ryan Lovelett via swift-dev > wrote: > > On Mon, Mar 14, 2016, at 04:54 PM, Ben Langmuir via swift-dev wrote: >> >>> On Mar 14, 2016, at 1:51 PM, Kenny Leung via swift-dev >>> wrote: >>> >>> Hi Ben. >>> >>> Argghh! >>> >>> Question: why generate Xcode project

Re: [swift-dev] [Discussion] New refcount representation

2016-03-19 Thread Brent Royal-Gordon via swift-dev
>> I take it the refcount field's pointer is itself considered a weak >> reference, so the weak refcount starts +1 like the unowned refcount does? > > You need to do something to make sure the side allocation is not freed if the > object is live with no weak references to it. Biasing the weak re

[swift-dev] Cross compilation for linux failed on Mac

2016-03-19 Thread Труб Илья via swift-dev
Dear colleagues, It seems to me, something was happened with cross-compilation on MacOS. I have successfully built all libraries for 32-bit ARM architecture and then built applications and libraries on Ubuntu 15 with x86_64 Swift compiler, pointing out --target=armv7-unknown-linux-gnueabi and pl

[swift-dev] @_specialize attribute

2016-03-19 Thread Andrew Trick via swift-dev
I'd like to let people know that I'm introducing an @_specialize(...) function attribute. See https://github.com/apple/swift/pull/1725 . Feedback is welcome. Just keep in mind that for now this is only an internal attribute. It is not yet a language change

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - OS X (master) #2761

2016-03-19 Thread Chris Lattner via swift-dev
IMO, we should remove/disable this test unless it can be “really” fixed. It is unacceptable to have a test that we know injects noise into our CI systems. Having to second guess whether failures are “real” or not undermines their value, and we should continue to stomp out any nondeterminism fr

Re: [swift-dev] Swift Playground

2016-03-19 Thread Jordan Rose via swift-dev
Hi, Tysun. I'm afraid playgrounds are still considered an Xcode feature, not part of the Swift open source project. Requesting support for watchOS should be filed as a Radar (bugreport.apple.com). Best, Jordan > On Mar 14, 2016, at 15:16 , Maclachlan Tysun via swift-dev > wrote: > > Good eve

Re: [swift-dev] Developing Swift in Xcode

2016-03-19 Thread Kenny Leung via swift-dev
This is working for me now using utils/build-script -x — —reconfigure It takes over an hour to build because it doesn’t seem to be as parallel as the ninja build (less than 3x parallel vs 8x parallel). The resulting project doesn’t work in Xcode 7.2.1, but works fine in Xcode 7.3 beta. I c