debt93·5 年前·議論It is not a "hack". It is the behavior that I expect from a dynamically resizable array.std::vector in C++ does it, so does Vec in Rust, and they are not dynamic languages with GC.
debt93·5 年前·議論Honestly, the fact that AssemblyScript's Array implementation does not double the internal capacity but instead adds just one more slot when reallocating makes me worry about the quality of the language as a whole.I hope it is just an oversight, but come on...
std::vector in C++ does it, so does Vec in Rust, and they are not dynamic languages with GC.