News for hackers. Stuff that matters.
Re:Swift is a more convenient Rust by SneakerXZ on Friday September 06, 2024 @07:16AM (#41465045)
> Swift use value-types by default with copy-on-write semantics.

This isn't true. Copy-on-write semantics are implemented only for arrays, dictionaries, and strings. Swift value-types are copied immediately.

https://docs.swift.org/swift-book/documentation/the-swift-pr...

Re:Swift is a more convenient Rust by naman34 on Tuesday September 10, 2024 @07:08PM (#41506561)
The documentation uses “copied” for value types that are copy-on-write.

The documentation has oversimplified a bunch of the mental model and it causes incorrect understanding.

Swift’s documentation is quite bad TBH. The biggest thing that still needs to be improved a lot.