3 ms·
Almost all high-level languages have builtin containers. I do think it's a bad fit for Rust (at least for what Rust became), but it's not the end of the world b
by marcosdumay 3y ago
Almost all high-level languages have builtin containers. I do think it's a bad fit for Rust (at least for what Rust became), but it's not the end of the world by itself.
The fact that JS has about 3 of them (is it only 3? I'm not sure of this), with different interfaces, and non-usual behavior is what creates problem there. But other languages quite successfully make their own containers either different enough or similar enough that it's not a problem.
- paulddraper 3y agoArray Map Set WeakMap
- dexwiz 3y agoTypedArrays are also their own thing. But unless you are reading binary files/WASM, most JS devs don't use them. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Typed_arrays https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...
- titzer 3y ago> The fact that JS has about 3 of them (is it only 3? I'm not sure of this), with different interfaces, and non-usual behavior is what creates problem there. V8 has over 35,000 lines of Torque, the DSL for describing these kinds of built-ins. Big chunks of that are dealing with Array methods like splice, sort, from, foreach, etc; and then there is stuff like BigInt, arguments object, a zillion methods on strings. > Almost all high-level languages have builtin containers. I don't think that's really true. Maybe for Python and Ruby, and other dynamically typed languages. I dunno about Swift. But it's not really true for Java or C#. Those languages have their collection/containers libraries written in themselves. Java has other problems separating the language from the libraries, but it's not due to collections.