from Hacker News

Swift 3.0 Released

by olenhad on 9/14/16, 2:16 AM with 91 comments

  • by tveita on 9/14/16, 3:08 PM

    Does this release include a cross-platform Foundations library?

    https://github.com/apple/swift-corelibs-foundation/blob/mast... says they intend it to be part of Swift 3.0, but https://github.com/apple/swift-corelibs-foundation/blob/mast... still lists a lot of classes as "Incomplete" or "Unimplemented"

  • by thomasahle on 9/14/16, 10:42 AM

    Wow, they've basically renamed the entire Standard Library, see the changeset: https://github.com/apple/swift-evolution/blob/master/proposa...

    Not that I mind though. This kind of thing should be easy to auto refactor.

  • by hellofunk on 9/14/16, 2:22 PM

    One thing I never understood about Swift and that I don't think is addressed in Swift 3 is the widespread inconsistency with simple 'if' statements. There are at least three incompatible ways to think about 'if' syntax in Swift:

    if foo == 1 && bar ==2 //normal, from other languages

    if let somevar = foo, let anothervar = bar //note, must use a comma rather than &&

    if case .someEnum = foobar //cannot use == !

    That latter would be much easier to think about like foobar == .someEnum but it gets mucked up.

    I don't understand why these can't be streamlined into something like this:

    if let a = b && let d == f && foobar == .someEnum //you can't do any of this

    Instead, you have to use "where" and commas rather than && in some places, the whole thing is a much greater cognitive overload than it should be for such a fundamental task in any language.

  • by nicky0 on 9/14/16, 10:56 AM

    I look forward to using Swift in a couple of years when it is all stable. It looks great. Thanks to those of you using it now and contributing to its improvement.
  • by WoodenChair on 9/14/16, 2:09 PM

    What is the possibility of having Swift added upstream to Debian or Ubuntu so that I can just apt-get install it on those platforms?
  • by mark_l_watson on 9/14/16, 1:55 PM

    "Official binaries for Ubuntu 14.04 and Ubuntu 15.10..."

    I am surprised they don't support the latest Ubuntu with official binaries?

  • by dep_b on 9/14/16, 1:11 PM

    Swift 3.0 is really nice but I backtracked out of Xcode 8.0 for now. I am used to Xcode but this one still vomits Apple internal debug messages into the console, that's really too rough for me. I'll wait for the .01 or the .1 before upgrading all my projects.

    Funny thing is I downloaded one of the first if not the first beta of Xcode 8 and it already migrated my projects flawlessly (where possible). It's all the other stuff that's broken.

  • by justsaysmthng on 9/14/16, 2:02 PM

    If you're thinking of updating to Xcode 8, hoping that your project will 'just build', don't get your hopes too high.

    I've already spent all day fixing, updating, searching around for all kinds of errors that the build system throws at me. It also required me to update the project dependencies to their latest versions which support swift 3/xcode 8. Some dependencies (like SwiftBond 5) have changed a lot and now my project has hundreds of syntax errors due to renamed methods, not that hard to fix, but not sure if they'll still run the same...

    So this is a major upgrade to your project - do it when you have spare time to waste.

    In the meantime, I'm thinking of reverting to Xcode 7.3 and running the two versions side by side... Is that possible ?

  • by valarauca1 on 9/14/16, 9:27 AM

    So is 3.0 when Swift is finally gonna settle into stability? Or are they gonna wait until 4.0 to stop breaking backwards compatibility?
  • by sswezey on 9/14/16, 2:28 PM

    I really wish Swift releases were not pinned to Apple releases. Swift 3 introduced several regressions and instead of prioritizing some serious regressions, they focused on swift evolution proposals. For example, one accepted proposal renamed the common array _flatten_ method to _joined_ because it aligned one use case. Granted this is low hanging fruit, but a whole bunch of low hanging fruit takes time away from serious bugs and enhancements.

    If Swift really wants to become successful, they need to work on bigger picture things like fixing breaking regressions, planning full reflection, built-in async instead of bikeshedding about array methods. I understand they want a non-breaking API from 3.0, but everyone isn't always going to be happy; and changing small functions for the vocal minority is not the correct path forward.

    A list of 3.0 regressions: https://bugs.swift.org/browse/SR-2603?jql=labels%20%3D%203.0... Flatten rename proposal: https://github.com/apple/swift-evolution/blob/master/proposa...

  • by insulanian on 9/14/16, 7:47 AM

    > It is not source-compatible with Swift 2.2 and 2.3.

    This created havoc in Python. Hopefully it won't happen here.

  • by awzurn on 9/14/16, 1:57 PM

    Can't wait for the day when they're done deciding to only make major releases every year, and actually settle on a common syntax and platform for the language, will be great not having to worry about my source code blowing up...

    ... then again, seeing some actual refactor support in Xcode would be pretty great too, but you can't wish for too much at once.

  • by leshow on 9/14/16, 1:52 PM

    Every time I see swift, it's crazy how much they've 'borrowed' from rust. The language looks almost identical
  • by overcast on 9/14/16, 1:14 PM

    Sounds like an ideal time to dive into Swift, and start building something new.
  • by prit91 on 9/14/16, 3:15 PM

    Most of the API's are changed. Will need to migrate the code base from swift 2.3 to swift 3. Tedious work. But what I liked about the swift 3 API change was the swifitification of the GCD API. I liked it
  • by skybrian on 9/14/16, 3:52 PM

    Interesting that they dropped curried functions. Why do functional programmers seem to like it so much and mainstream programmers don't care?
  • by antiquark on 9/15/16, 12:40 AM

    But how can anybody take a language seriously if it doesn't have ++ and -- operators?
  • by andrewvijay on 9/14/16, 9:34 AM

    BREAKING again? Demotivating a lot.
  • by unknowingone on 9/14/16, 2:13 PM

    How can I get Swift 3.0 going on my Mac if I don't want to upgrade from Mavericks?
  • by jinmingjian on 9/14/16, 8:26 AM

    congrats!
  • by fit2rule on 9/14/16, 11:04 AM

    Holding off on learning much more Swift for now, until things stabilize and stuff stops breaking. Its not much fun to go back to learn some Swift only to discover things have changed since last time ..