You do realise that link is completely unrelated to what Apple is doing, right?
EDIT: Nevermind, my mistake. I thought the comment was about Apple was making their own language like Google did with Go, not Go! already existing as a language
I think they just don't care. Swift-lang looks to be completely different when you look at the examples[1]. Its syntax is more java-y then Apple's iteration.
Also Swift-lang is Apache 2.0 licensed, which I have a feeling Apple wouldn't use as a base for a new language.
There seems to be a tradition in corporate programming languages to reuse the name of a somewhat obscure existing language. Google called their language "Go" despite there being already a language called that as well.
This will help young programmers solidify the connection between giving the computer logical commands and what is outputted on the screen immediately.
Reminds me of how excited I was when Processing (http://www.processing.org/) was released which made it dead simple to interact with a screen and graphics. Didn't have live feedback, but it made it incredible easy to understand OOP.
How do you see it as revolutionizing programming education? I'm pretty ignorant in this area, but it seems like a very high level language that abstracts a ton of stuff - and very platform specific too if I'm not mistaken. Is that really where we want people to start? I would have thought either a highly graphical language with buttons and widgets for early education, then moving onto platform-agnostic stuff like java and obj c would be the thing to do. Maybe you're talking about later stuff, college and beyond, which makes sense - at that point specialization to this extent seems like a good idea. But as I said, I'm pretty out of touch.
Swift doesn't look more high level than other scripting languages, but higher level than Obj-C yes, but also much more modern with a good toolset which will probably boost dev productivity.
I work with someone who previously was a college professor teaching computer science. The university decided to standardize on Mac and iOS hardware, and teach how to program iOS apps as a way to make the CS program more popular.
Trouble was, teaching the entire XCode and Objective C tool chain was not a particularly easy entry point for learning how to develop programs.
(Maybe there were other prerequisite programs, but still, you need to understand C to really understand why a lot of things are the way they are in Objective C, in addition to message passing and object orientation, pointers, and other quirky stuff in order to really wrap your head around iOS development.)
Swift and the corresponding tools look like they would have been a godsend for teaching that class. A more practical way to get students started writing programs they can actually run on their phone.
Still on an Objective-C runtime, so it's hard to see how the performance gains they claim are achievable, but otherwise having an interpreted version should be good for productivity.
Correct me if i'm wrong, but Swift has static typing (with type inference, but still with a strict type on every variable), whereas Objective C has dynamic typing with optional type annotations. Having ubiquitous strong type information available should make it much easier to generate fast code.
Apple has a mixed history with the openness of their tech. It could be that the only place you'll be able to run the language is on an iOS device. We'll see.
It's really kind of amazing just how locked down the apple ecosystem is. Not only have they eschewed the general trend toward more open and cross-platform languages, they've even made the documentation single-platform. That's just wild.
Feels like they looked at a bunch of programming languages, took all their favorite features, and then put them into one which still sits on top of the ObjC runtime. And then added some Apple syntactic craziness.
For example:
var apples = 3; // mutable
let oranges = 5; // immutable
let summary = "I have \(apples) apples and \(oranges) oranges";
And "let" will have a totally different meaning in ES6. It's a bit weird to use a keyword from some language with the same meaning, and another keyword from the same language but with a totally different meaning.
Alternative viewpoint based purely on your three lines (I can't seem to get to the reference manual...) - all of those seem like pretty good design decisions. To me, "var" sounds like it makes something that is variable and "let" sounds like it is creating an equivalence. The "\(foo)" syntax actually looks really clean to me, though I can't recall having seen anyone use it for that before.
The language itself isn't radically different from most mainstream Algol style languages. That's good because it makes it pretty easy to pick up. In addition to what you mention on variables vs constants, the only feature which is nice seems to switch-cases.
a. No fall through. This is a plus in avoiding bugs. This is minus if you really know what you are doing and want fall throughs
b. Pattern Matching in case statements. This is bit interesting and should take care of the previous case.
Other than that my first impression is it's a mishmash of various programming languages. Everything else that they demo'ed seem to be features of XCode (rewinds, variable lifetype analysis etc..) rather than the language itself.
From the manual: “Execution doesn’t continue to the next case, so there is no need to explicitly break out of the switch at the end of each case’s code.” I bet I know when that became a priority!
That'a also Microsoft said about VB.NET when they introduced C# in early 2000. Now C# is a much more dominant language than VB.NET. It's a matter of adaptation . Something it take a long time. But seriously, how could Apple introduce a new programming language that would be possibly worse than objective-C to master? I don't think so if it's not light years better than OC. Perhaps better is a relative term, but from the syntax, new Swift definitely has a modern objective language feel, and should pose much less learning curve to newcomers. That's certainly a welcome sign.
Strangely I'm one of the people that loves the objc syntax. It's very verbose but that also makes it very simple to understand. Same goes for nested square brackets, they make it pretty simple to see how things are working. I'll definitely be trying Swift though.
Feels like dynamic languages coupled with some smalltalk resemblance, plus the playground which is kind like Mathematica? Looks pretty awesome! I'd itchy to try it out...
231 comments
[ 4.7 ms ] story [ 222 ms ] threadhttp://www.lighttable.com
Playground is interesting.
func makeIncrementer() -> (Int -> Int)
EDIT: Why the downvotes? was just an observation not a criticism. Looking forward to using it instead of Objective-C.
EDIT: Nevermind, my mistake. I thought the comment was about Apple was making their own language like Google did with Go, not Go! already existing as a language
> Looking for the Swift parallel scripting language? Please visit http://swift-lang.org
Did they not know or do they just not care?
Also Swift-lang is Apache 2.0 licensed, which I have a feeling Apple wouldn't use as a base for a new language.
[1] https://trac.ci.uchicago.edu/swift/browser/branches/release-...
--Steve Jobs
What I find more amazing is that, as humans, we have all chosen "5+ years" as the experience level in our jokes.
Interestingly enough, the time manipulation in Swift was inspired by a game called Braid (http://en.wikipedia.org/wiki/Braid_(video_game)) released back in 2009.
This will help young programmers solidify the connection between giving the computer logical commands and what is outputted on the screen immediately.
Reminds me of how excited I was when Processing (http://www.processing.org/) was released which made it dead simple to interact with a screen and graphics. Didn't have live feedback, but it made it incredible easy to understand OOP.
Setting up a dev environment can be one of the big reasons people fail to learn to program.
1. Buy particularly expensive computer 2. Register as an apple developer 3. Install Xcode, and you're ready to go.
> Setting up a dev environment can be one of the big reasons people fail to learn to program.
Citation needed :)
1. Buy a Mac mini for $600, which doesn't strike me as particularly expensive.
2. There is no step 2.
3. Download Xcode from the Mac App Store for free.
Trouble was, teaching the entire XCode and Objective C tool chain was not a particularly easy entry point for learning how to develop programs.
(Maybe there were other prerequisite programs, but still, you need to understand C to really understand why a lot of things are the way they are in Objective C, in addition to message passing and object orientation, pointers, and other quirky stuff in order to really wrap your head around iOS development.)
Swift and the corresponding tools look like they would have been a godsend for teaching that class. A more practical way to get students started writing programs they can actually run on their phone.
http://www.lambdacs.com/debugger/debugger.html
But it never took off, for some reason. And it didn't have the arresting graphical aspect.
Bret Victor worked at Apple for a time as well.
It could, if it were open and not limited to iOS/OSX.
[1]: https://developer.apple.com/system-status/
Edit: The latest version of OS X does support iBooks. Lets hope you have that.
Looks like the end of the line for this particular bit of history: http://www.tikirobot.net/wp/2008/11/22/why-gcc-has-a-free-ob...
https://developer.apple.com/library/prerelease/ios/documenta...
Also some other useful stuff:
https://developer.apple.com/library/prerelease/ios/reference...
For example:
var apples = 3; // mutable
let oranges = 5; // immutable
let summary = "I have \(apples) apples and \(oranges) oranges";
[1]: https://developer.apple.com/swift/
The string interpolation syntax is unique, but kind of makes since given then \ is the escape character in C strings.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
var distance:Double = 70.0
a. No fall through. This is a plus in avoiding bugs. This is minus if you really know what you are doing and want fall throughs b. Pattern Matching in case statements. This is bit interesting and should take care of the previous case.
Other than that my first impression is it's a mishmash of various programming languages. Everything else that they demo'ed seem to be features of XCode (rewinds, variable lifetype analysis etc..) rather than the language itself.
A bit of python looking stuff and some ruby looking stuff in there too. I am intrigued enough to give it a try when it is available.
Edit : Changed the link to en.
Does anybody have a direct link to the Xcode 6 beta ? Or mirror download link ? Thanks.
Thanks for the direct link!
Edit: I pointed this out as I'm curious about trademark/logo clash.
https://www.youtube.com/watch?v=PUv66718DII&t=10m42s