Hacker News new | past | comments | ask | show | jobs | submit login

> A lack of default arguments, a lack of basic arity overloading, a lack of variadic generics, all make me not want to write Rust.

I'm not sure how serious this is, TBH? I mean, Rust does have macro syntax that supports all of these things (as seen e.g. in println!() and format!() ), and there are pretty solid engineering reasons to avoid those features within the basic workings of the language. I'm pretty sure most Rustaceans would argue that Rust is quite probably Doing the Right Thing here.




In my experience, Rust's multiple named functions is usually (not always) more clear than multiple function overloads, and practically always better than constructor overloads (you'll never convince me that std::vector's constructors are sane). However (IIRC) I wish it was possible in Rust to abstract over arity, in the case of function forwarding and tuple overloading.


I'd certainly like to be able to write std::cmp::max(a, b, c, d) and find the maximum of the four parameters.

But even when I most want that, I certainly don't want it enough to use C++


Oh, another thing I forgot is that you need a crate and a macro to zip 3 or more iterators together.


Why do you think Rust not supporting variadic generics is the right thing?


Because Rust is not C++?


Wouldn't variadic generics make working with tuples of any length easier[1], as const generics did for arrays? If that is the case, then I don't see how Rust not being C++ matters in this case.

[1] https://docs.rs/tuple_list/latest/tuple_list/


Out of everything about rust those are weird reasons to nitpick about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: