

Why Apple’s Swift Language Will Instantly Remake Computer Programming - wacvasconcelos
http://www.wired.com/2014/07/apple-swift/

======
tptacek
Wow. It's really too bad what Wired's editors did with this headline. The
story is not nearly as bad as they made it sound.

~~~
mcguire
Are you sure about that?

" _Google unveiled a language called Go in 2009, and though it was designed by
some of the biggest names in the history of software design—Ken Thompson and
Rob Pike—it’s still struggling to gain a major following among the world’s
coders. But Swift is a different animal. When it’s officially released this
fall, it could achieve mass adoption with unprecedented speed, surpassing even
the uptake of Sun Microsystems’ Java programming language and Microsoft’s C#
in the late 1990s and early 2000s._ "

I didn't note any mention of the fact that Objective-C and now Swift are (to a
first approximation) the _only_ ways of writing apps for Apple's major
products. Go is struggling? They're comparing it to Java, a language intended
for universal use, and it hasn't been released yet?

~~~
tptacek
It's not a _great_ article, but the author had access to Chris Lattner, who is
a legit bad-ass that I enjoy reading about.

------
exelius
Swift is a neat looking language. I haven't gotten to play with it yet, but I
have read Apple's "The Swift Programming Language" cover to cover and I come
away with a few concerns.

My biggest issue with Swift is that there often seem to be too many ways to do
things. I'm fine with having options, but when there are literally 4 or 5
different ways to accomplish the same things it's going to require development
shops to come up with rigid standards about how to do things. Many shops
aren't going to know that this will be an issue until later, when trying to
integrate the work of different developers / teams on a large project.

The upside of this level of flexibility is that it allows you to quickly port
code from nearly any language into Swift since it supports the features of
almost every modern language. The downside, of course, comes when starting a
new project: you have a lot of decisions to make about how functions will be
called, objects instantiated and referenced, etc. If you don't make those
decisions up-front, peoples' preferences will take over and you'll get a lot
of spaghetti code. I'm not looking forward to starting a project in Swift,
that's for sure.

From a technical perspective, I have no complaints: Swift is flexible and
powerful without being weighed down by the kludges that Objective-C forced you
into. But I definitely see small dev shops having a big advantage with Swift
in the beginning: it'll simply take the big guys too long to get their act
together.

~~~
joncooper
> My biggest issue with Swift is that there often seem to be too many ways to
> do things.

This is my biggest issue with the Apple libraries in general. It's an artifact
of the software's bloodline running back to the 80s.

~~~
exelius
Yeah but I get it with libraries: you've gotta provide compatibility so
preserving old ways of doing things is fine. With a new language like this,
it's just making one of the biggest problems with Objective C even worse.

~~~
doctorwho
Apple has never cared about backward compatibility. They kill off libraries
and APIs like unwanted kittens. Yes, it makes everyone sad when they do it,
but the API still goes into the burlap bag and then into the pond. They
continue to break software with each now OSX release.

------
jamieomatthews
> With Google Go, there was no real incentive to use it

I don't like the comparisons to Go in this article. I'm an iOS developer who
has dabbled in Go, and I'd actually argue the opposite.

For me, there is little reason to immediately switch to Swift. I can still use
ObjC, and in fact, I'd expect problems when switching to Swift.

Go, however, had many incentives to learn. Easier deployment, speed,
concurrency, etc.

As usual, Wired has over simplified the argument

------
SideburnsOfDoom
> Chris Lattner spent a year and a half creating a new programming language—

That's not as bad as JavaScript, but most good languages take longer than
that.

Swift doesn't look _bad_ as such to me at a quick glance, just not novel. It's
a "why-bother?" language rather than a "ack, no!" language. If C# version 1
was "The Microsoft proprietary version of java" is Swift v1 "The Apple lock-in
on current practices" ?

~~~
araes
From looking through the article, and what's available online (Apple page and
Wikipedia), it looks like they took most of what folks like about interpreted
languages and just moved them into a compiled form, married to a decent debug
/ testing environment.

It also has a bit of Perl, in that its written so that patterns conform better
to English speaking patterns. For example, they use the "let" keyword to do
constants like:

    
    
      let appleSummary = "I have \(numberOfApples) apples."
    

and they use Javascript-like simple concatenation operators like:

    
    
      str = "hello,"
    
      str += " world"
    

And like Perl, I also like that associative arrays / dictionaries are top
level:

    
    
      let people = ["Anna": 67, "Beto": 8, "Jack": 33, "Sam": 25]
    

After that, it mostly looks like standard evolution. They've taken many of the
top, or high use programming patterns of the current day for i-products and
rolled them into libraries or main functions to speed up development.

It could be good. I do like Javascript and Perl, which look like they had a
child with Objective-C. And that article has a point that its only main
competitor is Obj-C, which is not much of a fight. Now if they'll only allow
you to develop and build on non-Apple hardware.

~~~
kbenson
I don't consider the "let" example to really be very Perlish. The real power
of Perl in it's natural expressiveness is to more closely map speaking, and
thus _thinking_ patterns to how the algorithm is represented. For example,
postconditionals, which allow a single statement to be conditional based on a
condition that immediately follows it. This is a natural way people express
themselves ("do X if Y" or "do A unless B"), but it is wisely restricted to a
single statement as the alternative is less common, less clear. The fact that
swift's let statement sounds like common English when spoken aloud is only
superficially similar to Perl, IMHO.

Additionally some sort of hash/associative array/map data structure at the top
level is (thankfully) common at this point.

I haven't followed swift too closely though, so maybe there's other stuff that
I would consider more aligned with the spirit of Perl.

------
Derbasti
Swift might take over the Apple world, maybe. It is pretty much useless
anywhere else.

~~~
robmcm
and I imagine Apple will want to keep it that way.

Swift will be used as a competative advantage or lock in, depending on your
level of scepticism.

~~~
rsynnott
This is quite a weird idea, really. Even if Swift were open sourced (and it
looks like it may be at some point:
[http://article.gmane.org/gmane.comp.compilers.clang.devel/37...](http://article.gmane.org/gmane.comp.compilers.clang.devel/37217)),
would it _really_ be all that dramatically useful on, say, Android? Good luck
making your GUI app through the JNI. There are a few Objective C apps on
Android, but they're pretty much universally games (there's a Spritekit port).

It doesn't really change the story for developing cross-platform apps at all.

------
niix
Pretty bold headline, fortunately the story was decent. With that said, as
someone who develops JavaScript for a living Swift is very inviting. I've
tried and failed many times to wrap my head around ObjC, but it never stuck.
In messing with Swift the last couple of weeks, I find myself pretty
comfortable and happy the barrier-to-entry is rather low.

------
doctorwho
I know, I'll create another programming language. Now you have N+1 problems,
none of which address the systemic problems with the Apple ecosystem. The
problem was never JUST Objective-C (although it sucks pretty hard). Apple is
REALLY struggling for a win here.

~~~
emgee3
I think 'struggling' is the wrong word.
[http://www.forbes.com/sites/timworstall/2014/04/13/fun-
numbe...](http://www.forbes.com/sites/timworstall/2014/04/13/fun-number-apple-
has-twice-as-much-cash-as-the-us-government/)

~~~
doctorwho
He who dies with the most cash wins? It's definitely a nice position to be in
but money obviously doesn't think up new products.

What was the last true innovation from Apple? I claim it was the iPod. The
miniaturization of music. Everything since the iPod has been purely derivative
of that miniaturization theme.

They've ridden the "Miniaturize all the things" wave hard (and successfully)
by adding more features like accelerometers, GPS, faster chips, more colors,
etc. to keep the fanboys horny but nobody has been really impressed with a new
iDevice for quite some time. Apple is getting stale.

Apple needs a new hardware win that shows that they haven't exhausted their
idea bank AND that they still have the marketing savvy to make people want
what they've got.

Apple has NEVER been a software company. They are definitely struggling if
Swift is the best new things they could come up with.

Where's the hardware?

<crickets>

------
haberman
Wow, had no idea that this was a personal "skunkworks" project by Chris! Very
impressive (and gratifying for him, I'm sure) to have such a thing embraced by
the highest levels of management.

------
Aardwolf
Will this language ever work to write Linux software? (Or Windows)

~~~
simonh
In theory yes, but in practice no. It's constructed around a solid core of the
Objective C object model and runtime. Rudimentary open source versions of
these exist, but they are _very_ rudimentary. The value in those technologies
is all concentrated in the Coacoa and Coacoa Touch libraries and frameworks,
which are proprietary to Apple.

Trying to use these technologies on another platform would be like trying to
develop software using the core of the Python language with none of the
standard library or external libraries (imagine they were implemented in
another language you couldn't port). Or like implementing just the C# language
on another platform, without any of the .NET libraries. It's possible, Mono
did just that, but they had to re-implement almost the entire .NET
infrastructure from scratch, a task many orders of magnitude greater than just
duplicating the language itself.

~~~
rsynnott
> In theory yes, but in practice no. It's constructed around a solid core of
> the Objective C object model and runtime.

Not sure I agree. You won't be making a Cocoa UI in it or anything, but if
they open source the compiler and modifications to the Objective C runtime,
along with the standard library (which is really light right now; you have to
use Cocoa for very simple things), it should be useful enough, with GNUStep.

------
htk
Bullshit title. It's because of cheap tricks like that that I stopped reading
The Verge. It only lacks the "other languages hate it!"

------
waterfowl
I love that LLVM is relegated to "the basis of swift."

Also a $100 entry ticket to a beta IDE/compiler might hinder said adoption.

~~~
rsynnott
Xcode 6 is free, now: [http://arstechnica.com/apple/2014/07/apple-launches-
new-swif...](http://arstechnica.com/apple/2014/07/apple-launches-new-swift-
blog-offers-xcode-6-beta-for-free/)

~~~
buster
Sorry, i can't find a download for Linux, so how is this supposed to take over
the world? :(

~~~
tomelders
You're not alone, people have been asking that about Linux for years.

------
smrtinsert
> But even if Swift remains an Apple-only Oh I would love code Swift on other
> platforms, what could possibly go wrong?

------
jgamman
am i the only person who hates the fact that i have to pay $100 pa for the
right to put my own software on my own iPad - language be damned? @#$#@ that.
i'm taking my tablet needs somewhere that let's me feel as though i've
purchased it, not borrowed it from Steve...

~~~
slashdotaccount
You sound like a Free Software zealot and GPLv3 fan, congratulations and
welcome to the club!

[https://www.gnu.org/philosophy/free-
sw.html](https://www.gnu.org/philosophy/free-sw.html)
[https://www.fsf.org/blogs/licensing/gplv3-lockdown](https://www.fsf.org/blogs/licensing/gplv3-lockdown)
[http://faif.us/cast/2014/jun/19/0x47/](http://faif.us/cast/2014/jun/19/0x47/)

