Comment by dbaupp
7 years ago
Note that Rust essentially expresses all of that. It has no magic constructors, and Vec is a block of uninitialized memory along with safe partial construction of array.
It's true that it's dynamic construction (although other similar constructs allow for doing it for statically sized arrays), but it is demonstrating Rust's power: making safe APIs over `unsafe` code without having to delve into the depths of a complicated compiler/proof-assistant. This is exactly what `unsafe` is for: extending what safe code can do by temporarily stepping outside the bounds of what the language directly encodes.
No comments yet
Contribute on Hacker News ↗