@IceWolf@masto.brightfur.net @roxy@chitter.xyz @sodiboo@gaysex.cloud js calls that an "array" bevause thats what it is : a contiguous slice of same size values (pointers) , pointing to arbitrary values .
-
@lizzie @fiore @roxy @sodiboo I don't know if any have ones that aren't constant time. But whether they're constant time or not is an implementation detail. Whether it's an array or not is how you use it, right? Why would it stop being an array if you change how it's implemented? That wouldn't make any sense.
-
-
-
-
@IceWolf@masto.brightfur.net @lizzie @roxy@chitter.xyz @sodiboo@gaysex.cloud the point here being ?
-
@IceWolf@masto.brightfur.net @lizzie @roxy@chitter.xyz @sodiboo@gaysex.cloud the point here being ?
-
@IceWolf@masto.brightfur.net @lizzie @sodiboo@gaysex.cloud if youre trying to say that a utf8 string then is just "an array of utf8 scalars" then i am sorry but it is just plain wrong and i dont see the point in arguing about it tbh
-
@IceWolf@masto.brightfur.net @lizzie @sodiboo@gaysex.cloud if youre trying to say that a utf8 string then is just "an array of utf8 scalars" then i am sorry but it is just plain wrong and i dont see the point in arguing about it tbh
-
@lizzie@brain.worm.pink @fiore@brain.worm.pink @IceWolf@masto.brightfur.net I think there is an important distinction to be made between an abstract collection and an actual data structure.
like a "dictionary"/"map" or a "set" or a "finite sequence" are not data structures. they are kinds of collections with a specific interface, and they don't have specific performance characteristics. but an array or linked list are two different concrete data structures of a fixed-length sequence that have different characteristics. likewise, a hashmap and hashset are concrete data structures that implement a dictionary and a set with hash functions, but a B-tree map/set is a very different implementation that depends on the keys being ordered.
most programming languages expose concrete data structures and state the performance characteristics you can expect from everything in the standard library.
some languages don't tell you, however, and just give you the abstract collection. Nix for instance has "lists". and honestly they feel like linked lists (builtins.tailto chop off the first element, for instance). you'd be forgiven for thinking it's just like Haskell, which Nix draws inspiration from. but prank! it's arrays and thetailoperation is super inefficient actually!
but if a language calls it an array, I do generally expect it to be a real array. -
-
R AodeRelay shared this topic
-
@lizzie@brain.worm.pink @fiore@brain.worm.pink @IceWolf@masto.brightfur.net I think there is an important distinction to be made between an abstract collection and an actual data structure.
like a "dictionary"/"map" or a "set" or a "finite sequence" are not data structures. they are kinds of collections with a specific interface, and they don't have specific performance characteristics. but an array or linked list are two different concrete data structures of a fixed-length sequence that have different characteristics. likewise, a hashmap and hashset are concrete data structures that implement a dictionary and a set with hash functions, but a B-tree map/set is a very different implementation that depends on the keys being ordered.
most programming languages expose concrete data structures and state the performance characteristics you can expect from everything in the standard library.
some languages don't tell you, however, and just give you the abstract collection. Nix for instance has "lists". and honestly they feel like linked lists (builtins.tailto chop off the first element, for instance). you'd be forgiven for thinking it's just like Haskell, which Nix draws inspiration from. but prank! it's arrays and thetailoperation is super inefficient actually!
but if a language calls it an array, I do generally expect it to be a real array.
"]