Things I miss in Rust after working in Swift: argument labels everywhere, not just when initializing structs
Things I miss in Swift after working in Rust: eliding labels when the argument is just that name again
Conversation
there was briefly some interest in introducing named function args to rust, but it's a bit grosser because backcompat is a thing. either they'd have to be optional or nothing existing could adopt them. Also `(_ arg1: Ty)` would have to be "have a named arg with same name"
3
4
A bold move would be to take a leaf from Swift's book and treat them as part of the name, allowing foo() and foo(bar:) to coexist. That provides a migration path for existing APIs, albeit a very messy one.
2
1
They could also just be edition-based: if both the caller and the callee are using Rust 202Y, argument label rules are enforced; otherwise they're not.
1
1
rust has culturally always been hostile to most kinds of overloading (obvious exceptions and workarounds exist, but nevertheless) so label-based overloads would be a pretty big non-starter imo
editions are possible,
1
3
If they're a part of the function name they're not really overloading though. But of course that same logic sorta already would apply to overloads with different numbers of arguments
1
5



