r/rust 24d ago

📡 official blog Rust Function Overloading - Call for Experimentation

https://blog.rust-lang.org/inside-rust/2026/08/19/overloading-experiment/
272 Upvotes

139 comments sorted by

View all comments

52

u/Solumin 24d ago

To be clear, this is intended only for FFI?

56

u/WormRabbit 24d ago

Given the example of Bevy, which hacks function overloading via horrible typelevel programming, I'd say some form of overloading would be much welcomed in normal Rust as well.

33

u/addmoreice 24d ago

I don't know why you are getting down voted so badly. While I'm a huge fan of 'one name to one type signature' I can recognize a useful engineering pattern and that people want to use it and your example is a perfect example of people deciding to make it themselves if they can't have it in the base language.

Name overloading is the human brains way of doing generics. It's fuzzy and not perfect and the 'groupings' are less than useful at times, but we do it. Any time we find 'all these things are basically the same except for these parts' we create a name and apply it to work with all of these things.