Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by Gigachad on Wednesday January 11, 2023 @08:20PM
(#34347779)
You can solve duplication with macros to implement traits. The Rust way seems to provide the same convenience without the runtime costs.
[ Parent
| on HN ]
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by seanalltogether on Thursday January 12, 2023 @04:42AM
(#34351239)
Macros provide code injection, that's not the same thing. Inheritance allows for overrides so you can have [default super logic]+[custom child logic]. That's only possible in rust with a lot of copy and paste, which can be fragile to maintain long term. Most UI frameworks are built around inheritance to guarantee logic provided by the base view or view group, while allowing for inheritors to mix in custom logic as well