Live data from Hacker News

The Swift Programming Language

developer.apple.com

371–380 of 970 posts

Re: The Swift Programming Language

#371

Oh God, they just compared the speed of Objective C, Swift and... Python! It's nice to see Swift being faster than Objective C, etc., but what has Python got to do with coding native iOS/OS X apps? Of course it's going to fail at speed when compared to a static compiled language. What a weird and pointless comparison, imo (I mean the inclusion of Python, seems so random to me).

Python was mentioned in a "generic object sort" benchmark. It's likely that the purpose of that slide was to show that Swift is a lot faster even when dealing with dynamic dispatch.

Re: The Swift Programming Language

#372
1) This looks much less intimidating than Obj-C, I may finally write an iOS app.

2) Hopefully this puts some pressure on Google to make Go on Android easy (although I'm a Java guy myself).

3) What about swift-lang (http://webcache.googleusercontent.com/search?q=cache%3Aswift...). It has the same name and almost the same icon. Did they work with these people or just screw them?

Re: The Swift Programming Language

#373

Haven't had a chance to look at the docs for it yet, but will LLVM be the compiler for it and will it support compiling Swift into its native bytecode?

Yes, it says so on the home page:

> Using the high-performance LLVM compiler, Swift code is transformed into optimized native code, tuned to get the most out of modern Mac, iPhone, and iPad hardware.

Re: The Swift Programming Language

#374
post #254

Question: It sounds like the Xcode 6 beta is available on the dev center but I can't find it. Do you have to be a paying developer to have access to it, or does anyone know if it's going to be made available for free to (unpaid) registered developers?

Pre-release software is usually for paying devs only. Xcode is listed under the iOS 8 beta tab which is hidden to non-paying devs.

Re: The Swift Programming Language

#375
Automatic Reference Counting

Swift uses Automatic Reference Counting (ARC) to track and manage your app’s memory usage. In most cases, this means that memory management “just works” in Swift, and you do not need to think about memory management yourself. ARC automatically frees up the memory used by class instances when those instances are no longer needed.”

Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/il/jEUH0.l

Re: The Swift Programming Language

#376

Earlier quoted context omitted.

No. If you take the attitude that you're only covered if you use the concurrency primitives correctly, then you don't need atomic reference counting for everything. Basically, the programmer can use CSP to ensure that only one thread is messing around with any given section of the heap at a time, and the language implementers could say you're SOL if you do otherwise. (That probably isn't the Apple way, though.)

Swift uses the Obj-C runtime and interoperates with Obj-C code. Those languages assume a shared heap. If Swift modules didn't perform atomic reference counts, that would quite likely break Obj-C code operating on the same heap.

You'd break a ton of Cocoa APIs too.

Re: The Swift Programming Language

#377

> Looking for the Swift parallel scripting language? Please visit http://swift-lang.org Apple knew there was Swift-Lang, and still called this Swift. At least they link to it from their website!

Phrased with admirable restraint:

"The Swift parallel scripting language web is experiencing heavy load due to Apple's announcement of a new language by the same name. We'll have a raft of new web servers online shortly to handle this trafic. Please check back in a few hours! -- The Swift team..."

Re: The Swift Programming Language

#378

> Looking for the Swift parallel scripting language? Please visit http://swift-lang.org Apple knew there was Swift-Lang, and still called this Swift. At least they link to it from their website!

"The Swift parallel scripting language web is experiencing heavy load due to Apple's announcement of its new Swift language.

We'll have new web servers online shortly to handle this traffic.

Please check back in a few hours!

-- The Swift team..."

Re: The Swift Programming Language

#380
post #295

Swift has a built in option type “if let actualNumber = possibleNumber.toInt() { println("\(possibleNumber) value: \ (actualNumber)") } else { println("\(possibleNumber) could not be converted to an integer") }” Nice to see the Apple's language developers embracing functional programming by providing a clean implementation of the Maybe Monad as well as support for closures.

I love this feature, but it's not quite the Maybe Monad, which lets you assemble a sequence of (possibly failing) statements together, and fail the whole sequence if any of the parts fails (without if-statements or switching of any kind).

'Optional Chaining' sounds like it lets you join thing together to some extent:

https://developer.apple.com/library/prerelease/ios/documenta...

Post reply on HN