Live data from Hacker News

The Swift Programming Language

developer.apple.com

471–480 of 970 posts

Re: The Swift Programming Language

#471
post #190

This will revolutionize programming education. 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://w…

> This will revolutionize programming education. It could, if it were open and not limited to iOS/OSX.

A lot of schools have iPads, I suspect a few may end up buying Mac Minis.

Re: The Swift Programming Language

#472
I found the notion of "Optionals" surprising and a bit hard to handle at first. In Objective C it was really easy to lazily allow values to be nil and still do things on them, so it's a bit of a departure.

Thinking about it a bit longer, is it because of the clear distinction between non nullable values ans optionals that the compiler can optimise the code so much more ? (I am thinking about the xx times faster than Objective C claims)

Re: The Swift Programming Language

#473

Earlier quoted context omitted.

I don't get the hate. Yeah, syntax is unfamiliar, bu once I got used to it I began to really enjoy objective-c. Ymmv etc., but it's now one of my fav languages - though I guess this is mostly due to cocoa

It's not hate, but Objective-C can be intimidating.

I just spent the past 2 months learning obj-c, about to release my first app and boom, X out obj-c. my luck.

Re: The Swift Programming Language

#475

The live REPL is totally out of Bret Victor, very impressive.

Basically, he just came up with something using FP that was more demo-able than somewhat hacky things people were already doing in other languages/environments. (For which, he deserves tons of credit.)

Re: The Swift Programming Language

#476

Ok, what about runtime support for older devices/iOS versions? They didn't say anything about it.

It'll be available for all devices supported by iOS 8, so going back to iPhone 4S.

The runtime of Swift is also the runtime of Objective-C, but the runtime might need some upgrades to fully support the Swift semantics in a safe manner.

EDIT: Correction. It's available also on iOS 7. Just confirmed by Apple. Great :)

Re: The Swift Programming Language

#478

Enumerations (from: https://developer.apple.com/library/prerelease/ios/documenta... ): Unlike C and Objective-C, Swift enumeration members are not assigned a default integer value when they are created. In the CompassPoints example above, North, South, East and West do not implicitly equal 0, 1, 2 and 3. Instead, the different enumeration members are fully-fledged values in their own right, with an explicitly-defined…

Indeed. Luckily C++11 took care of the issue on the C++ side.

http://en.wikipedia.org/wiki/C++11#Strongly_typed_enumeratio...

Re: The Swift Programming Language

#479
post #427

Earlier quoted context omitted.

There is a section in the docs about it. Similar to what you propose. https://developer.apple.com/library/prerelease/ios/documenta...

UIColor *color = [UIColor colorWithRed:0.5 green:0.0 blue:0.5 alpha:1.0]; let color = UIColor(red: 0.5, green: 0.0, blue: 0.5, alpha: 1.0) Wow, this just brings up more questions, is the compiler removing the "colorWith" semantics or do you write your own translator?

They have a concept of implicit/explicit "external parameter names".

Re: The Swift Programming Language

#480
post #464

Earlier quoted context omitted.

I really don't see the Golang influence at all. The multiple- return- value semantic is closer to Ruby's than to Golang's; you're returning a tuple, which happens to have natural syntax in the language. Defining Golang features that don't exist in Swift: - Interface types with implicit adoption (Swift takes explicit protocols from ObjC) - Error types - Relatedly, the "damnable use requirement" and its interaction wit…

This comment surprises me. It's factual but it's not really a response to an actual claim I made. Did you really perceive that I alleged an extreme similarity to Go in my comment? If so, it certainly wasn't intentional. I just said certain features reminded me of different languages, I didn't mean to assert these languages are actually incorporated into Swift.

No, no, I don't object to your comment. You're just not the only person I've seen making the comparison to Golang, and so I had a big comment bottled up. :)
Post reply on HN