News for hackers. Stuff that matters.
Re:Swift 6 by darby_nine on Tuesday September 17, 2024 @05:32PM (#41573045)
Curious! In what ways do you do you see swift as friendlier than Rust? I perceived it as functionally equivalent, although Swift had a lot more "magic" involved and it was less clear how things might work memory-wise.
Re:Swift 6 by 9dev on Tuesday September 17, 2024 @05:40PM (#41573142)
More magic (thus less required explicitness) and less involvement with memory management are typically considered as friendly traits in programming languages.
Re:Swift 6 by darby_nine on Tuesday September 17, 2024 @06:55PM (#41573762)
> More magic (thus less required explicitness) and less involvement with memory management are typically considered as friendly traits in programming languages.

Really depends on the context. I really, really, really hated this instinct in the ruby on rails community when I was still doing that. Magic is nice until it doesn't work the way you expect, which is when it becomes an active liability.

I really don't spend much time thinking about memory management in Rust, but I can certainly understand why one might be happy to not have to design around ownership and lifetimes. I really like the explicit nature of it, though, makes it super easy to read and reason about code you've never seen before.

Re:Swift 6 by dagmx on Wednesday September 18, 2024 @02:22AM (#41576413)
To me, Swift has better ergonomics for most people.

Ref counting by default makes most programs easier to deal with.

Guard let (though recently somewhat introduced in rust) are much more friendly ways to unwrap optionals.

Being able to provide parameter defaults and aliases.

Easy passing in of callbacks. Easier async.

Null chains with the Question mark operator.

I really like rust, but it’s much faster to get to a working program in Swift.

And with the new CXX interop, I now reach for Swift by default since I have to deal with a lot of C++ libraries.

Re:Swift 6 by darby_nine on Wednesday September 18, 2024 @09:26AM (#41579450)
> Easier async.

I was on board until this one. Async is a rough spot for rust, but I find the async strategy swift went with absolutely baffling and difficult to reason about.

Re:Swift 6 by dagmx on Wednesday September 18, 2024 @02:50PM (#41583936)
I’m curious, what puts you off of them? Actors are pretty standard ways to do it, and I feel like most of the successful rust implementations are actor based as well.