News for hackers. Stuff that matters.
Re:The Rust I wanted had no future by marcosdumay on Monday June 05, 2023 @12:08PM (#36198408)
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.

Re:The Rust I wanted had no future by paulddraper on Monday June 05, 2023 @12:48PM (#36199118)
Array

Map

Set

WeakMap

Re:The Rust I wanted had no future by dexwiz on Monday June 05, 2023 @04:44PM (#36203337)
TypedArrays 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/Guid...

Re:The Rust I wanted had no future by titzer on Monday June 05, 2023 @12:53PM (#36199207)
> 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.