Live data from Hacker News

What’s new in Swift 6.2

hackingwithswift.com

191–200 of 258 posts

Re: What’s new in Swift 6.2

#191
post #161
post #153

Coding in both swift and rust is really a funny experience. It's like two roads being built going toward the same city, but starting from widely different places.

which is better?

The actual targets are very different. For Rust is to be memory safe and available at any level starting from embedded. For Swift it is to be readable.

Re: What’s new in Swift 6.2

#192

Honest question. Not trying to troll. One of the pitches in the earlier days was “C/Objective-C OK, but you can’t write safe/next level code with it—-Swift will close that gap.” N years later, it doesn’t feel like there has been a step change in Apple software quality; if anything Apple software feels less solid, and looks cool “look what I did” extension points. I mean, some of the tings you could do with runtime ca…

Software written in a simpler language like Objective-C - verbose, fast to grok and fast to compile is actually more maintainable in the long run than a so-called "developer friendly", humongous, complex and slow-compilation language like Swift. A lean language reduces the surface area for beautiful expressiveness by clever people - making sure the dumb/junior guy who is maintaining your project in the future can act…

It's easier to read and navigate a well-written Swift codebase than a well-written Objective-C codebase

Conversely, it's easier to debug an Objective-C app than a Swift app, simply because compiling and debugging is so much faster, and debugging so much more reliable

I don't know about a software quality drop being attributable to the migration to Swift. So many other things have also happened in that time — much more software that Apple produces is heavily reliant on network services, which they are not very good at. I find Apple's local-first software to be excellent (Final Cut Pro X, Logic, Keynote) and their network-first software is hit-or-miss

They have also saddled developers with a ton of APIs for working with their online services. Try to write correct and resilient application code that deals with files in iCloud? It's harder than it was to write an application that dealt with only local files a decade ago!

Swift is easy to blame, but I don't think it's responsible for poor software. Complexity is responsible for poor software, and we have so much more of that now days

Re: What’s new in Swift 6.2

#193
post #161
post #153

Coding in both swift and rust is really a funny experience. It's like two roads being built going toward the same city, but starting from widely different places.

which is better?

i think i prefer swift as a language, and rust as an ecosystem. The amount of quality libraries in rust is astounding.

But that may change with swift getting more and more into safety and reaching the limits of how many keywords a language can have and remain descent. I honestly don't know what the feeling of learning swift would be like today.

And on the other hand, i don't see how the rust language can really get nicer without sacrificing on a few design decisions and goals (in order to keep the language extremely versatile).

Re: What’s new in Swift 6.2

#194

Mostly nonsense updates. Swift was my favorite programming language after C++/Java since 2014. I've been faced major updates few times happily. It was one of the most easiest language. But now, I tried to update a project from Swift 5.x to 6.x which has 150+ source files itself and no external libraries which is written by my own use and it has almost all swift 5.x features. They made up Swift as super hard. I decide…

My guess is you've encountered issues with actor isolation made suddenly explicit in your language upgrade. This is exactly what's addressed in Swift 6.2, so it won't be nonsensical in that case. Speaking from my personal experience of trying to upgrade and stopping.

The moment this language version is released I will move to Swift 6. In our project case it will happen. with no source code changes.

Re: What’s new in Swift 6.2

#197

"a new Observations struct that is created with a closure, and provides an AsyncSequence that emits new values whenever any any @Observable data changes" Is this another asinine onChange()-style mechanism that actually means WILL change? In other words, it tells you BEFORE the value is set on the object, so you can't do jack squat with it much of the time. That's the M.O. of onChange now, which is utterly brain-dead.…

> Truly incredible that they not only defaulted, but LIMITED change-detection to WILL-change

That's not strictly true. You get the new value inside the closure. This is very useful for observing changes on data model that drives SwifUI from outside of SwiftUI. Before you had to write the code like this to achieve that:

func startObservation() { withObservationTracking {

        print(store.state.toggle) // Here we have the new value (+ it is called once before any change)

    } onChange: {
        Task { startObservation() }
    }
}

Re: What’s new in Swift 6.2

#198
post #3

I have not looked at Swift since I last wrote some around maybe v3. I hear that it's generally not a competitor to Rust, and is only really useful within the Apple ecosystem. Why is it not more useful as a C++ alternative, since I think that's kind of what the initial goal was? Is it just that non-Apple support is new-ish and not yet matured? Or a more fundamental issue?

Unlike Rust, it has some C++ binding, which is extremely useful.

Re: What’s new in Swift 6.2

#199
post #135

Earlier quoted context omitted.

I'm trying and failing miserably to think of a single example of such a language.

.NET allows pretty much anything except a space, i think?

And you can call into .NET (I assume that means C#) directly from Swift?

Re: What’s new in Swift 6.2

#200
post #132

Earlier quoted context omitted.

And no Steve Jobs to pull them down to earth.

Steve Jobs, of course, was always involved in the details of programming languages targeting his platform.

I wasn't there so I can't say for sure.

But my impression watching from the outside is that he had a finger in every pie.

Post reply on HN