
Winding down the Swift 3 release - milen
http://thread.gmane.org/gmane.comp.lang.swift.evolution/17276
======
claudiug
Now, with swift 3 around the corner, I will ask some most experience fellow
developers the following question. There is golang, swift, rust, dlang. If you
will put some energy, what language will be, and why? :)

~~~
Scarbutt
In the long run, Swift, IMO.

It has all the advantages of Go but with a more expressive language, much
better C interop and a platform that will create a community around it very
quickly, the other day I saw somewhere that there are already more Swift books
and courses than Go. Swift will also let you do everything Rust can, very low
level stuff.

~~~
nardi
> Swift will also let you do everything Rust can, very low level stuff.

Not quite. Swift requires a runtime, so you probably won't see people writing
OS kernels in Swift.

~~~
31reasons
Swift uses LLVM as backend, so as far as I understand it can generate
standalone binaries. No ?

~~~
grayrest
All languages add a bit of code to a binary to make the code you write
runnable. Rust [1] and C add almost none, language like Swift and Go have to
add their GC support code even if it's in the same binary, and jit+scripting
languages generally come with an external runtime.

[1] [https://www.rust-lang.org/faq.html#does-rust-have-a-
runtime](https://www.rust-lang.org/faq.html#does-rust-have-a-runtime) (also
mentions what's in the C runtime)

~~~
autoreleasepool
Swift doesn't have a GC and you can use it to program like C with malloc and
free via UnsafeMutablePointer<T>.

IIRC, Swift's runtime is like C++'s with v-table lookup for dispatch on
functions that do not involve Objective-C objects.

~~~
kibwen
Swift's GC is in the form of pervasive reference counting for reference types
with no automatic cycle detection. Though as we're demonstrating, calling this
GC is contentious, it would be better if people weren't too lazy to type out
"pervasive reference counting for reference types with no automatic cycle
detection". :P

(For the record, I believe Chris Lattner is on the record as saying "yes,
Swift has a runtime, let's not bother arguing that point" though I can't find
the link, but I agree that Swift's runtime is less invasive than most other
languages (e.g. Go).)

~~~
joewillsher
Does saying 'ARC' not work for you? :)

And the Swift runtime is pretty minimal, mostly used for storing dynamic type
information, dispatching protocol methods, generating (unspecialised) generic
types, checking conformances etc. It's mostly used by the compiler to add the
dynamic features of the language; for example, the compiler observes the
lifetimes of variables and inserts retain/release instructions, which are
lowered down to a swift_retain or swift_release calls on the runtime instance.
These functions are implemented in the runtime and do the manipulation of
reference counts and deallocation.

~~~
Someone
It is simpler than a full GC, but I would not call that "pretty minimal". In
particular, weak and unowned references and the guarantee that referencing
them after the object they referred to was deallocated crashes your program
make swift_release nontrivial.

------
augb
I wonder what the implications for Linux of the removal of "Portability" from
the Swift 3 evolution/Readme.md [1] are?

[1] [https://github.com/apple/swift-
evolution/commit/06b69a6e51a7...](https://github.com/apple/swift-
evolution/commit/06b69a6e51a71a462c268da60b51a18966dba31b)

~~~
pkaler
It looks like Portability is not a core focus of the core team. It looks like
IBM is doing a ton of the Linux compatibility work and has offloaded the core
team.

(BTW, shameless plug, I send a weekly Swift newsletter here:
[http://SwiftNews.co](http://SwiftNews.co))

~~~
J0-onas
I hope they suprise us during WWDC.

Most of the time im writing simple and small programms (on a windows machine)
that manipulate data, interact with the web, or work with files.

I really liked Swift from the start. It has all the language features that I
like. Sadly, with no Windows support, and Linux being only a second class
citizen, I'm not motivated enough to spend a huge amount of time with Swift.

I also hope that they provide a documentation like Go. The Swift book is fine
but the examples of the Go documentation in addition to the text, the easy
navigation between packages/structs, and the aility to jump to the
implementation helps a lot while learning the language.

------
ben_jones
Well a whole lot of Swift 2 tutorials probably just go broken (correct me if
I'm wrong).

~~~
greenlinux
Why?

