Live data from Hacker News

The Swift Programming Language

developer.apple.com

251–260 of 970 posts

Re: The Swift Programming Language

#252

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 statements. This is bit interesting and should take care of the previous case.

Other than that my first impression is it's a mishmash of various programming languages. Everything else that they demo'ed seem to be features of XCode (rewinds, variable lifetype analysis etc..) rather than the language itself.

Re: The Swift Programming Language

#253
post #83

“You also don’t need to write semicolons at the end of every statement.” Please. Please. PLEASE don't be whitespace delimited!

Oh. I was rather hoping it would be! But still, there's not a lot to hate. It looks like a cleaner javascript at first glance. Not quite as pretty as Python but then, what is. :)

Common Lisp.

Re: The Swift Programming Language

#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?

Re: The Swift Programming Language

#258

Earlier quoted context omitted.

Swift doesn't seem to have anything to do with the parallel language at swift-lang.org. Whoops. Should've corrected that when I copied the comment over. In any case, reference counting is disastrous for the parallelism story. GC thread coming along and causing an additional cache miss is way better than having to do atomic operations on reference counts all the time. Why are atomic reference counts necessary? You wou…

I'm not sure you can be Objective-C compatible without a shared heap. If you have a shared heap, you need atomic reference counting.

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.)

Re: The Swift Programming Language

#260

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.

Is there anything to stop a independent implementation? Like C#/.Net and Mono?

Just look at the latest ruling on Oracle vs. Google using Java...
Post reply on HN