Live data from Hacker News

Swift 3.1 Released

swift.org

51–60 of 71 posts

Re: Swift 3.1 Released

#51
post #48

Earlier quoted context omitted.

> I regularly lose syntax coloring. Yep. Happens to me all the time too. Make some changes to code, then wait half a second of the syntax coloring to take effect. How this is not instant boggles the mind. Maybe it's related to SourceKitService which randomly decides start taking up 100% CPU for no discernible reason.

SourceKit itself is fairly stable. However it embeds a copy of the Swift type checker. :-)

It's certainly stable, it just likes to take up 100% of the CPU.

It happens especially when writing new code or refactoring old code in a medium sized project and using function or variable names that don't yet exist but that I'm about to add in the next few minutes.

For example say I want take a chunk of code and move it to a new function fooBar. So I cut the old code and then replace it with a call to a not yet written fooBar function.

Then I go to write the definition of fooBar and paste previous code in there but before I can do that, SourceKitService has got itself into a CPU frenzy that won't calm down for 15-20 minutes (even after finishing writing the fooBar function) while it presumably tries to find where fooBar was defined.

It's gotten to the point where I have disabled 'live issues' (which seems to exacerbate the problem) and regularly have to kill the SourceKitService process so my fans will go back to normal.

Re: Swift 3.1 Released

#52
Would really be nice if it could offer generic linux binaries... this ubuntu only development approach is quite aggravating. I don't mind a big download, why not just bundle your LLVM changes and package it all in a single download?

Re: Swift 3.1 Released

#53
post #37

Earlier quoted context omitted.

Why do you feel it's painful? I've only written a tiny desktop menu bar app with it, but I liked the clean look of it and it didn't feel so cramped like Visual Studio. Maybe I just don't have written with it enough.

I can honestly say that Xcode is the worst piece of software I have ever used. It's incredibly slow, it has always been riddled with bugs, it has crashed on me more often than any other software, and it is lacking so much functionality that it doesn't deserve to be called an IDE at all. For instance, it can't even rename a Swift function years after Swift's introduction.

You should give Android Studio a try, you will no longer complain about XCode being slow.

Re: Swift 3.1 Released

#54

Earlier quoted context omitted.

You can download a 3.1 development snapshot. I'm not involved in preparing the official releases but I'm assuming the Linux 3.1 release will be very close to what is in swift-3.1-branch now. And all the action these days is on the master branch so if you're on Linux and want to help us squash regressions you should periodically test your codebase with master snapshots.

At this stage, I'm more interested in properly packaging it (for a non-Ubuntu distribution), than compiler development itself. Not having at least tags for the release is very unusual, especially given the title of this article ;). As it is composed from multiple packages, there are too many moving parts than may or may not fit together. It would be great, if there was a tag+source tarball for each release. I'm sure…

There is a tag for the release, called swift-3.1-RELEASE:

https://github.com/apple/swift/tree/swift-3.1-RELEASE

It's not showing up on GitHub's UI nor search for me at present, which may be why it seems like it's missing.

You can download a .tgz from GitHub but bear in mind that you have to do the same for each of the nested repositories as well. If you're building it for yourself, it's easier to download the swift-3.1-RELEASE content, and then run 'utils/update-checkout --clone --skip-history --tag swift-3.1-RELEASE' to procure the rest of the repositories.

There are a number of bugs to work on Swift packages for RHEL/CentOS:

https://bugs.swift.org/browse/SR-100

https://bugs.swift.org/browse/SR-108

https://bugs.swift.org/browse/SR-116

The issues are primarily around those operating systems having too old a version of Clang in their default repositories to be able to bootstrap the newer builds, and the fact that they don't have the blocks runtime available, both of which are used by the Swift runtime.

Re: Swift 3.1 Released

#55
post #16

Does anyone know where the new Linux binaries are? The release announcement links to https://swift.org/download , but I can't actually find the 3.1 binaries anywhere.

They have since been published at the above link:

https://swift.org/builds/swift-3.1-release/ubuntu1610/swift-...

https://swift.org/builds/swift-3.1-release/ubuntu1604/swift-...

https://swift.org/builds/swift-3.1-release/ubuntu1404/swift-...

Re: Swift 3.1 Released

#56
post #21

Used objc a bit; never used swift. Question about this signature: func drop(while predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Self.SubSequence I take it the "throws" on the type of predicate means it can 'throw/return' an error. Why would you do this? Why not just require your predicate function to be able to process any element? Or I am confused? It seems like the equivalent in Go, for example, wo…

> I take it the "throws" on the type of predicate means it can 'throw/return' an error. Why would you do this? Why not just require your predicate function to be able to process any element?

Because otherwise you can't use partial functions as predicates which is an unnecessary an oft annoying limitation, in my experience it's one of the biggest pains in the ass in Java and a major reason why its checked exceptions system was unusable: you couldn't create "transparent" functions (and interfaces) with respect to CE.

> It seems like the equivalent in Go, for example, would be something like this

`rethrows` is a transitive property, if the predicate is not a throwing function, the HoF isn't one either. So you'd need two functions in Go. And then `drop` works on a more abstract concept than concrete array slices ("Sequence" is what many other languages would call an iterable).

Re: Swift 3.1 Released

#57
post #54

Earlier quoted context omitted.

At this stage, I'm more interested in properly packaging it (for a non-Ubuntu distribution), than compiler development itself. Not having at least tags for the release is very unusual, especially given the title of this article ;). As it is composed from multiple packages, there are too many moving parts than may or may not fit together. It would be great, if there was a tag+source tarball for each release. I'm sure…

There is a tag for the release, called swift-3.1-RELEASE: https://github.com/apple/swift/tree/swift-3.1-RELEASE It's not showing up on GitHub's UI nor search for me at present, which may be why it seems like it's missing. You can download a .tgz from GitHub but bear in mind that you have to do the same for each of the nested repositories as well. If you're building it for yourself, it's easier to download the swift-3…

Thanks, there are tarballs for swift-3.1-RELEASE and swift-lldb-3.1-RELEASE now. For the rest (swift-llvm, swift-clang, swift-cmark, swift-corelibs-foundation, swift-corelibs-libdispatch, swift-corelibs-xctest, swift-llbuild, swift-package-manager, swift-xcode-playground-support, swift-compiler-rt) I will check for those invisible tags.

Re: Swift 3.1 Released

#58

Earlier quoted context omitted.

I can honestly say that Xcode is the worst piece of software I have ever used. It's incredibly slow, it has always been riddled with bugs, it has crashed on me more often than any other software, and it is lacking so much functionality that it doesn't deserve to be called an IDE at all. For instance, it can't even rename a Swift function years after Swift's introduction.

You should give Android Studio a try, you will no longer complain about XCode being slow.

What is this, the paralympics of software IDEs?

Re: Swift 3.1 Released

#59
post #8

Earlier quoted context omitted.

Yep it was a really nasty one. Because it used to work differently in Swift 2.x where it would not put Optional() around it in certain circumstances.

Interesting, I don't remember noticing it behaving that way. What were the circumstances, if you recall?

    var someInt: Int! // class parameter

    // later, in a method
    let url = "/api/bla/\(someInt)"
In Swift 2.x it would simply show the value of someInt. Now it will print Optional. The problem is described in the linked Stack Overflow question as well.

I never program like that but there's a ton of people out there that convince the compiler they're going to set that value in time even when it's not set when init is called. Just like some people (including Apple!) use this pattern for setting outlets:

    IBOutlet var someLabel: UILabel!

Re: Swift 3.1 Released

#60

Earlier quoted context omitted.

You should give Android Studio a try, you will no longer complain about XCode being slow.

What is this, the paralympics of software IDEs?

First place: Xcode

Second place: Driveway chalk with a water hose

Third place: Android Studio

Post reply on HN