Live data from Hacker News

The Swift Programming Language

developer.apple.com

941–950 of 970 posts

Re: The Swift Programming Language

#941

The documents for ios 8 show all examples in objective-c. Can't wait for them to be updated to swift. I'd love to start with 'getting started' and work my way through rest of the docs. I'm a programmer but could never stomach objective-c.

Some of the new docs I've seen let you select Objective-C, Swift, or both.

Doesn't look like "Start Developing iOS Apps Today" has an option to switch to Swift.

Re: The Swift Programming Language

#942
post #560

Earlier quoted context omitted.

It's not for the hell of it. [ ] does not mean method call, it is the syntax for a message send. Objective-C is a super set of C, adding an Smalltalk like object system to C. The delimiters say "I am sending a message", which is different to a method call. Also, without them the language would be much more difficult to parse, and future changes to C could break the language. It's lasted well (first appeared in 1993).…

Thanks. Just read up on messaging and now I like it even less :( In Smalltalk and Objective-C, the target of a message is resolved at runtime, with the receiving object itself interpreting the message. ... A consequence of this is that the message-passing system has no type checking. http://en.wikipedia.org/wiki/Objective_c#Messages

This is exactly what gives you the ability to easily wire up standard UI components and do tihngs like KVO. KVO is really difficult in something like C++ (for example, it's practically impossible to do in Qt to create without a lot of templating/boilerplace code).

Re: The Swift Programming Language

#943

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

There seems to be a tradition in corporate programming languages to reuse the name of a somewhat obscure existing language. Google called their language "Go" despite there being already a language called that as well.

Re: The Swift Programming Language

#944
post #903

Earlier quoted context omitted.

There are objective measures. There aren't necessarily 'absolute' ones. Lisp is relatively more concise than C or Java for the same tasks. Java is relatively safer than C for the same tasks.

How objective can something be if the criteria vary depending on the comparison?

I'm not sure what you mean.

Lines of code is an objective measure. How meaningful that might actually be, well, that's subjective.

Re: The Swift Programming Language

#945

Earlier quoted context omitted.

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?

Just a hunch, LLVM uses Static-Single-Assignment, which is just that, saving every single variable change.

Re: The Swift Programming Language

#946
post #662
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 think everybody can see their own favorite language in it... and that's a good thing. For me it looks like Scala + a sprinkle of C++14 :)

There are others too with "looks like Scala":

Jacob Leverich https://leverich.github.io/swiftislikescala/

Den Shabalin http://www.scribd.com/doc/227879724/Swift-vs-Scala-2-11

Re: The Swift Programming Language

#947

Earlier quoted context omitted.

They link over to this site from the Apple page about Swift http://swift-lang.org/ - I couldn't tell if they are the same thing or if Apple Swift is just based off of this..?

your trolling.

I actually was not, I didn't understand the relationship between the two languages. I see now that they are not related at all. By the way, it's "You're trolling"

Re: The Swift Programming Language

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

Red Hat.

Re: The Swift Programming Language

#949

Earlier quoted context omitted.

My apologies, I didn't realize that expecting a programming language to have a stable syntax, stable semantics, a stable standard library and at least one stable and robust implementation before using it seriously in industry was merely a "game". Perhaps this is news to you, but those of us who work on and are responsible for large-scale software systems tend to take such factors very seriously. This may sound harsh,…

You seem to desire both stability and a faster 1.0 release. The realistic choices are: 1. Release fast and iterate 2. Release fast and be stuck with mistakes 3. Release slow Option #1 breaks stability, so that's out. Swift appears to be taking option #2 (Apple doesn't commonly break APIs, do they?), but we can't even really be sure because it hasn't been developed in the open the way that Rust has. It's possible that…

No I'd say Apples approach was: methodically develop until very polished first, then announce after. You just didn't get to see the 0.1, 0.2, 0.3... versions.

This is actually nice, because knowing about languages years before they are production ready probably just slows developer adoption because nobody is quite sure when they should trust there development process to a new language.

Re: The Swift Programming Language

#950

Earlier quoted context omitted.

The similarity to Rust should scare the hell out of Rust's creators and proponents. Swift could very well render Rust almost totally irrelevant within the OS X and iOS sphere of software development. If we end up eventually seeing Swift implemented for other platforms, then the chances of Rust's long-term success diminish even more. Things might have been different had a stable, even if somewhat imperfect, initial ve…

Rust's raison d'être is memory safety without garbage collection. Swift requires garbage collection to achieve memory safety. (Reference counting is a form of garbage collection.) In other words, Rust is about safety with zero overhead over C++, and Swift is not zero-overhead. So the people who need Rust are not going to use Swift for Rust's domains. That's fine, as Apple wanted a language for iOS and Mac app develop…

reference counting != garbage collection. Garbage collection take CPU and lots of memory. Reference counting just ++ the pointer count on allocation, and -- on free. Essentially no overhead.
Post reply on HN