Live data from Hacker News

The Swift Programming Language

developer.apple.com

581–590 of 970 posts

Re: The Swift Programming Language

#581
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…

I really don't see the Golang influence at all. The multiple- return- value semantic is closer to Ruby's than to Golang's; you're returning a tuple, which happens to have natural syntax in the language. Defining Golang features that don't exist in Swift: - Interface types with implicit adoption (Swift takes explicit protocols from ObjC) - Error types - Relatedly, the "damnable use requirement" and its interaction wit…

Perhaps if you take language features directly, it's not a good comparison with Go.

There are some things that did strike me as similar. The approach Go takes is to bring C language to a more modern world (i.e. C without some of the language burdens that we know so well). Swift is attempting to do the same. The way it does type inference is nice.

var x = "Hi" reminds me of Go's const types. The ARC usage reminds me of Go's garbage collection (even though it's not the same thing). Basically, the parts that it omits from C are similar to the parts that Go takes out of C even though the language itself is different... thankfully.

Re: The Swift Programming Language

#582

Earlier quoted context omitted.

Yes, but Swift looks much cleaner thanks to ARC memory management. I wish Rust has something similar, all those sigils make it messy.

What sigils? All Rust has is & now. Using ARC removes control from the programmer and has a significant runtime overhead (atomic reference counts), which violates Rust's zero-overhead principle. What Swift works well when you need deep Objective-C integration, of course.

Could "'" count as type-parameter sigil for lifetimes? It could at least look like a sigil on a first look.

Re: The Swift Programming Language

#583
post #416
post #157

Earlier quoted context omitted.

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

Could you post the message (or thread) somewhere? I think that post is paywalled.

Re: The Swift Programming Language

#584

I really wish we could play with it, without having to be a paid member. It's crazy how Apple is always so scared to release dev tools, at the end it will be out-there on bittorrent anyway...

I am pretty sure you can sign up without paying - but your code will be limited to running on the simulator. The $99 is to build for device, and submit to the store.

Re: The Swift Programming Language

#588
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…

> It is unethical to continue writing code in non-memory-safe C or C-based languages, for any purpose. Period.

And since memory-safe languages are written in non-memory-safe languages (i.e. C and C++), writing code in them is unethical as well, right?

Re: The Swift Programming Language

#589

https://itunes.apple.com/en/book/swift-programming-language/... (direct link to iBook store). Edit : Changed the link to en. Does anybody have a direct link to the Xcode 6 beta ? Or mirror download link ? Thanks.

http://thepiratebay.se/torrent/10283835/xCode_6_beta_(6A215l...

Re: The Swift Programming Language

#590

Earlier quoted context omitted.

Swift is based on the ObjC runtime, which means you have a shared heal and the possibility of multiple threads adjusting counts at the same time.

Yes, but with something CSP-derived, you could design a runtime where you're covered if you use the concurrency facilities correctly, and you're SOL if you don't. Then only the concurrency primitives need atomic refcounts.

Possibly, but it's very handy to let immutable data be read by any thread that wants to. If, however, it's very slightly mutable due to a ref counter, you have to atomically manage the counter, even for what should be free immutable reference.
Post reply on HN