Poll: what do you strongly dislike about Swift?

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.

8 Likes

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.

4 Likes

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.

Dave

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 = [
    1,
    2,
    3,
]

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.

4 Likes

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

let array = [
    1
    2
    3
]

let array = [1 2 3]

if let f = foo
   let b = bar
{
}

if let f = foo, let b = bar {
}
1 Like

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.

What do I strongly dislike?

  • It's become esoteric and Apple centric - and far away from the original intent.
  • It lacks easy to use network IO - and NIO is nowhere near fiinished.
  • SwiftUI is slow and useless for real time data - and is only available on Apple.

Well you did ask.

3 Likes

what was the original intent?

2 Likes

I believe there's a lot more adoption by the community and development by people outside Apple. The language workgroup was separated from the Core Team recently and people outside Apple are now also deciding on the new features accepted into the language along with the overall language direction. Swift on server has also gained a lot of momentum and there are also open-source projects to compile Swift to WebAssembly to run on the web. Another exciting development is the Swift on VS Code extension that will allow people to ditch Xcode altogether and streamline development on non-Apple platforms.

I'm not very familiar with networking, but it'd be more constructive to share which parts of NIO are not there yet, or at least broad examples of a bad workflow.

SwiftUI is not a part of the Swift project, but there are open-source alternatives being worked on. The most notable one is TokamakUI, which is quite nice for static websites.

4 Likes

Lack of covariance for generic types except for the collection types in the standard library.

3 Likes

I do this but in a binary search, comment out one half, then either half of that or half of the other half, etc. Gets you there in log_2 n steps...