by kibwen · 9y ago · 0 comments
Overloading as in operator overloading? Because I don't see how that would affect symbols.
Though along with namespaces and generics, there is one thing that Rust also bakes into symbols: versioning information. This is how, in the case of deep dependency graphs, it's possible for a finished binary to include multiple copies of the same library in the event that multiple versions are transitively depended upon. But that doesn't add any complexity to symbol mangling on its own, because if you already have namespaces then you can just treat it as a namespace that only the compiler can see.
So like:
int do_something(int param);
int do_something(double param, char *param2);
I don't see how you can avoid some form of name mangling since obviously you can't just define two duplicate "do_something" symbols.(This isn't the only way to end up with duplicate symbols, just trying to make it clear that this specifically won't be a problem with Rust.)
Ugly? Yes, IMO, but it also is useful.