Live data from Hacker News

The Swift Programming Language

developer.apple.com

271–280 of 970 posts

Re: The Swift Programming Language

#272
post #168

I just skimmed the tour, and my impression is: Swift is a compiled, Objective-C compatible Javascript-alike with an ObjC-like object model, generics, and string interpolation. No exceptions. Based on LLVM and appears to inherit the same data structures as Cocoa apps (Dictionaries, Arrays, &c). It feels very lightweight, sort of like an analog to what Javascript is in a browser.

I think it uses the Objective-C runtime directly, so it has access to all the frameworks and Swift classes can be loaded into Objective-C projects as well. There are a few other languages that do this with the Obj-C runtime, for example a Lisp variant called Nu[0]. [0] http://programming.nu/

[1] Objective-Smalltalk http://objective.st/

Re: The Swift Programming Language

#273

Slightly disappointed that I won't be able to try it out yet, because I'm not a Mac Developer. I can't get the XCode 6 beta without it, so I'd have to cough up $99 to try a new language... It seems to me like that might hurt its adoption.

I think you should be able to get it when it's out of beta without the $99 thing. Also I have paid my $99 and have not been able to get it yet.

Re: The Swift Programming Language

#275

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";

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 state…

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!

Re: The Swift Programming Language

#276

So it looks like the language isn't open source and won't target non-Apple runtimes? I'm not trying to troll, I just think that it's a pity that Apple tends to limit the ecosystem and applications of its otherwise-great languages. Building against LLVM ought to make it fairly trivial to make this cross-platform.

Open source or not, Swift will never be appealing for the world outside Apple's garden if it will be as intertwined with Cocoa as Objective-C currently is. It will be nice however to see how well Swift could be ported to Android.

Re: The Swift Programming Language

#278
post #93

It seems like the only way to view the programming language documentation is on iBooks on an iOS device? For a programming book, this is ridiculous. Edit: The latest version of OS X does support iBooks. Lets hope you have that.

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.

Re: The Swift Programming Language

#279

So it looks like the language isn't open source and won't target non-Apple runtimes? I'm not trying to troll, I just think that it's a pity that Apple tends to limit the ecosystem and applications of its otherwise-great languages. Building against LLVM ought to make it fairly trivial to make this cross-platform.

You can see first chapter of the book here

http://imgur.com/a/AuzGw

I've uploaded it just now

Post reply on HN