Live data from Hacker News

What’s new in Swift 6.2

hackingwithswift.com

121–130 of 258 posts

Re: What’s new in Swift 6.2

#121

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…

Surely developer productivity and maintainability have increased from the ObjC days, no? Swift criticisms aside, it certainly allows access to more ergonomic high-level coding patterns.

Re: What’s new in Swift 6.2

#122
post #94

Earlier quoted context omitted.

I feel the same. Apple software quality certainly hasn’t increased . Years back I remember some apps crashing suddenly after updating MacOS. I checked the binary and saw they’d started adding Swift. Half a decade later it seems like it should be better and Swift stuff should be stabilized. But nope, I’ve had more little glitches in both iOS and MacOS. It’s hard to say it’s due to Swift, and not management priorities.…

It is not just the language but the frameworks. SwiftUI is a wreck, and still not mature even after 6-7+ years in 'production'. You still have to drop to UIKit to do advanced UI, and for what it is, SwiftUI is just not practical enough for cases that are not trivial. The trouble is that all new kids/engineer are learning it first, which means software wont get better. Apple need to improve it first, and I don't see a…

That’s a shame!

I haven’t used Swift UI in a couple of years, but I always thought the basics of it were excellent.

They got the declarative API foundations right I thought.

Shame it’s still flakey.

The preview used to crash constantly last time I used it.

Re: What’s new in Swift 6.2

#123
post #116
post #111

Earlier quoted context omitted.

There’s a section in the proposal about this: https://github.com/swiftlang/swift-evolution/blob/main/propo... Tl;dr: Sequence and Collection are incompatible with noncopyable types and conditionally conforming when elements are copyable would result in too many implicit copies. They’re working on protocols to cover noncopyable collections such as this, which will probably have a similar API shape.

Interesting; if I'm understanding correctly, it sounds like Swift doesn't have a standard lazy iteration API yet? I would have guessed that it did if asked before reading this, but it's good to hear that they're already working on it. Since I feel super spoiled by lazy iterators in Rust, I'm super curious if anyone has more Swift experience and could chime in on if there are other language features or APIs that might…

There are lazy collections, but they’re not default.

Why the protocols are designed the way they are is until very recently all types were implicitly copyable, but most of the collection types like array and dictionary were copy on write; so the copies were cheap. I think in general, though, there are a lot of performance footguns in the design, mainly around when copies aren’t cheap. The future protocols will hopefully rectify these performance issues.

Re: What’s new in Swift 6.2

#124
post #43

Earlier quoted context omitted.

I too wish deprecation with migration path was a more common pattern in today's language development. The language has very much needed work and the numerous bugs within Apple's own libraries certainly hasn't helped. That said, some of the, erm, "new ways" to solve problems have been significant advancements. EG: Async/Await was a huge improvement over Combine for a wide variety of scenarios.

IMO async/await and Combine are two completely different things. What is the alternative to Combine's CurrentValueSubject or combineLatest()?

  > What is the alternative to Combine's CurrentValueSubject or combineLatest()?
combine latest et al can be found in async algorithms from apple*

https://github.com/apple/swift-async-algorithms

* though current value subject is not there its not hard to make one if you need it

Re: What’s new in Swift 6.2

#125

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…

Surely developer productivity and maintainability have increased from the ObjC days, no? Swift criticisms aside, it certainly allows access to more ergonomic high-level coding patterns.

A big one that I feel is under appreciated is how Swift has rooted out nearly all passing around of untyped data, untyped dictionaries, casting without checking, etc in Apple platform projects.

I don’t mind Objective-C when I’m the one writing it and can ensure that the code is responsibly written, but it wasn’t unusual to have to work on existing Obj-C codebases littered with untyped data, casts, etc some amount of which was inevitably erroneous and only seemed to work correctly. Chasing down the origin points of data, fixing a laundry list of method selectors, and adding in checks always sucked with the compiler doing little to give you a hand. With Swift, even in codebases with poor hygiene fixing things is easier since the compiler will yell when something’s wrong.

Re: What’s new in Swift 6.2

#126
post #56

I've been starting to use Swift again lately after like four years, and while the language is beautiful & the package management story is now a LOT better with SwiftPM, I found that none of it plays nicely with XCode, Simulator, or anything to do with iOS/macOS development -- its primary use-case! I found myself awestruck that I *HAD* to use XCode or xcodebuild, and could not just run `swift build` and generate an iO…

I'm confused. You said "none if it plays nicely with Xcode" but then you complain about what the experience is like when not using Xcode.

Re: What’s new in Swift 6.2

#127
post #35

Earlier quoted context omitted.

I can't help but think some of the Swift leads just really like Haskell.

Escaping symbols with backticks to circumvent illegal characters and reserved keywords is a feature coming straight from Scala actually.

Cool. I was smitten with Scala for a while but it was getting too complex after a while. Like Swift and C++.

Re: What’s new in Swift 6.2

#129

Earlier quoted context omitted.

Is having too many ways to solve a problem an issue for solo indie developers?

Right? I don't get this persons sentiment and I don't understand how it relates to the post in particular.

You still have to choose, and remember all the variants.

Coming back to a Swift codebase after a few months in different languages is surreal, I can't remember what half of it means.

Re: What’s new in Swift 6.2

#130
post #28
post #27

Earlier quoted context omitted.

So it's becoming C++?

Considering Swift was primarily written in C++, perhaps Swift was always destined to follow the same path?

Makes some sense, since its developers probably thought C++ was a pretty good idea, it just needed some more features. Same mindset that killed Rust for me.

I gave up on C++ for good reasons, after spending roughly 20 years trying to make sense of it.

Post reply on HN