4 ms·
It's a fair criticism though, don't you think that in order to use a fundamental aspect of a language (Arrays), one needs to download some external package? Why
by fermienrico 9y ago
It's a fair criticism though, don't you think that in order to use a fundamental aspect of a language (Arrays), one needs to download some external package? Why isn't this built into the core language?
- mintplant 9y agoSee the second paragraph of my comment with regard to representing matrices efficiently with just slices. I would argue that Rust is actually better here than most languages, as its native multidimensional "arrays" (slices) are equivalent in memory usage and performance to single-dimensional ones. More generally, the 1-32 issue should be solved when RFC 2000 is implemented [0]. In the meantime there's generic-array [1], built on top of typenum [2], which you could think of as a sort of polyfill. [0] https://github.com/rust-lang/rfcs/blob/master/text/2000-const-generics.md https://github.com/rust-lang/rfcs/blob/master/text/2000-cons... [1] https://github.com/fizyk20/generic-array https://github.com/fizyk20/generic-array [2] https://github.com/paholg/typenum https://github.com/paholg/typenum
- fermienrico 9y agoThank you for clarifying.