Live data from Hacker News

What’s new in Swift 6.2

hackingwithswift.com

221–230 of 258 posts

Re: What’s new in Swift 6.2

#221
post #186

Earlier quoted context omitted.

Have you tried Skip Tools yet? It’s a set of tools intended to do just that. https://skip.tools/

Skip tools is pretty cool and I very may well use it for at some point, but it works by translating Swift+SwiftUI to Kotlin+Compose and I’d prefer a more direct approach that lets me build Android binaries with Swift (preferably with the whole of UIKit available, though that’s not likely).

From the FAQ…

> Skip supports both compiling Swift natively for Android, and transpiling Swift into Kotlin. Read about Skip’s modes in the documentation.

https://skip.tools/docs/faq/#modes

Re: What’s new in Swift 6.2

#222

Earlier quoted context omitted.

No one tests multi-user functionality, afaict.

It’s insanely buggy. My wife has two user accounts, one for her work and one for everything else, so she can switch out of the work user at the end of the day to put it out of her mind. She comes across bugs on the regular that I’ve never seen in 16 years of Mac use, but only when the other user account is logged in (i.e. quick user switching rather than a full log out). Stuff that user accounts shouldn’t even make a…

His has been my experience as well. The changes from System Preferences to Settings have been an abomination. Previously we had uniquely designed layouts for each setting. Now everything is a list. Now menus scroll without any indication that there’s more content. “Sheets” are no longer resizable and take up the center of the view. User space networking (cool) hangs while pegging one CPU (lame). Everything requires special permissions and several times a month I’m having to figure out why a program can’t access something. Writing programs forces using Swift UI APIs that don’t have equivalent functionality to their App Kit versions.

After over 20 years, I’m really unhappy with macOS. The last five years have have been a huge productivity regression.

Re: What’s new in Swift 6.2

#223
post #70

Earlier quoted context omitted.

yep can confirm swift build works, at least i was able to build a MacOS app and avoid Xcode at all costs thanks to it phew

yep Swift build Works magnificently but only for Mac so far

ohh gotcha, well hoping it gets linux/win support soon too, it's great!

Re: What’s new in Swift 6.2

#224
post #215

Earlier quoted context omitted.

The HTTP status enum example is a _terrible_ one. If you need to represent HTTP statuses and call them by their integer names, why not just pass the damn integer itself? It's exactly what you get in `HTTPURLResponse.statusCode`, and you can already `switch` against it. Already not looking forward to the code that undiscerning devs will mindlessly write just because someone with a huge following wrote a blog.

You can’t exhaustively handle an enum with just an integer.

You want to exhaustively handle all 500 valid HTTP status codes (cf. RFC 9110)?

Re: What’s new in Swift 6.2

#225
post #5

> So, rather than writing > > @Test("Strip HTML tags from string") func stripHTMLTagsFromString() {...} > > we can instead write > > @Test func `Strip HTML tags from string`() {...} Maybe I'm just really new at programming, but this seems like an absolutely bad feature, and the example actually perfectly proves it: You really want to name a function "Hello World!" instead of helloWorld, just so your stack traces can…

The feature is fine but there are better reasons to introduce it. For macro generated code it is convenient to use identifiers that people won't accidently use in their own code. The ability to use arbitrary identifiers solve that.

It lessens the likelihood of a collision, but doesn’t remove it.

Re: What’s new in Swift 6.2

#226
post #45

Earlier quoted context omitted.

The feature is fine but there are better reasons to introduce it. For macro generated code it is convenient to use identifiers that people won't accidently use in their own code. The ability to use arbitrary identifiers solve that.

The other reason is interop with other languages, which might have their own rules for identifiers.

You can always work with aliases in that case. No strict need to “contaminate” a language with foreign identifier syntax, in particular if it’s still not 1:1 due to the backticks (e.g. identifiers containing backticks).

Re: What’s new in Swift 6.2

#227

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…

As someone frequently flipping between Swift and Kotlin, while I don’t necessarily feel like Swift is massively superior, I often find myself thinking “why is this so quirky and pedantic” when writing Kotlin. For example, I really really wish Kotlin would adopt Swift style if let/guard let statements. Kotlin smart casting doesn’t work just often enough to not be able to consistently rely on it and the foo?.let { } sy…

The ?.let syntax is terrible. I don’t see how anyone thinks it’s better than doing a normal if != null check.

Re: What’s new in Swift 6.2

#228
post #98

Earlier quoted context omitted.

I don't use the new concurrency features, as they are one of the main culprits of this mess. (so stick with 5.x) SwiftUI is a wreck, that is still not good for advanced UI and you still have to use UIKit for some parts, and Taking Objective-C, with DispatchQueue, and some modernization of it, and some new data structures, which it need, was all it was needed to make a good new langue. It could have been Apple's rival…

> SwiftUI is a wreck, that is still not good for advanced UI and you still have to use UIKit for some parts, and Skill issue. *ViewRepresentable exists.

You are making my point... if you have to use ViewRepresentable in half of the app, then SwiftUI failed. It was supposed to completely replace UIKit, but now it is just another framework to work with...

(makes easy things super easy, but harder/complex things harder).

It has some ways to go......

Re: What’s new in Swift 6.2

#229

Earlier quoted context omitted.

> SwiftUI is a wreck, that is still not good for advanced UI and you still have to use UIKit for some parts, and Skill issue. *ViewRepresentable exists.

You are making my point... if you have to use ViewRepresentable in half of the app, then SwiftUI failed. It was supposed to completely replace UIKit, but now it is just another framework to work with... (makes easy things super easy, but harder/complex things harder). It has some ways to go......

Many developers have no issue achieving their desired designs with Representable or just swiftui.

Re: What’s new in Swift 6.2

#230
post #131

Earlier quoted context omitted.

Yes. Garbage collectors also call free. They call functions. They do all kinds of things. They even increment and decrement reference counters on your behalf. When there’s a system that manages your memory for you at runtime, that’s a garbage collector. Swift is great. And reference counting is exactly the right kind of GC for UIs because there are no pauses. But GC it still is. And it wrecks throughput and is not ap…

> Yes. Garbage collectors also call free. They call functions. Ok, what is calling `free` here? Point to the garbage collector. Show me the thing that is collecting the garbage. > And in reference to `shared_ptr`, or Rc and Arc in Rust, that's manual memory management because you're doing it... manually. You're also doing it manually when you decide to make a type a class in Swift. You're opting in to reference count…

The garbage collector is what wraps every reference to every object on the heap.

But fine, no GC. I wonder why every language in the world doesn’t use reference counting, since it’s not GC AND you don’t have to clean up any memory you allocate. I guess everyone who ever designed a language is kinda dumb.

Post reply on HN