Slashdot Mirror


Swift 5 Released (swift.org)

Ted Kremenek, a manager of the Languages and Runtimes team at Apple, writes: Swift 5 is now officially released! Swift 5 is a major milestone in the evolution of the language. Thanks to ABI stability, the Swift runtime is now included in current and future versions of Apple's platform operating systems: macOS, iOS, tvOS and watchOS. Swift 5 also introduces new capabilities that are building blocks for future versions, including a reimplementation of String, enforcement of exclusive access to memory during runtime, new data types, and support for dynamically callable types.

56 comments

  1. Oh Yeah...It's Time to Get Swifty In Here by Anonymous Coward · · Score: 0

    Shit on the floor...I'm Mr. Bulldops!

    1. Re:Oh Yeah...It's Time to Get Swifty In Here by Anonymous Coward · · Score: 0

      Rick and Morty FTW!

  2. Good thing is, can deploy to older iOS versions by SuperKendall · · Score: 3, Informative

    It's great that Swift has finally got ABI compatibility, the main benefit to start it an easier time distributing frameworks that can be dynamically loaded.

    Another great aspect of Swift 5 is that you can still build apps all the way back to iOS 11 (maybe earlier). So you can still convert apps to use the latest Swift without worrying about excluding users that prefer to wait for a while before upgrading (though the practical reality is that after a year, almost all iOS users have upgraded).

    One interesting change that happened with Swift 5 is that it switched internally from storing Strings as UTF-16, to UTF-8 - it helps performance and bridging to languages like C.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Good thing is, can deploy to older iOS versions by Anonymous Coward · · Score: 0

      I'm still running iOS 7 as my daily driver, and I have a SHSH blob to roll back to iOS 6 if I need to. All the way back to iOS 11!? Wow, so like a year and a half. Lame as fuck.

    2. Re:Good thing is, can deploy to older iOS versions by Anonymous Coward · · Score: 0

      I have a SHSH blob to roll back...

      I first read "SSH blob" and did a double take. LOL, that's very funny!

    3. Re:Good thing is, can deploy to older iOS versions by DontBeAMoran · · Score: 1

      Still using iOS7 too, on iPhone 4.

      --
      #DeleteFacebook
    4. Re:Good thing is, can deploy to older iOS versions by Anonymous Coward · · Score: 0

      Me too -- iOS 7 on a ~2012 ipad -- the only strange thing that happens with this OS is that once a year or so, a bug occurs where I'll open up the cover and my 4 digit password will be auto-typed in at the login screen

    5. Re:Good thing is, can deploy to older iOS versions by DontBeAMoran · · Score: 1

      And yes, I know about that. It happens on "no password day". Look it up.

      --
      #DeleteFacebook
  3. BINGO by Anonymous Coward · · Score: 0

    I call Buzzword Bingo.

    Next time, can we have an article that doesn't look like a press release?

    1. Re:BINGO by HiThere · · Score: 2

      I'm sure it *is* a press release. Probably based on one posted on a web page.

      I didn't follow any links, because every time I've checked swift didn't work reasonably on Linux. (IIRC, there were officially declared ways to do it, but scant documentation of them, and little explanation of what you'd actually end up with if you did them. And no reports from any Linux users who had done that and were happy with the results. Objective C had much better compatibility...of course, that one didn't start with Apple.)

      FWIW, I've always regretted that Objective C didn't have a better Linux support community, one good enough that learning the language would have been worthwhile. Swift evokes only a shadow of that reaction.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    2. Re:BINGO by phantomfive · · Score: 2

      FWIW, I've always regretted that Objective C didn't have a better Linux support community,

      Agreed, it was a great language.

      The noisiest complaint people had of Objective C is that it had all the baggage of C. But then swift has all the baggage of Objective C and C, but without the elegance of Smalltalk. Oh well.

      --
      "First they came for the slanderers and i said nothing."
  4. I can't wait! by pak9rabid · · Score: 2, Informative

    Oh sweet, another forced Xcode upgrade that will no doubt bust up all my app's existing code and require hours of effort to get back to where I was again! Thanks Apple!

    1. Re:I can't wait! by Anonymous Coward · · Score: 0

      So true. About to open Xcode right now and see how many little red "fixit" circles are scattered all over my formerly working codebase... Kotlin is everything Swift could have and should have been. Too bad Android is fucking trash.

    2. Re:I can't wait! by Anonymous Coward · · Score: 0

      Apple should slow Switf's development because your are lazy, ok. Sounds fair.
      - Tim Apple.

    3. Re:I can't wait! by pak9rabid · · Score: 1

      Or, perhaps they shouldn't release an unfinished language onto the world, while advertising it as the greatest thing since sliced bread.

    4. Re:I can't wait! by pak9rabid · · Score: 1

      Agreed

    5. Re:I can't wait! by UnknowingFool · · Score: 3, Informative

      Did Apple hide this from you? I mean you developed apps using Swift fully knowing it wasn’t ABI stable. And now it’s Apple’s fault for making it stable. As far as I know you could have kept using ObjC.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    6. Re:I can't wait! by Anonymous Coward · · Score: 0

      I'm in no way an Apple fanboy but what do you mean by "unfinished language" exactly ? A language that does not change anymore ? I.E it's dead ?

    7. Re:I can't wait! by pak9rabid · · Score: 2

      Well, they sure weren't very upfront about it not being ABI stable in the past. I even recall them going so far as to say version 4 would be the last version to break backwards compatibility.

    8. Re:I can't wait! by pak9rabid · · Score: 1

      Having the language introduce breaking changes that requires changes to your code at every new version. I never had these issues with C, C++, Java, Ruby or hell even PHP.

    9. Re:I can't wait! by UnknowingFool · · Score: 3, Insightful

      I only coded briefly in Swift 2/3 and even I knew it wasn’t ABI stable. That was one of the complaints in why the Swift app size was much larger than ObjC versions. Sorry if this wasn’t clear to you but it is always a risk with a relatively new languages that they aren’t stable for a while. Even older languages break compatibility with new versions. Java 9 breaks a lot of things, and Java was 15 years old by then.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    10. Re:I can't wait! by Anubis+IV · · Score: 3, Informative

      Well, they sure weren't very upfront about it not being ABI stable in the past.

      Other than dropping by your home to deliver the news in person, I honestly don't know how they could have been more up front about it. They talked about it in a keynote, WWDC sessions, written roadmaps, e-mail lists, tech podcasts featuring Apple engineers as guests, and other documentation. Hell, I've never even coded a line in Swift and I felt like I couldn't avoid the information had I wanted to, simply because it was constantly coming up in software development circles.

      Now, that doesn't change the fact that the plans have indeed changed over the years. I think I even remember them suggesting that Swift 3 would be ABI stable at one point, which clearly didn't end up being the case. But they've been keeping people in the loop all along and explaining the delays. Even so, most of the language reached ABI stability in 4.x and earlier, so the benefits of full stability in 5.0 are somewhat muted.

      version 4 would be the last version to break backwards compatibility

      Given that the only people who won't be able to run Swift 5 code are the ones whose devices won't have support for iOS 13 (i.e. devices from likely 2013 and earlier), this only affects organizations supporting apps on unsupported hardware from 6+ years ago (i.e. a vanishingly small number of organizations, at least when it comes to mobile). If you're a developer in that space, you're already familiar with the hassles associated with supporting outdated hardware, such as needing to link against outdated libraries and frameworks or using an older version of a language. It's the sort of stuff we have to do all the time in industry, so I'm not sure why anyone would be bothered by it.

    11. Re:I can't wait! by Anonymous Coward · · Score: 1

      yeah the C++ way is awesome, where design mistakes never get fixed and eventually people just stop using it for most purposes.

    12. Re:I can't wait! by squiggleslash · · Score: 2

      You didn't?

      Java's fairly notorious for changes that break things. PHP doesn't, and it's the general consensus it's a hot mess because PHP has too much stuff that really should have been changed more than a decade ago but wasn't because of backward compatibility.

      C... eh. I don't want to dunk on C (please see previous 6,192 times I've dunked on C) but the aim right now is not to make C any better, because there'd be a risk that you'd encourage people to program in it. C++ just adds more features with every new standard, I wouldn't suggest that's a model for anything. Which leaves Ruby which is a niche language.

      I do agree some level of standardization would be good. The problem is the computer industry is really good at putting out half baked half finished programming languages. Just like everything else we do. So it's unrealistic to expect Swift to be any different.

      --
      You are not alone. This is not normal. None of this is normal.
    13. Re:I can't wait! by Anonymous Coward · · Score: 0

      Weird, because C++ has not been very ABI stable at all. This is why every c++ compiler version carries with it its own c++ standard shared-libary.

      If you ever played around with gentoo in the early days, you find how complicated c++ abi 'compatibility' is. gentoo of course fixed all those issues now.

    14. Re: I can't wait! by phantomfive · · Score: 1

      I rolled my eyes this morning thinking you were being a little melodramatic, but here I am now trying to get an xcode project working.

      --
      "First they came for the slanderers and i said nothing."
    15. Re:I can't wait! by angel'o'sphere · · Score: 2

      Java's fairly notorious for changes that break things.
      Actually no ...

      I use Java since 20 years and never had that problem. However there are APIs or methods in classes that get "deprecated", but they are kept around for years.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    16. Re:I can't wait! by Anonymous Coward · · Score: 0

      I’m incompetent.

      Fixed that for you.

    17. Re:I can't wait! by Anonymous Coward · · Score: 0

      Well, to be fair, C is probably older than you are, or at least older than your coding experience. :-)

  5. Version puke by Anonymous Coward · · Score: 0

    It feels like it was only a year or two when they announced that Swift 2 was no good, and that Swift 3 would save us all. And now Swift 5? And each new version breaks backward compatibility?

    At this point, Swift feels like a very unstable landscape and programming language to get on. No thanks.

    1. Re:Version puke by DontBeAMoran · · Score: 1

      On the other hand, while iOS/macOS don't have the biggest marketshare, they do have the users with the most cash.
      So if you want to code for a living, you can't ignore those users.

      --
      #DeleteFacebook
    2. Re:Version puke by Anonymous Coward · · Score: 0

      So if you want to code for a living, you can't ignore those users.

      Or you can become a badass Linux kernel hacker.

    3. Re:Version puke by DontBeAMoran · · Score: 1

      The number of jobs for "badass Linux kernel hacker" is much lower than "app developer for iPhones, iPads and Macs".

      --
      #DeleteFacebook
  6. That's pretty old man... by SuperKendall · · Score: 1

    Pretty sure it's actually back to iOS10 in fact... If I may ask, why do you stick with iOS7? That is a curious choice. There's a lot of benefit from newer OS versions, and they don't even include anything older than iOS9 on most iOS version share trackers I have seen...

    Various versions of iOS 10 - 12 are around 90% of iOS users.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:That's pretty old man... by tlhIngan · · Score: 1

      Pretty sure it's actually back to iOS10 in fact... If I may ask, why do you stick with iOS7? That is a curious choice. There's a lot of benefit from newer OS versions, and they don't even include anything older than iOS9 on most iOS version share trackers I have seen...

      Because he's on an iPhone 4, so iOS7 is really about it. But then again, you're also talking about a phone that' was released nearly a decade ago.

      For a while until I finally upgraded I was rocking my launch day iPhone 4s still on the original battery.

    2. Re:That's pretty old man... by Anonymous Coward · · Score: 0

      I actually have a 4s, so I think I can get up to iOS 9. That said, I have another 4s running iOS 9 (it was cheaper to buy than the screen I pilfered from it). It is much slower. I also have an iPhone 7 with iOS 12 on it. I just don't find it as nice to use as the 4s. Both software and hardware affect that.

    3. Re:That's pretty old man... by angel'o'sphere · · Score: 1

      The newer iOSes are visually ugly. Especially the iBook App has no longer a true "book mode".

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  7. How is it forced? by SuperKendall · · Score: 3, Insightful

    Oh sweet, another forced Xcode upgrade

    How is this forced? You could keep using the current version of Xcode for quite a while.

    In fact even after upgrading, nothing says you have to move to Swift 5 - you can keep compiling against the older Swift versions, and upgrade when it makes sense to you.

    I've been using the beta version of Xcode off and on, and it didn't seem to break anything - I was able to compile my existing projects just fine with no changes.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:How is it forced? by phantomfive · · Score: 2

      How is this forced? You could keep using the current version of Xcode for quite a while.

      No haha. Trying to remain on older versions of Apple software is a pain and not supported scenario. After a few OS upgrades, it won't work at all.

      --
      "First they came for the slanderers and i said nothing."
  8. I will give you every other one... by Anonymous Coward · · Score: 0

    But C has been pretty fucking ABI stable for 30 years, and even most of the earlier issues were a combination of processor changes and attempts at proprietary lockin through standardization. Traditional C when there was still compiler support for it actually worked pretty well for the K&R crowd, as show by the hundreds of MU*s and other software that used it, and only switched when GCC dropped traditional compiler support in 3.1 for a pretty pathetic set of reasons.

  9. Re:Operator support? by Anonymous Coward · · Score: 0

    8==D~~~

  10. Re:Operator support? by Anonymous Coward · · Score: 0

    There are many versions of this operator! ;-)

    ( )( )===={+)~~~ is a strange one but works.

    LOL.

  11. iOS 11 old? I still have iOS 7 users by Ecuador · · Score: 1

    Are you serious? "all the way back to iOS 11"? Dude, iOS 11 is barely 1.5 year old!
    I do my best to support actually old versions with my apps (for amateur astronomers) - I was able to support iOS 6 until last summer (Apple stopped allowing it), new versions of my apps support as far back as iOS 7, which is not easy if you want to fully support new devices as well, but there are ways to do it. I do get some thank you messages from iOS 7 or iOS 9 users (mainly people with devices such as iPhone 4S, iPad 2 who can't update), so I think that's worth the effort.
    Sure, I could go for the majority of users, if I limited to iOS 11 I'd get almost 90% of users and make it much easier for me, but I care about all of my users and try to serve as many as I can. Their devices are perfectly fine, why should they be excluded from new software?

    --
    Violence is the last refuge of the incompetent. Polar Scope Align for iOS
    1. Re:iOS 11 old? I still have iOS 7 users by CanadianMacFan · · Score: 1

      I've kept my phone and iPad on iOS 10 because I haven't seen any reason to upgrade them. The other week I changed mobile carriers and I had to update my iPhone to the latest release and I haven't seen a positive thing about the move other than having my phone work with the new carrier. I have a 5s because that size of phone suits my needs. I'm sure that there are a number of security fixes in there that are good too.

      Lately I've been seeing a number of apps requiring iOS 11 or even 12. These are apps that are fairly basic and don't do anything out of the ordinary.

      Thankfully there are still some developers like you out there that still are willing to take the extra time to craft their products and actually care for their users. Please don't stop.

  12. When you see .success and .failure pop up in by Anonymous Coward · · Score: 0

    In some code you are reading.

    https://github.com/twostraws/whats-new-in-swift-5-0/blob/master/Whats-New-In-Swift-5-0.playground/Pages/A%20standard%20Result%20type.xcplaygroundpage/Contents.swift

    You are welcome for the link.

  13. UUIDs by CanadianMacFan · · Score: 1

    Are they still changing the UUID almost every release?

    I made a plug-in for Xcode and released it as open source a few years ago. Almost every time an Xcode release came out I'd get a request saying that plug-in stopped working. This is because as part of the configuration of the plug-in you specify the UUIDs of Xcode the plug-in works with. The new release doesn't match and so the plug-in doesn't work. An error code shows up in the log and it's easy to find out what has happened.

    It was like dealing with a bunch of kids. If I didn't have an update done the morning of the release I would get complaints FFS. This despite leaving instructions on how to fix the issue and multiple fixed requests with explanations on the exact same thing. I bet they would complain if their users would do the same to them.