What's new in Swift 3.1
hackingwithswift.com
hackingwithswift.com
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.
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).
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-...
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.
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.
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".
Python 2.x keeps working pretty well for many large backend-service codebases that need a lot of stability.
Swift 2.x is used for iOS and macOS client/UI apps that get significant UI "enhancements" every year. The stability desire is much less, in every sense.
https://github.com/apple/swift-corelibs-foundation/blob/mast...
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.
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.
Is there any library for cross platform asynchronus IO?
For networking, Kitura uses Kitura-net, which uses BlueSocket, which in turn uses C library's sockets[1]. On GNU/Linux, this is the GNU C Library, for which a package (Glibc) is provided by the Swift port[2].
For asynchrony they seem to be using libdispatch despite it being "early in the development"[3], but I've also noticed they're wrapping epoll and curl (see 1.B again), so it's hard to gauge the real extent of the hack.
[1]: https://github.com/IBM-Swift/Kitura/blob/master/Package.swif...
https://github.com/IBM-Swift/Kitura-net/blob/master/Package....
https://github.com/IBM-Swift/BlueSocket/blob/master/Sources/...
How much credibility would you have if you were to say to backend developpers " swift is such a great language, you'll love coding with it on the server side", and they hear that iOS still can't include the stdlib because the language is still not stable enough ? I've tried, and the answer is none.
[0] https://github.com/shift-js/shift-js [1] http://forum.cocos2d-objc.org/t/swift-version-is-ported-to-a...