Poll: what do you strongly dislike about Swift?

That's just part of the charm of living on the bleeding edge of development. You've fixed or bypassed all your AutoDiff compiler crashers, only to spend hours investigating another crash that's in another aspect of the compiler. The ratio of unique compiler crashers I've reported to the amount that I've seen fixed is pretty dismal (10:1). This is why you have the privilege of learning SIL, C++, LLVM, and spendings days of your own precious time fixing one compiler crasher impacting your project.

This is obviously sarcastic, but it highlights a possibly underemphasized issue. Could we compare the compiler's crashiness to other languages like Rust and Julia?

Sure thing:

10 crashers found in 54 days. 0 of them have been fixed. But in all seriousness, I am not fixing them because my priorities lie elsewhere. Just narrowing/reporting them (takes hours each time) is doing my due diligence and responsibility for the sake of the compiler.

Edit: Also, in the first bug I mentioned, the compiler froze my computer and I had to reboot it. This is a 2021 M1 Max MacBook, so it’s a pretty stable computer.


There's also the automatic reporting which sends the crash reports to Apple. I've sent in so many of those that they probably thought it was a DOS attack.


Wow, that’s impressive!

Even better - had I not accidentally deleted a line before committing something to GitHub and compiling it on a cloud computer, I would have never discovered the bug! Who knows how many unique bugs exist with the capability of shutting down your computer? 10? 100? 1000? Is it an anomaly of combinatorics?

1 Like

Wish there is a Foundation of sort that pay interested people to improve the Swift compiler. Not just by Apple employees because obviously Apple lack the right resources to fix bugs somehow.

So many billionaires in Apple and none that I know do a little charity for our wonderful but seriously buggy Swift.

who would fund such a foundation?

Some combination of membership dues, licensing/certification fees, and
an endowment could fund a foundation dedicated to developing Swift.


1 Like

While we were speaking, I found yet another compiler crasher. It’s become such a routine task now. To be fair, half of these are bugs with AutoDiff, rather than other areas of the compiler.

Can't overload assignment operator.

Interesting. I wish I could type more commas. Seriously. In arrays, one can:

let array = [

But in if or guard statements (or parameter lists), one cannot:

if let f = foo,
    let b = bar,

Accepting the extra comma is useful when you're working with long lists of these items arranged vertically, and you're rearranging or adding or copy/pasting, or the code is being generated by something.


Wouldn't it be better without commas or when they are optional?

let array = [

let array = [1 2 3]

if let f = foo
   let b = bar

if let f = foo, let b = bar {

I actually like the commas, in general. I just want the trailing comma to be optional.

1 Like

I've always liked the idea of commas working like semicolons do in Swift, which means you'd both be able to drop some commas which are currently required and add some commas in places they're currently forbidden. I have not attempted to investigate if this is actually plausibly doable in Swift's syntax, though.

1 Like

ah, i see, the trailing comma for if-statements aren't possible...

yea im ok with that too, its less incongruous for sure, just wish commas could be a little like semicolons and be optional where they aren't strictly needed...

on that note too, i kind of wish swift (or perhaps the language server?) had syntax auto-fix so i can stop using annoying (bolt-on) build scripts like swiftlint that blow away my undo stack every time they run... id much prefer these fixes would be built-in to swift itselfand autocorrect my syntax as i type...

1 Like

This was pitched and discussed at length in 2019.