Also a splash page: https://developer.apple.com/swift/
Link to docs that doesn’t require iTunes: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html
From this Reddit post:
A quick overview:
Statically typed with type inference.
Properties (syntax similar to C#), including lazy properties with the "@lazy" annotation.
Functions, methods and type (static) methods.
Support for observers (with "willSet" and "didSet"). Interesting to see the observer pattern baked in a language although I’m more partial to event buses for this kind of thing.
Classes and structures (structures have restrictions regarding inheritance and other things).
For and while loops (statements, not expressions).
Optional chaining with "a?.b?.c" and forced dereference with "!."“.
Convenient “assign and test”: "if let person = findPerson() ...".
Type casting with "is", down casting with "as?" (combines nicely with the "let" syntax. Ceylon does it right too).
A quick overview:
"if let person = findPerson() ..."
Also option types.
I have to say, I’m a little torn about Swift.
On one hand, I’m a willing to be pragmatic and realize that this is a step up from Obj-C or just C! On the other, though, I know this doesn’t really take a big step forward, or even really match some of what we’ve already done with ML & co.
So yay but also meh.
Very interesting. The main reason I’ve never tried my hand at writing for an apple platform is because objective-c looks no fun. I might finally give it a try once this is fully rolled out.
I admit to being in the same boat. I skimmed the ebook and the language [swift], on paper, actually appears pleasant.
What the world needs right now is an open source / cross platform language. Hopefully apple delivers.
What incentive does Apple have to deliver a cross platform open source language?
Do we have a shortage of those?
I imagine this will be much like Objective-C. Technically you can use it elsewhere (eventually), but practically no one will.
And Apple is an avid proponent of both, so you can count on Apple to deliver.
Swift is closed source and Apple only.
Perhaps we’ll see projects like Mono (for MS C#) that will change this.
… at the moment. There are plenty of signs pointing to them making it open source in the future. Apple don’t have a horrible history with open source; LLVM and Clang being the two major open source language projects they heavily contribute to or created and released. The damn thing is less than 24 hours “old” and people are already bitching that it’s not FOSS. Jesus, just hold your horses.
KHTML guys would like a word with you….
I don’t understand your point. Open source doesn not mean you have to give code back to the original author/project, it means the source is accessable, and that’s exactly what WebKit is. It was much easier for them to make their own fork and control the direction of the code they wanted without having to try and maintain compatibility with KHTML and its differing goals. What exactly is the evil deed Apple committed when it created one of the most widely used open source projects in the world? Most users of the web these days see it through a webkit rendered page, and any one of them can download, build, use and contribute to the project if they want to.
This looks like a good place to start reading: http://swift-lang.org/papers/index.php, particularly section 6 (comparisons to other work) of the 2011 paper: http://swift-lang.org/papers/SwiftLanguageForDistributedParallelScripting.pdf.
So far, swift seems like a reinvention of dataflow programming, on top of a mesos-like resource manager.
[EDIT] Oh, wait, this is the other swift programming language. Damn, we’re running out of names.
Not sure why you are being downvoted. Because the OTHER swift looks pretty damn cool and licensed under Apache license! Thanks for introducing me to the OTHER swift…
If I read well, the language and its implementation are not designed to be cross-platform?
Why? The language itself is built on Objective-C and LLVM, they are both (in a way) open and cross-platform. Let’s wait for the official public release and see if they release it open.
Yeah not going to invest time in a proprietary language no matter how much free money will come my way. There are languages infinitely superior in being open.