Live data from Hacker News

The Swift Programming Language

developer.apple.com

411–420 of 970 posts

Re: The Swift Programming Language

#411

What i don't really see in the docs is how to calls to objective-c methods are sorted out. For instance, if I have an objective-c class with a method -(void)addNumber:(NSNumber*)num withString:(NSString*)str; How is this called in swift? Is it myobj.addNumber(42, withString:"Hello World")?

  myobj.addNumber(42, withString:"Hello World")
edit: I see you removed your equals - your guess is now correct :)

for more details, see this link on apple's docs (may change)

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

Re: The Swift Programming Language

#414
post #2

As someone who always disliked Objective C, I think Swift looks very promising. I'll check it out right away :) Software-wise, I feel these current WWDC announcements are the most exciting in years. Looking at the Swift docs right now, I can see many interesting inspirations at work: there's some Lua/Go in there (multiple return values), some Ruby (closure passed as the last argument to a function can appear immediat…

He mentioned the desire to drop the "C" from objective-c, but I'm curious what this means for using c/c++ libraries now. Do they need to be wrapped by objective-c before being visible in swift?

Swift uses a special "bridging header" to expose Objective-C code to Swift. This header will presumably be processed by the Swift compiler.

In the other direction, XCode will automatically generate an Objective-C header to expose your Swift code to Objective-C.

Re: The Swift Programming Language

#416
post #157

Earlier quoted context omitted.

On the Ars liveblog, I didn't see any mention of Swift support for other platforms. Are we going to see Swift on Linux and Windows as well?

I didn't either, but if not, my bet is that outside programmers will make an open source version (like Mono to C#).

According to one Apple developer who works on the project it will _likely_ be open sourced, though the developer says they don't know if that's true or not:

http://forums.somethingawful.com/showthread.php?threadid=363...

Re: The Swift Programming Language

#417

First question that comes to mind: how open is this language? (I can't find any references to it)

Hard to say, as yet. I'd expect it to be pretty open in the end, though; they're using LLVM and the Objective C runtime, both of which are open and usable on other platforms. I guess we'll see if they release the compiler.

Re: The Swift Programming Language

#418
post #314

Earlier quoted context omitted.

Why I get down votes? It's a free book. People on other platforms can't access it.

Welcome to HN where it seems everyone disregards others work/opinions if they have any reasoning that may only make sense to them. I'll get down voted for this, and it will be truly ironic.

But it will be worth it.

Bring on the Downvotes!

Re: The Swift Programming Language

#419
Reading people compare Swift to other languages is pretty hilarious. OCaml.. Haskell.. CoffeeScript.. Ruby.. Go... Kotlin... JavaScript.. Scala... No one is saying it so I will: It looks like damn Java 8.

It is probably not a good sign that it can be immediately compared to every modern (and not so modern) language in existence.

Post reply on HN