13 ms·
Swift 5.0 release process
- dep_b 8y agoCan I find a list of accepted changes and proposals for 5.0 somewhere?
- slavapestov 8y agohttps://apple.github.io/swift-evolution/#?version=5 https://apple.github.io/swift-evolution/#?version=5
- mpweiher 8y ago"The primary goal of Swift 5.0 is for the language to achieve ABI stability." "Apple’s Chris Lattner, original creator of the Swift language, has recently announced on the Swift Evolution mailing list that ABI stability, one of the goals originally planned for Swift 3, will be postponed." https://www.infoq.com/news/2016/05/swift-3-no-stable-abi https://www.infoq.com/news/2016/05/swift-3-no-stable-abi
- bsaul 8y agoExcept they're announcing a feature freeze for november 2018, so unless something major happens i don't think we'll get any surprise here..
- helge5 8y agoWell, one "surprise" is that a new thing called "module stability" was invented. The Swift ABI isn't going to be the ABI-thing you are used to from C (or COM) or JVM or, well ABIs ;-) And sure, they'll give you an ABI. But whether that is going to be a _stable_ ABI is to be seen. I have some doubts given the complexity of the language, but we'll see how it turns out.
- ainar-g 8y agoMy memory might fail me, but I thought Swift 4 was supposed to be "the last major breakage"? Swift has a new major revision every year. Compare this to Go (no major revisions after 6 years, probably a backwards-compatible major revision in 2-3 years) and Rust (no major revisions after 3 years, but with a mechanism called "editions"). To say nothing about Java or C#.
- jedieaston 8y agoI don't think Swift 5 is a major breakage. Swift 3 -> 4 code is compatible, so 4 -> 5 should be compatible too.
- ainar-g 8y ago>Swift 3 -> 4 code is compatible Is this really true? Looking through 4.0 release notes I see some incompatible changes like: SE-0164 Remove final support in protocol extensions SE-0160 Limiting @objc inference If your code compiled with the old version and doesn't with the new one, then those versions are incompatible.
- airstrike 8y agoSee https://docs.swift.org/swift-book/GuidedTour/Compatibility.html https://docs.swift.org/swift-book/GuidedTour/Compatibility.h... > When the Swift 4.2 compiler is working with Swift 3 code, it identifies its language version as 3.4. As a result, you can use conditional compilation blocks like #if swift(>=3.4) to write code that’s compatible with multiple versions of the Swift compiler.
- slavapestov 8y agoThe compiler has a -swift-version flag which gates the source-incompatible changes. There were a number of changes between -swift-version 3 and -swift-version 4, including the two you highlighted. The delta between -swift-version 4 and 4.2 released this year was much smaller.
- 8y ago
- patientplatypus 8y agoOK...stupid question. Why not use Flutter? Even React Native is cross platform. Why are we still using a programming language for a phone app that means we have to write the darn thing twice? Even a RN webview pointing at an IP with code written in whatever-lang is seemingly a better choice.
- Eric_WVGG 8y agowho said anything about phone apps?
- coder543 8y agoSwift is not seriously useful for server-side applications at this point. None of the web frameworks have even remotely great performance, and Swift is compatible with almost nothing on Linux, since Apple has put minimal effort into anything but macOS and iOS... so anything you do would be much more painful than using Go, Rust, or even C# (.net core) on Linux. So, maybe you're just talking about desktop macOS in addition to phone apps?
- favorited 8y ago> None of the web frameworks have even remotely great performance Source for that claim? Vapor has some pretty great benchmarks. https://medium.com/@codevapor/vapor-3-0-0-released-8356fa619a5d#1097 https://medium.com/@codevapor/vapor-3-0-0-released-8356fa619...
- bsaul 8y agoi think the techempowered benchmarks [https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/] don't show a pretty picture for swift-based web framework. But hopefully swift nio will change all that..
- coder543 8y agoIt literally only compares itself to slow, interpreted languages and other, even slower Swift frameworks, with the singular exception of Go, where they're using Gin, which is a rather slow Go framework. Gin is at literally 10% of the performance of the fastest Go framework, as shown here: https://www.techempower.com/benchmarks/#section=data-r16&hw=ph&test=plaintext https://www.techempower.com/benchmarks/#section=data-r16&hw=... So, when you cherry pick benchmarks, it can _look_ kind of fast... but then the unbiased TechEmpower benchmarks show Vapor operating at 20% of the speed of Gin. Which is 2% of the speed of the fastest Go or Rust web framework. "50x faster to pick a different language" != "even remotely great performance."
- smaslennikov 8y agoI posted this on #swift in freenode and they kicked me out.
- eridius 8y agoThat's because #swift has nothing to do with Apple's Swift language. The correct channel is #swift-lang.
- deleted 8y ago[deleted]
- smaslennikov 8y agodo you know which cappucino machine is best for steaming an egg?
- bsaul 8y agoQuestion for the HN language designers: do you think it's possible to provide ABI stability when the language still doesn't provide the full promised features for concurrency ? (ex: async / await, agent based concurrency, and all the features talked about in chris lattner's concurrency manifesto)
- favorited 8y agoAccording to the draft async/await proposal, the ABI changes are additive, so in that case yes. https://gist.github.com/lattner/429b9070918248274f25b714dcfc7619 https://gist.github.com/lattner/429b9070918248274f25b714dcfc...
- bsaul 8y agoI'm asking because i've read somewhere that async/await was deeply intertwined with try/catch and error handling... EDIT: well, the link does address this concern, so i suppose everything should be fine..
- helge5 8y agoAn ABI can't really be "additive". If you add stuff to an ABI, it's a new ABI. Unless you tweak the definition of ABI to your liking (like introducing new concepts as "module stability"). Let's say you have an iOS application written in Swift 5 and you are using AlamoFire. The original promise of an ABI (like the C ABI, the ObjC ABI, COM, JVM, etc) is that AlamoFire could choose to switch to Swift 6 because of the great new async/await features, and you could still use that binary in your Swift 5 application. Because, you know, there is a stable ABI ;-) If you enhance the ABI, that won't be usually possible. E.g. the Swift 5 program won't understand the "new mangling and calling convention" mentioned in the link. Presumably it could be bridged somehow, or maybe not in a useful way ...
- slavapestov 8y ago> An ABI can't really be "additive". If you add stuff to an ABI, it's a new ABI. Not really. You can add new concepts to an ABI without breaking existing code. Suppose version N+1 of some compiler adds a new language feature, like async/await or whatever. It might involve a new calling convention and symbol mangling for async functions. However non-async functions would not be affected. Of course if the library author removes old entry points they will break old client apps, but that's not a property of the compiler.
- dzonga 8y agoSwift suffered the fate, of being a language developed by an academic to say and developed within a large corporation. It ended up being a complex language with useful features. Newbie hackers can't at all master protocols, generics and all the cruft. If it was simple as GO, and from day one designed to run on servers instead of iOS, Swift would've had incredible adoption given features as optionals, type safety and python/c like syntax & first class functions.
- adamnemecek 8y agoYou do realize that generics are coming to go right? Do you post this to every thread about a language with generics?
- millstone 8y ago1. Chris Lattner is not "an academic" by any measure. He industry creds are stiff stuff. 2. "Newbie hackers" can and have mastered Swift and similarly complex languages. 3. Apple would not be interested in developing a language to "run on servers instead of iOS." 4. Get a life troll.
- dep_b 8y agoWhat I really miss in Swift are user definable attributes. Also I would like to have the Objective-C attribute that requires you to always call super. I don't think that Swift even honors that attribute if it is defined in Objective-C. I consider it weird that the "where" keyword can't be applied in more places, only in case and for ... in I believe it works. Seems like some weird remnant of "what cool feature of C# could we borrow?" that never really got a full rollout. Also I would like to have a "not" keyword instead of using the easily overlooked !. Such a nice feature of F# (and Visual Basic?). Good to see count(where:) coming to the language, I often missed it. And probably is faster than filter since it doesn't create an array of results first. Apart from that Swift 5 doesn't seem to be super different from 4. But that's what I expected already.
- eridius 8y agoWhere do you miss user-definable attributes from? I'm not aware of any analogous ObjC feature. The `where` keyword is also used when defining generic functions/types. As the expression level, it used to be used in `if` too, but that syntax was changed such that it no longer uses `where` (but still retains the same power). Where else were you expecting it to be used? You can do a non-allocating `count(where:)` today with `lazy.filter(where: …).count`.
- dep_b 8y agoC# has them. Java too?
- SkyPuncher 8y agoIt's been two years since I last worked with Swift. I absolutely loved Swift as a language but abhorred these updates. It was an absolute nightmare to get a project updated then spend hours and hours fixing stupid issues with dependencies.
- charlesism 8y agoThat was dreadful, but it's not like that these days. The past year none of the updates broke anything in my code.
- raydev 8y agoIt was only bad for 1 to 2, and `UnsafePointer` stuff saw a bunch of changes in 2 to 3, but most app-makers aren't interacting with C libraries. Every year since the first has been quick and easy.