Apple Releases Swift 3.0, 'Not Source-Compatibile With Swift 2.3' (infoworld.com)
An anonymous Slashdot reader quotes InfoWorld:
"Move fast and break things," the saying goes. Apple does both with the 3.0 version of its Swift programming language...its first full point revision since it became an open source project... In a blog post detailing the full body of changes for Swift 3.0, Apple singled out the two biggest breaking changes. The first is better translation of Objective-C APIs into Swift, meaning that code imported from Objective-C and translated into Swift will be more readable and Swift-like. The bad news is any code previously imported from Objective-C into Swift will not work in Swift 3; it will need to be re-imported.
The other major change... Most every item referenced in the standard library has been renamed to be less wordy. But again, this brings bad news for anyone with an existing Swift codebase: Apple says "the proposed changes are massively source-breaking for Swift code, and will require a migrator to translate Swift 2 code into Swift 3 code."
Apple will provide migration tools in version 8.0 of their XCode IDE, "but such tools go only so far," notes the article, questioning what will happen to the Linux and Windows ports of Swift.
The other major change... Most every item referenced in the standard library has been renamed to be less wordy. But again, this brings bad news for anyone with an existing Swift codebase: Apple says "the proposed changes are massively source-breaking for Swift code, and will require a migrator to translate Swift 2 code into Swift 3 code."
Apple will provide migration tools in version 8.0 of their XCode IDE, "but such tools go only so far," notes the article, questioning what will happen to the Linux and Windows ports of Swift.
than later when there's a huge code base.
Some drink at the fountain of knowledge. Others just gargle.
I have a pretty decent amount of Swift and the change between this version and previous versions is a lot more to absorb than it has been in the past... the migrator tool does help though it seems like it doesn't do as much as it could (that may have changed from earlier betas though).
However, whatever brief pain this brings upon us, is more than made up by the improvements Swift3 brings to the Cocoa API...
Have you ever worked on an Api for a long time, and thought "if I could do this again I'd rename all this stuff, and structure this one thing differently..."
Well that's one thing Swift3 did for Cocoa - there's basically a whole new name mapping overlay for Cocoa that makes lots and lots of calls much clearer, and also extensions that offer more Swift friendly API calls in some cases.
And the nice thing is some of the mappings are algorithmic, so your own ObjectiveC code you call from Swift benefits from name tidying or simplification, which works out well because of naming conventions Cocoa has long had and almost all Cocoa programmers follow.
There are also specially tweaked mappings to some parts where special cases made the automatic mapping not make sense, so it's like the whole API has had an overview and some re-thought applied.
It is sad that Swift3 could not yet bring ABI stabilization (so you could ship binaries of libraries to other developers and have them work in future Swift updates). But hey, the upside there is that people that want to ship Swift libraries have to give you source - who doesn't want that!
"There is more worth loving than we have strength to love." - Brian Jay Stanley
picking up someone else's code from the spring with lots of swift code. nightmare. auto-update blows up the code (sometimes). Sometimes there is a 3.0 branch in github. ug. why does Xcode and apple's developer goo suck so bad? because it can.
The courage to move on, to do something new that betters all of us.
The Swift 2.0 language is more than 12 months old. It has its last big innovation about 6 months ago. You know what that was? They deprecated prefix and postfix operations, they made it smaller. It hasn't been touched since then. It's a dinosaur. It's time to move on.
Apple being Apple
If anyone is anoyed by this "Breaking of source" change, feel free to fork the hell out of the project (is open source after all).
Me? I do not speak Swift yet, and for the looks of it, will wait until version 8 or so to start learning.
*** Suerte a todos y Feliz dia!
where we have 5 versions, 3 syntax distinctions, and flipping through them like a rolodex while muttering "what in the name of god does this code need to run" is a time honoured tradition.
Good people go to bed earlier.
"Move fast and break things," the saying goes.
Typical rape culture.
The only breaking change worth having in a released language is a compilation error if a space character is surrounded by white space characters. The space character exists in writing to break up words (ie, a series of non-white space characters), and the same should be true for programming. I'd be so happy if that were made a compiler breaking change in all of the major languages. I'd push so hard to upgrade to the latest version for all of them.
I warned my company not to invest time or energy into Swift. Two fanboys debated it and convinced management.
I'll be asking for a raise tomorrow morning, and pointing out how the Apple boys just cost us at least a half-million dollars for their misadventure. Probably can get them fired.
Now Apple gets to join in on the fun of deliberately breaking things, especially non-blessed ports.
Twitter supports and protects racists - by smearing their critics with the "Hate Speech" label.
I know I'll get mod downed for this, since this is article is being guarded by Apple's brightest nerds, but seriously, this DID NOT TAKE COURAGE on Apple's part! Can we have the word "COURAGE" back please, and use it when it's actually appropriate?
Here, look at the Google definitions for the word courage:
"the ability to do something that frightens one." -- So was it frightening for Apple to release this update? NO!!!
"strength in the face of pain or grief." -- Yeah, you can see how this does NOT apply at all to anything Apple has done...
And something from a year ago is a dinosaur? OK... That's a rather gross exaggeration.
The language just turned two years old, and they've been saying for a while that the language wouldn't be 'stable' until version 3.0.
Nothing is perfect on day one, after all, and Swift borrowed a lot of terribly ugly library methods from Obj-C to make the transition easier. Cleaning all that up for 3.0 will cause some short-term headaches but make future code a lot less cumbersome.
Hopefully from here on the changes will be relatively minor.
How can I believe you when you tell me what I don't want to hear?
Holy crap... My coffee just kicked in and you were being a smart ass! Please disregard my rant above. :)
Lol I have seen many projects waste so much time because of swift's BS incompatible updates to do critical things like making the ++ operator a compile error.
If you change enough, then it's almost like a new standard
It's not only Swift that Apple breaks with every version!
None of your hipster software works anymore and must be rewritten.
Earlier this week, I dug up some C source I wrote 17 years ago, it still compiles and runs fine. (gcc spit out a new warning, but I'm going to ignore it)
"Move fast and break things,"
It's such a bad saying that even Facebook has discarded it.
"First they came for the slanderers and i said nothing."
was there no way to provide compatibility libraries/deprecate gracefully?
IBM could probably have explained to Apple that doing this shit doesn't work very well.
Only for the Courageous!
Since Swift is open source, it's already been ported to many platforms. It's on Linux (which Apple officially supported) and Windows and even Android now...
If you are ignoring Swift because of your irrational hatred of Apple, you are only hurting yourself and your future employability. But I do thank you for making it even easier for me to find work.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Look at Slashdot Nerd Rage reactions to the headphone jack being axed and tell me that Apple is not being strong in the face of pain and grief...
Courage was the right word, the world just didn't realize it until the heated reactions all became public and prolific.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Nothing is perfect on day one, after all
I was.
-- Make America hate again!
Now it won't ever be implemented. Shoot we would still be having an IE 6 internet too if it were not for MS forcing corps to stop using it. People hate change and it is impossible unless you kill the original but good luck as Swift is open source
http://saveie6.com/
And it all went downhill from there
Thank Richard for the C preprocessor:
#define newstupidname(a,b,c) oldstupidname(c,b,a)
Yes. It's not like people weren't warned about this. The Swift 3 announcement at WWDC back in June made this very very explicit indeed, as indeed did swift.org from even earlier.
It's not you: I'm just this horrifically socially awkward with everybody.
... my Stevens unix systems programming book (which applies t to OS/X too) from the mid 90s is still mostly relevant today.
Ah yes because
DoSomething(i);
i = i + 1;
is so much better.
ProTip: This is sarcasm.
i += 1;
You're welcome.
Everybody whining here clearly hasn't written any Swift code and is only interested in bashing Apple. Maybe you should be asking what actual people using Swift think of this.
Well, I'll tell you as one.
- The Swift syntax changes are annoying to spend time on, but minor.
- Apple's migration tool is helpful and makes fixing go fast.
- It was no surprise or secret that the syntax was going to change. They said all this upfront and we all knew this was coming.
- Swift on Linux and other platforms only started working less than a year ago. There is not as much code to transition.
Did Chris Lattner lie about stability being pushed back until Swift 4.0, or did he not speak for "they"? How many earlier, missed, binary-compatibility goals have they missed?
And it all went downhill from there
LOL, best retort ever :)
What TFS doesn't do a good job of explaining is that with Swift 3, Apple has essentially forked the project into two parts. Besides the newer version 3, Apple is also continuing to develop/support Swift 2.x. The already-released Swift 2.3 is Swift 3's counterpart for developers who would like to stick with Swift 2.x code.
I don't imagine Apple will support Swift 2.x forever. But for the time being, Swift 3 is only as source-breaking as you want it to be. Developers who need Swift 2 compatibility can roll on with 2.3.
timberland pas cher it's ok to wipe it with wet rag. But when it comes to imitated furs such as the black upper of air Jordan, you should pay attention to the dampness of rag. Otherwise it will get worse. But this method can not be employed into shoes with cloth upper such as Nike air Garnett III. Since such uppers find no ways to clean. Then, it would be better to unfasten the ties and wash it, which will make your cleaned shoes more attractive. Last but not the least; you should wear your shoes under natural conditions, say not in rainy day, snow day. Besides, you should change you shoes at regular bases to avoid over-used. In a word, the maintenance of shoes needs care and is worthwhile. Summery: Sports shoes are so popular that almost everyone owns one pair. Some are durable and dear while others are cheap and fragile. But if we maintain them properly, its life can be extended more or less. Based on above, this article chose the maintenance of sports shoes as its objective. The article not only offers some practical cleaning methods but also some tips for attention in the course of maintaining your shoes. copyright by air jordans.
I've always seen Swift as a way of keeping application model logic off of competing mobile platforms/languages, specifically C++ (which Apple supports extremely well on iOS BTW). I view it as the new PowerBuilder --- remember those "LEARN POWERBUILDER OR LOSE YOUR JOB" ads?
How much money did Corporate America p*ss away on PowerBuilder? ... but I digress ...
The company open sourced Swift once it was clear Windows Phone was dead, but now that the app market is in decline, they need to squelch the experiments of the Swift 2.x compilers targeting Android for easy cross platform development.
No. Better never make code breaking changes. You have all the time in the world to make API changes before it becomes public, then it remains fixed.
Paticularly, trivial name changes are bad. It doesn't really matter if the function is called "sort" or "sorted" if you are breaking old code that's bad.
var a = 3
let b = a++ * 3
Now, I expect this type of code is the justification Apple is using to remove the operator; although there is no ambiguity, the line which sets b also sets a.
I argue that prefix and postfix ++ and -- should have remained in Swift. Not only are they well defined, but they are a standard operator in almost all new languages and therefore convey their meaning to the application developer significantly better than += 1 or -= 1 ever could.
For example, when reading code, ++i requires significantly less reading and parsing by the developer than i += 1 to convey the same idea.
Python 2 is still maintained because developers aren't porting their code to Python 3.
It's 9 years later, at some point Python is going to have to give up on Python 3 and move on to a Python 4 that is backwards compatible with Python 2.
It's been quite some time since I've seen a python package that doesn't work with Python 3. What packages do you use that aren't Python 3 compatible, at least through six or some layer?
At this point, any libraries that haven't been updated for 9 years to handle Python 3 are likely dead projects and you should consider migrating to newer packages with appropriate bugfix and security updates, rather than delaying Python 3. Python 3 is stable and great. It's handling of strings and binary data is much more consistent. And Python3 has cool features like async io. Many large Python-based projects such as Django are phasing out Python2 support completely over the next year or two, and I believe distros like Fedora are planning on replacing the system python with Python 3 in the next couple releases. It was a slow but stable transition. I'd say it was successful, not a failure.
A non-programming friend downloaded Swift Playgrounds app on his iPad to learn Swift programming. Not sure why it introduced him to nested functions right off the bat. Anyway, he's frustrated because his code doesn't work and he wants someone else — probably me — to figure out why. I told him if he wanted to be a real programmer he needed to debug his own code before asking someone for help.
Can we have the word "COURAGE" back please
No you can't. Courage ran off with Smart and had a bastard child named Hero.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
There's a difference between stabilizing the language (3.0) and the ABI (4.0).
Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
For anyone that is writing Swift 3 modules (that other people will use in their projects):
You may be interested in this template and recipe that explains how exactly to set up your project and Xcode settings properly.
It is at: https://github.com/fulldecent/... /selfpromo
Hopefully Swift 4 and other updates will not require every developer to redo everything each time.
-- I was raised on the command line, bitch
No, there really isn't. With no alternative implementation of the language, the ABI is inherently part of the language definition. You can't carve out bits and pieces of Swift 3.0 and declare that it's going to be forward-compatible when it won't be.
On top of that, Apple has promised compatibility before, and changed their minds when it was convenient.
And there you demonstrate hat you don't know the difference between language and ABI compatibility
I'm working on a small mixed Objective-C/Swift project. The API was provided, and is in Objective-C so no changes there. The UI code (i.e. all view controllers) are all in Swift, and consist of about ~30 classes. Moving from Swift 2.3 to 3 was quite easy with the migration tool, and took me about two hours.
8 of 13 people found this answer helpful. Did you?