Live data from Hacker News

The Swift Programming Language

developer.apple.com

361–370 of 970 posts

Re: The Swift Programming Language

#362

Earlier quoted context omitted.

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

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.

Re: The Swift Programming Language

#363
I can't find anything in the book or on the website about concurrency. I'm not familiar with the Apple programming ecosystem, how is concurrency handled? Is the lack of language-level support a concern or is everything shuffled off into libraries and the runtime?

Re: The Swift Programming Language

#364
post #351

Earlier quoted context omitted.

I didn't use that term until after the downvotes.

The post in this thread uses the term "clueless hipsters" in its first sentence. That phrase will attract downvotes. If you care about downvotes stop using needlessly polarising terminology. If you don't care about downvotes, well, do whatever.

I care more about calling out the cluelessness than the downvotes. If it gets attention and brings some bits of CompSci to the attention of people who wouldn't otherwise know, then all the better.

Re: The Swift Programming Language

#365
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")?

Re: The Swift Programming Language

#367
post #52

"...we wondered what we could do without the baggage of C." Is that tongue in cheek? It's not even a particularly large, encumbered language, C.

Heartbleed. Majority of all SSL keys on the internet compromised. All ~2 billion of humans on the internet required to change their passwords due to a single mistake by a single programmer using C. That's billions of human beings wasting hours either changing all their passwords or having their money, identities, medical records, and more stolen because they didn't. Having their accounts hijacked. For all we know tot…

The sad part, is that already in the 70's there were better alternatives, but UNIX creators just decided to ignore them and create their own language.

Re: The Swift Programming Language

#368
post #256

Earlier quoted context omitted.

You can do this in C# (and presumably other languages). I've seen people using Greek symbols in mathy code before. It's kind of fun.

It's fun once. It's impractical for someone editing the code later though, I don't want to have to look up the unicode character each time I want to remember it, and I don't want to have to copy and paste it either, it's better to stick with the characters available on a keyboard.

I have to agree. I had a love affair with unicode put directly in LaTeX markup (delta, integral signs, element-of, etc...) and it was very fun at first. Then I had to send the paper to a collaborator while writing a follow-up article together. I ended up removing all the unicode, and in subsequent work I didn't do it any more.

Re: The Swift Programming Language

#369
post #358
post #37

I'm not even an iOS developer but this is by far the most exciting thing I heard in the keynote. As an amatuer/hobbyist programmer who's self-taught with Ruby, JavaScript, etc., the one thing that was keeping me from experimenting with iOS apps was Objective-C. I know I could tackle it, but it's been hard to take the plunge. I don't know much about Swift yet, but from what I've seen it looks very exciting. So if Appl…

> So if Apple's goal was to get new devs into the iOS world, at least > from 10k feet, it's working They just announced Swift, at a conference for Apple developers, with live streaming that is only easily accessed from an ios device. I think it is probably premature to pop the corks and celebrate the efficacy of the get new developers initiative.

How else are they supposed to announce it? It's simply that, an announcement. People are talking about it now and there's info on the Apple site. I see this as a huge push forward for new developers.

Re: The Swift Programming Language

#370
post #131

Earlier quoted context omitted.

iBooks app is also available on the Mac. As the language is Mac and iOS specific it's not all that crazy.

hah, it seems iBooks is only available on Mavericks. Rather frustrating when I just want to read the documentation.

Given you will require Mavericks or Yosemite run Xcode 6 and code with it, that makes for a sort of consistency, despite the frustrating closed-ness.
Post reply on HN