
Swift 5.0 release process - OberstKrueger
https://swift.org/blog/5-0-release-process/
======
ainar-g
My memory might fail me, but I thought Swift 4 was supposed to be "the last
major breakage"? Swift has a new major revision every year.

Compare this to Go (no major revisions after 6 years, probably a backwards-
compatible major revision in 2-3 years) and Rust (no major revisions after 3
years, but with a mechanism called "editions"). To say nothing about Java or
C#.

~~~
xenadu02
Neither of those languages launched out of the gate with a stable ABI. Prior
to Rust 1.0 it was much the same, with regular breaking changes. C++ famously
took many years to have a stable ABI.

Swift 5 represents a stable ABI. That means from this point forward all
binaries built with Swift 5 or later will run against a newer Swift stdlib.

The ABI is entirely separate from source compatibility. Swift is already
source compatible and the bar for a source-breaking change is extremely high.

~~~
coder543
The Swift 5 release process document specifically implies that some Swift 4
code will not compile on Swift 5. This discussion is about source
compatibility, not binary compatibility, which neither Rust nor Go offer
AFAIK.

The number 5 _also_ implies significant breaking changes. Otherwise, why
wouldn't it be Swift 4.3?

Removing Swift 3 compatibility mode (which was part of Swift 4) is itself a
major source-compatibility breaking change, even if nothing else.

~~~
slavapestov
So far there are only a handful of small breaking changes between -swift-
version 4 and -swift-version 5 on the master branch. The only ones I can think
of are a type safety hole getting plugged and some warnings for corner cases
around access control that got promoted to errors.

~~~
coder543
If that's the case, that's encouraging to hear.

------
dep_b
What I really miss in Swift are user definable attributes. Also I would like
to have the Objective-C attribute that requires you to always call super. I
don't think that Swift even honors that attribute if it is defined in
Objective-C.

I consider it weird that the "where" keyword can't be applied in more places,
only in case and for ... in I believe it works. Seems like some weird remnant
of "what cool feature of C# could we borrow?" that never really got a full
rollout.

Also I would like to have a "not" keyword instead of using the easily
overlooked !. Such a nice feature of F# (and Visual Basic?).

Good to see count(where:) coming to the language, I often missed it. And
probably is faster than filter since it doesn't create an array of results
first.

Apart from that Swift 5 doesn't seem to be super different from 4. But that's
what I expected already.

~~~
eridius
Where do you miss user-definable attributes from? I'm not aware of any
analogous ObjC feature.

The `where` keyword is also used when defining generic functions/types. As the
expression level, it used to be used in `if` too, but that syntax was changed
such that it no longer uses `where` (but still retains the same power). Where
else were you expecting it to be used?

You can do a non-allocating `count(where:)` today with `lazy.filter(where:
…).count`.

~~~
dep_b
C# has them. Java too?

------
SkyPuncher
It's been two years since I last worked with Swift. I absolutely loved Swift
as a language but abhorred these updates.

It was an absolute nightmare to get a project updated then spend hours and
hours fixing stupid issues with dependencies.

~~~
charlesism
That was dreadful, but it's not like that these days. The past year none of
the updates broke anything in my code.

------
bsaul
Question for the HN language designers: do you think it's possible to provide
ABI stability when the language still doesn't provide the full promised
features for concurrency ? (ex: async / await, agent based concurrency, and
all the features talked about in chris lattner's concurrency manifesto)

~~~
favorited
According to the draft async/await proposal, the ABI changes are additive, so
in that case yes.

[https://gist.github.com/lattner/429b9070918248274f25b714dcfc...](https://gist.github.com/lattner/429b9070918248274f25b714dcfc7619)

~~~
helge5
An ABI can't really be "additive". If you add stuff to an ABI, it's a new ABI.
Unless you tweak the definition of ABI to your liking (like introducing new
concepts as "module stability").

Let's say you have an iOS application written in Swift 5 and you are using
AlamoFire. The original promise of an ABI (like the C ABI, the ObjC ABI, COM,
JVM, etc) is that AlamoFire could choose to switch to Swift 6 because of the
great new async/await features, and you could still use that binary in your
Swift 5 application. Because, you know, there is a stable ABI ;-) If you
enhance the ABI, that won't be usually possible. E.g. the Swift 5 program
won't understand the "new mangling and calling convention" mentioned in the
link. Presumably it could be bridged somehow, or maybe not in a useful way ...

~~~
slavapestov
> An ABI can't really be "additive". If you add stuff to an ABI, it's a new
> ABI.

Not really. You can add new concepts to an ABI without breaking existing code.

Suppose version N+1 of some compiler adds a new language feature, like
async/await or whatever. It might involve a new calling convention and symbol
mangling for async functions. However non-async functions would not be
affected.

Of course if the library author removes old entry points they will break old
client apps, but that's not a property of the compiler.

------
dep_b
Can I find a list of accepted changes and proposals for 5.0 somewhere?

~~~
slavapestov
[https://apple.github.io/swift-
evolution/#?version=5](https://apple.github.io/swift-evolution/#?version=5)

------
mpweiher
"The primary goal of Swift 5.0 is for the language to achieve ABI stability."

"Apple’s Chris Lattner, original creator of the Swift language, has recently
announced on the Swift Evolution mailing list that ABI stability, one of the
goals originally planned for Swift 3, will be postponed."

[https://www.infoq.com/news/2016/05/swift-3-no-stable-
abi](https://www.infoq.com/news/2016/05/swift-3-no-stable-abi)

~~~
bsaul
Except they're announcing a feature freeze for november 2018, so unless
something major happens i don't think we'll get any surprise here..

~~~
helge5
Well, one "surprise" is that a new thing called "module stability" was
invented. The Swift ABI isn't going to be the ABI-thing you are used to from C
(or COM) or JVM or, well ABIs ;-) And sure, they'll give you an ABI. But
whether that is going to be a _stable_ ABI is to be seen. I have some doubts
given the complexity of the language, but we'll see how it turns out.

------
smaslennikov
I posted this on #swift in freenode and they kicked me out.

~~~
eridius
That's because #swift has nothing to do with Apple's Swift language. The
correct channel is #swift-lang.

~~~
smaslennikov
do you know which cappucino machine is best for steaming an egg?

------
dzonga
Swift suffered the fate, of being a language developed by an academic to say
and developed within a large corporation. It ended up being a complex language
with useful features. Newbie hackers can't at all master protocols, generics
and all the cruft. If it was simple as GO, and from day one designed to run on
servers instead of iOS, Swift would've had incredible adoption given features
as optionals, type safety and python/c like syntax & first class functions.

~~~
millstone
1\. Chris Lattner is not "an academic" by any measure. He industry creds are
stiff stuff.

2\. "Newbie hackers" can and have mastered Swift and similarly complex
languages.

3\. Apple would not be interested in developing a language to "run on servers
instead of iOS."

4\. Get a life troll.

------
patientplatypus
OK...stupid question.

Why not use Flutter? Even React Native is cross platform. Why are we still
using a programming language for a phone app that means we have to write the
darn thing twice? Even a RN webview pointing at an IP with code written in
whatever-lang is seemingly a better choice.

~~~
bsaul
Have you ever developped anything serious with swift ? Honestly, this is by
far the best language i've developped in (including go, java, c#).

Note that i'm talking about the _language_ here. The libs are of various
quality. But powerful enums & switch + null safety + generics while retaining
the ability to be learned easily by any "regular" developer makes it a
category of its own.

My secret hope is that someone somewhere is working on a flutter equivalent
coded in swift.

~~~
phreack
Then you ought to try Kotlin! It's a lot like Swift but with great libs and
tooling.

~~~
millstone
Surely the question of using Kotlin is dominated by whether or not you can
tolerate the JVM.

~~~
singularity2001
you can compile to native with kotlin-native but compilation times are even
more abysmal than the jvm kotlin.

