Live data from Hacker News

The Swift Programming Language

developer.apple.com

931–940 of 970 posts

Re: The Swift Programming Language

#931

Earlier quoted context omitted.

There is already MacRuby and RubyMotion. They tried using Java years ago. It failed. Developers didn't like it. Existing stuff simply doesn't mix that well with Cocoa and that style of programming. That is why something like Swift was needed. I really don't get why you can bring up languages such as Rust and Go, and complain about Apple's special snowflake approach. Suddenly Apple is doing something developers have b…

Suddenly Apple is doing something developers have been demanding from them for years and something lots of other companies like Google, Mozila and Microsoft has already done. And yet they've decided to do it again, with yet another incompatible language! Joy of joys! (And as for Java, it was my understanding that Apple had hobbled it by refusing to release updates on a timely basis.)

"(And as for Java, it was my understanding that Apple had hobbled it by refusing to release updates on a timely basis.)"

That's a different, later issue.

Early on in the life of OS X, Apple offered a Java interface to the Cocoa class frameworks. In theory, you could write OS X applications using Java, calling into the Apple frameworks instead of using Swing or whatever Java frameworks.

This wasn't all that well supported, didn't perform well, and wasn't popular.

Re: The Swift Programming Language

#932

Earlier quoted context omitted.

The lack of fall through makes me a bit sad since I think that it's a very powerful programming construct and it usually only hurts people new to the concept - but of course one can live without it.

Three things. First of all, while you can't do this: case val: case val: case val: ... You can do this in Swift, which does the same thing: case val, val, val: ... Second, you can fall through in Swift, but you need to ask for it: case val: ... fallthrough case val: ... So don't be sad. And third... Seriously now, it's a "very powerful programming concept"? I bet 9 times out of 10 you use this very powerful programmi…

Thanks for the clarification on how to use it in Swift - like this it's indeed the perfect solution by enforcing it to be explicit. Having multiple cases rolled into one is also a very nice option. The snark wasn't really called for though. No, I don't 'use' it by accident, that would in most cases just become a bug. I use it when it makes code more concise rather than having nested ifs. Consider for example ACL rules where you set different privileges by default according to an access level.

Re: The Swift Programming Language

#933

Anyone know how Swift might achieve its claimed speedup vs. Objective-C? I can't see how it could get the advertised numbers without method inlining, which appears to be incompatible with the dynamic object model that it inherits from Objective-C

Less ambiguity, allowing the compiler to optimize more?

Re: The Swift Programming Language

#935
post #415

I'm interested to see the license under which Swift is released but it isn't mentioned anywhere. Is it under EULA or released under some open source license ?

Licensing is specified in the language specification document:

> No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-branded products.

It is pretty closed, if you ask me. Legally binding a language to a specific brand of product is a new low.

Re: The Swift Programming Language

#936
post #712

Earlier quoted context omitted.

They didn't have a choice about webkit; it was a fork of KHTML, which was a part of KDE (and available under the terms of the GPL).

Actually, WebKit was a fork of KHTML, correct, but it is licensed under the terms of LGPL. One extra letter, but a world of difference. This is why they had to open source KHTML, but they could get away with not open sourcing Safari (if KHTML was licensed under the GPL, any app that linked against the library would need to be licensed under the GPL, too.) Let's not forget that webkit when it was released was little m…

Also "they didn't have a choice" sort of ignores that they did have the choice of not using khtml and wouldn't have, if its license could've been problematic for them.

Re: The Swift Programming Language

#937

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.

I can't even view the book about the language without having an Apple device or installing Apple software.

It's available online in html:

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

I assume you'd need a developer account, though.

Re: The Swift Programming Language

#938

Earlier quoted context omitted.

> Are you honestly suggesting that Rust is stable at this point? I think that the recent, and very disruptive, ~ and box changes should completely dispel that notion. No, he merely suggests that you bored a lot of people by repeating that it's unstable, instead of accepting the fact and using something else. If being unstable is that bad, then by all means, go and use a stable language.

I, and many others, do use something else. That's the big problem facing Rust, whether or not its creators wish to admit this fact. There are numerous alternatives to Rust that offer many of its benefits, but they're usable today. We can rely on them today, tomorrow, and likely for some time to come. And by this fall, we'll likely have Swift as yet another option to add to our growing list. I think Rust has a lot of…

>I, and many others, do use something else. That's the big problem facing Rust, whether or not its creators wish to admit this fact.

Yeah, and I listen to Rihanna instead of Jay Farrar. Obviously that's the big problem Jay is facing, and he should sound more like Rihanna to cater to my taste.

Re: The Swift Programming Language

#939
post #302

> Looking for the Swift parallel scripting language? Please visit http://swift-lang.org Did they not know or do they just not care?

Looks like they took inspiration for the icon also. Look at the second to last icon on that page.

more likely both icons were inspired by the bird's distinctive silhouette

Re: The Swift Programming Language

#940
post #926
post #885

Earlier quoted context omitted.

Wouldn't a lot of that be mitigated, though, by using tagged pointers in place of RC structs where possible? Seems like an obvious optimization.

Not really sure what the tag in the pointer would be used for. Could you give an example. In general, reference counting has the problem that it needs to update the reference count. If you have a read-only data-structure these updates to the references will introduce writes that may severely impact performance since a write introduces cache consistency communication, while reads are communication-free.

Yeah, you're right. I didn't think it through when I asked. I conflated this scenario with the technique they use to put small objects like NSNumber on the stack.
Post reply on HN