Live data from Hacker News

Swift 5 Release Notes for Xcode 10.2

developer.apple.com

11–20 of 25 posts

Re: Swift 5 Release Notes for Xcode 10.2

#11
post #5

Swift matrix use looks pretty gross compared to Julia, R or Python (NumPy) https://developer.apple.com/documentation/accelerate/simd/wo... Is there an other way?

That's not Swift matrices. Swift hasn't defined a language-level numeric matrix type. That's a C library type imported into Swift.

You can alternatively import Python and use NumPy directly, as well as any other C library, or you can define numeric operations in Swift. (On the other hand, if you are using fixed-size 3x3 or 4x4 matrices, the simd_floatNxN types deliver vastly better performance than NumPy can. So it depends on what your goals are.)

Re: Swift 5 Release Notes for Xcode 10.2

#12

Very cool. App thinning seems to be the golden feature of Swift 5. I am dying for the day (if it ever comes) that UIKit and SpriteKit work natively with Linux and Windows frameworks, so that I can finally make Swift a daily driver.

ABI stability on Darwin is the big feature. That enables the Swift runtime + standard libraries to ship in the OS, which enables app thinning to strip them from apps going forward.

So faster load times and smaller app bundles!

Re: Swift 5 Release Notes for Xcode 10.2

#15
post #5

Swift matrix use looks pretty gross compared to Julia, R or Python (NumPy) https://developer.apple.com/documentation/accelerate/simd/wo... Is there an other way?

That's not Swift matrices. Swift hasn't defined a language-level numeric matrix type. That's a C library type imported into Swift. You can alternatively import Python and use NumPy directly, as well as any other C library, or you can define numeric operations in Swift. (On the other hand, if you are using fixed-size 3x3 or 4x4 matrices, the simd_floatNxN types deliver vastly better performance than NumPy can. So it d…

the point of using swift is to be faster than Python. if your computations are using numpy and most of your time is spent in these computations, passing through the python interpreter every time, it's going to have performance similar Python

Re: Swift 5 Release Notes for Xcode 10.2

#16
post #15

Earlier quoted context omitted.

That's not Swift matrices. Swift hasn't defined a language-level numeric matrix type. That's a C library type imported into Swift. You can alternatively import Python and use NumPy directly, as well as any other C library, or you can define numeric operations in Swift. (On the other hand, if you are using fixed-size 3x3 or 4x4 matrices, the simd_floatNxN types deliver vastly better performance than NumPy can. So it d…

the point of using swift is to be faster than Python. if your computations are using numpy and most of your time is spent in these computations, passing through the python interpreter every time, it's going to have performance similar Python

plus numpy is apparently 3x slower than pure simd optimized c++ with something like eigen. I was hoping to get something faster (than numpy, not eigen) with swift

Re: Swift 5 Release Notes for Xcode 10.2

#17

As someone who hasn't yet put in the time with swift, i get the sense that every version release of Swift includes a surprising amount of breaking changes. Are these edge cases that don't really effect anyone or does every Swift project you undertake basically cement itself into a swift version?

I had to make two changes to update from swift 4.2 to 5 and they were both trivial tweaks to fix warnings, rather than hard errors.

Each version up to 2 had a lot of language breaking changes, 3 had incredibly rough standard library changes, and everything since then has been about 5 minutes of work.

Re: Swift 5 Release Notes for Xcode 10.2

#18

Very cool. App thinning seems to be the golden feature of Swift 5. I am dying for the day (if it ever comes) that UIKit and SpriteKit work natively with Linux and Windows frameworks, so that I can finally make Swift a daily driver.

Yeah, UIKit and SpriteKit will never come to other platforms. They constitute part of iOS' and macOS' competitive advantage.

Swift's progress also has little to bear on that front as UIKit and SpriteKit are written in C, Objective-C, and C++; their use in Swift depends on Apple's Objective-C runtime which is not released as part of the non-macOS/iOS port of Swift for Linux.

Re: Swift 5 Release Notes for Xcode 10.2

#19
post #15

Earlier quoted context omitted.

That's not Swift matrices. Swift hasn't defined a language-level numeric matrix type. That's a C library type imported into Swift. You can alternatively import Python and use NumPy directly, as well as any other C library, or you can define numeric operations in Swift. (On the other hand, if you are using fixed-size 3x3 or 4x4 matrices, the simd_floatNxN types deliver vastly better performance than NumPy can. So it d…

the point of using swift is to be faster than Python. if your computations are using numpy and most of your time is spent in these computations, passing through the python interpreter every time, it's going to have performance similar Python

> the point of using swift is to be faster than Python

There are plenty of other compelling reasons to prefer Swift over Python such as its type system or its easy, somewhat native, integration with existing Swift, Objective-C, and C frameworks available for macOS, iOS, watchOS, and tvOS.

Speed isn't the only driver, and I'm sure not it's not "the [only] point".

Re: Swift 5 Release Notes for Xcode 10.2

#20

Very cool. App thinning seems to be the golden feature of Swift 5. I am dying for the day (if it ever comes) that UIKit and SpriteKit work natively with Linux and Windows frameworks, so that I can finally make Swift a daily driver.

Yeah, UIKit and SpriteKit will never come to other platforms. They constitute part of iOS' and macOS' competitive advantage. Swift's progress also has little to bear on that front as UIKit and SpriteKit are written in C, Objective-C, and C++; their use in Swift depends on Apple's Objective-C runtime which is not released as part of the non-macOS/iOS port of Swift for Linux.

To be fair, libobjc is open-source: https://opensource.apple.com/source/objc4/objc4-750.1/
Post reply on HN