3 ms·
You can do everything you're saying in Rust. 1. https://docs.rs/dimensioned/latest/dimensioned/ https://docs.rs/dimensioned/latest/dimensioned/ 2. https://doc
by eximius 2y ago
You can do everything you're saying in Rust.
1. https://docs.rs/dimensioned/latest/dimensioned/ https://docs.rs/dimensioned/latest/dimensioned/
2. https://doc.rust-lang.org/std/ops/trait.Index.html https://doc.rust-lang.org/std/ops/trait.Index.html
3. Maybe const generics? e.g., Foo<N: 3> where Foo { array: [u32; N] } or something. You could also do this with less typed-ness with Foo::new_with_capacity(n) and some private size management.
It definitely takes aesthetically from the C-family of languages in the same way that Java and Go are all braces and semicolon languages. I can't exactly minimize this - because I am comfortable with languages that look like this and less comfortable with some languages that don't, so I recognize the effect is very real - but it doesn't affect the features of the language much.