7 ms·
What's new in Swift 3.1
- adamnemecek 10y agoNice to see features I'm pumped about in a decimal version.
- mikeash 10y agoConcrete constrained extensions and nested generics are great. These were pretty big holes in the previous versions, and will help simplify a bunch of real code.
- adamnemecek 10y agoMy exact thoughts. These were like 30% of the things I was looking forward to in Swift 4 so the fact that I don't have to wait is nice.
- chris_7 10y agoGreat language-level features (especially the concrete extensions, finally), but I'm most interested in whether the compiler still crashes, whether it can correctly report error messages in code using type inference and closures, and whether incremental compilation works properly.
- rudedogg 10y agoYeah I agree. I've been using Swift for about 2 years, and my major issue is the tooling (Xcode, CocoaPods, etc.). I've been trying plugins for every editor I like (emacs, sublime text, VS Code), and all the code completion sucks. I've researched it a bit, and it all appears to be issues with SourceKit itself. I think Swift would do much better on Linux with proper tooling - when I look at Go and Rust tools everything seems to work (I've never tried them - just going off the project readme.md and videos). I wish this was a bigger priority, but it doesn't appear to be. It seems like this will all probably get better when the Swift Package Manager supports iOS/tvOS/watchOS. Most completion tools don't parse the Xcode project for frameworks, so you don't get completions outside of UIKit/Foundation and what's declared in your file. I imagine when SPM is ready it'll make it much easier to parse dependencies and include completions for them.
- chris_7 10y agoCocoaPods isn't an official tool so it's not really the Swift team's fault that it's bad. SPM should certainly have been "done" by now though, Carthage was put together quicker by a team of volunteers without access to Apple's resources and generally works perfectly (yes, deferring most of the work to xcodebuild).
- pivo 10y agoFor me, the amount of pleasure I derive from using Swift instead of Objective-C far outweighs the downside of crashes and bad error messages. At this point I think I'd stop working on iOS/macOS if I had to go back to working in Objective-C again. Though I do hope they make fixing the compiler crashes a priority soon.
- slavapestov 10y agoWe fixed a lot of bugs while working on the new generics features in Swift 3.1 (and also recursive protocol constraints, which didn't quite make it in but a lot of the plumbing was done for it). For example, in practicalswift's fuzzer collection, 260 cases were fixed between 3.0 and 3.1, for a total of 5426 fixed (with 39 still open).
- pivo 10y agoThanks Slava, that's great news!
- slavapestov 10y agoThere were some improvements to type inference with closures in 3.1. Do you have example snippets that are giving you trouble?
- moflome 10y agoI find myself now thinking in Swift and coding in ES6... looks like SwiftJS is dead [0] but notice the Cocos2D folks just released a Swift-to-Android feature [1]. I really wouldn't mind Swift uber alles... someday. [0] https://github.com/shift-js/shift-js https://github.com/shift-js/shift-js [1] http://forum.cocos2d-objc.org/t/swift-version-is-ported-to-android/18186 http://forum.cocos2d-objc.org/t/swift-version-is-ported-to-a...
- shujito 10y agoI hope that after swift 4 new changes are non breaking
- slavapestov 10y agoSwift 4 has a -swift-version flag. When set to 3, all valid Swift 3 code should compile.
- paxcoder 10y agoThey should finish the free Foundation implementation[1] already which is the true standard library. Swift is not very useful without it, and they're talking about 4.0. It seems like Apple's giving their minimum to the community https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/Status.md https://github.com/apple/swift-corelibs-foundation/blob/mast...
- chris_7 10y agoI have always considered this a weird effort. Foundation is not Swifty (delegate protocols with optional methods, etc.). Why do we need a Swift implementation of NSMutableArray or NSNumber? Just use Array or Int/Double! Of course, a core Swift library for URL handling is important! And on macOS/iOS it can be implemented on top of Foundation. But I don't think that library should come with a bunch of geometry, collections, or number formatting types as well. µframeworks are Swifty. The SPM documentation says something like "in general more modules is better than fewer modules", so it's weird to have a giant framework as an official core library.
- paxcoder 10y agoNo networking OR file system access in the free implementation. You'd be hard pressed to find a Swift project that doesn't depend on Apple's proprietary Foundation because Swift needs it to talk to the world! I don't understand what IBM is thinking.
- bsaul 10y agoWhy are you referring to IBM ?
- adamnemecek 10y agoThey are the face of Swift on Linux.
- c0ffe 10y agoWhat does Kitura use for threading and IO in Linux? Is there any library for cross platform asynchronus IO?
- matt2000 10y agoThe original statement regarding Swift 4 was "the primary goals are to deliver on the promise of source stability from 3.0 on, and to provide ABI stability for the standard library." I hope this statement is still true. The Swift 3 upgrade was painful, I hope to see more stability out of the language from here on out.
- melling 10y agoIt was a bit of work but I would say that it was worth all the changes. I like Apple's preference to make breaking changes to make the language better. Apple wrote a decent conversion tool for 2.x -> 3.x; yes it is far from perfect. Btw, I documented most of my changes on my blog, in the hopes that the next person would be able to make their changes in half the time: https://h4labs.wordpress.com/2016/09/17/my-ios-10-and-swift-3-refactor-list/ https://h4labs.wordpress.com/2016/09/17/my-ios-10-and-swift-... Everyone using Swift will soon be on version 3.x. Compare this to languages like Python where there will need to be a major 2020 conversion to 3.x because many developers are dragging their feet. The community needs to accept a little pain or pay for past language design mistakes for decades.
- hota_mazi 10y ago> Compare this to languages like Python where there will need to be a major 2020 conversion to 3.x because many developers are dragging their feet. That's not a very fair comparison. Python is 25 years old and this migration is being requested after 20 years in existence. There is no way a successful language can perform this kind of migration at that age without pain. Swift will be no exception if it's still around and popular in 20 years.
- melling 10y agoYes, I understand that the conversion is in some ways more difficult because there's a larger legacy code base. However, the conversion has already been extended 5 years: https://news.ycombinator.com/item?id=7581434 https://news.ycombinator.com/item?id=7581434 A decade long conversion is fine if that is what the community wants. There are certain drawbacks to this. I simply like the aggressiveness that Apple has taken. The community can put "all its wood behind one arrow".
- Entangled 10y agoI'm coding all my apps in Swift and I am never going back. Server, desktop, mobile, tv, watch, linux, embeded, etc. One language to rule them all.
- bsaul 10y agoAny news on android development using swift ? The android folder in the swift.org project has always intrigued me.
- slavapestov 10y agoThe Android port is maintained by a volunteer, Brian Gesiak. You can ask him about it on Twitter: https://twitter.com/modocache https://twitter.com/modocache
- beebeebush 10y agoSwift is getting very verbosive. I would hope it get to stabile state soon as possible.