Live data from Hacker News

The Swift Programming Language

developer.apple.com

481–490 of 970 posts

Re: The Swift Programming Language

#481

Oh God, they just compared the speed of Objective C, Swift and... Python! It's nice to see Swift being faster than Objective C, etc., but what has Python got to do with coding native iOS/OS X apps? Of course it's going to fail at speed when compared to a static compiled language. What a weird and pointless comparison, imo (I mean the inclusion of Python, seems so random to me).

I don't know much Python, but swift seems to be aiming more in that direction than ruby or js for instance.

On the superficial level, the use of line breaks to separate statement (although ; can also be used), on the deeper level the is an accent on accessibility and no non sense behaviour, where other language might have made more compromises on readability for instance.

Re: The Swift Programming Language

#483
post #464

Earlier quoted context omitted.

This comment surprises me. It's factual but it's not really a response to an actual claim I made. Did you really perceive that I alleged an extreme similarity to Go in my comment? If so, it certainly wasn't intentional. I just said certain features reminded me of different languages, I didn't mean to assert these languages are actually incorporated into Swift.

No, no, I don't object to your comment. You're just not the only person I've seen making the comparison to Golang, and so I had a big comment bottled up. :)

Ah OK, I understand :)

Re: The Swift Programming Language

#484
post #319

A lot of the syntax is incredibly similar to rust.

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.

Re: The Swift Programming Language

#485
post #433
post #217

Earlier quoted context omitted.

I'm old enough to remember Apple suing Microsoft for "copying their look and feel". Open source is something Apple only does strategically - when they have to or it suits them - it is not part of the company's ethos. http://en.wikipedia.org/wiki/Apple_Computer,_Inc._v._Microso... .

> Open source is something Apple only does strategically - when they have to or it suits them - it is not part of the company's ethos. What Fortune 500 (or even 5000) systematically open sources every piece of technology? Every company I can think of -- Yahoo, Microsoft, Google, Facebook, LinkedIn, Twitter, Amazon, LinkedIn, AOL, Craigslist, Oracle, -- selectively decides what to open source. I'm not saying that's ri…

None of them are 100% open or closed, but clearly some are more open than others.

Re: The Swift Programming Language

#486

Earlier quoted context omitted.

It's not hate, but Objective-C can be intimidating.

I just spent the past 2 months learning obj-c, about to release my first app and boom, X out obj-c. my luck.

90% of what you learned are Cocoa frameworks and Apple-flavored OOP patterns that will be totally applicable to apps written in Swift. Fear not!

Re: The Swift Programming Language

#488

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.

You unfortunately probably have to deal with exceptions when crossing into Objective-C land because of https://developer.apple.com/library/mac/documentation/cocoa/....

Re: The Swift Programming Language

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

Swift's environment is also very similar to Elm's time travel debugger: http://debug.elm-lang.org/ Direct link to Elm's demo similar to Bret Victor's: http://debug.elm-lang.org/edit/Mario.elm (video: https://www.youtube.com/watch?v=RUeLd7T7Xi4 )

I immediately thought about that as well. I wonder how they pull it off? Swift is not a functional language, so they just save every single variable, or what?

Re: The Swift Programming Language

#490

What kind of benchmark produced 220 times something faster than Python? My guess is that they did it on a mobile device and used an application like this: https://itunes.apple.com/us/app/python-2.7-for-ios/id4857298...

Eh, something on that magnitude is certainly doable: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...

Python's pretty slow.

Post reply on HN