Re:The Janet Language
by otabdeveloper4 on Saturday February 18, 2023 @09:58AM
(#34847347)
If by "list" you mean "linked list", then those are never used in practice. There is no place for this data structure in a modern CS toolbox.
[ Parent
| on HN ]
The people behind the Elixir programming language certainly disagree.
Re:The Janet Language
by otabdeveloper4 on Saturday February 18, 2023 @04:15PM
(#34851165)
Maybe that's why Elixir never gained real traction.
Re:The Janet Language
by mtlmtlmtlmtl on Saturday February 18, 2023 @10:48AM
(#34847730)
That's a ridiculous statement. Linked lists have real performance benefits in some applications. A good "modern CS toolbox" includes the ability to make the right choice. Which, if you believe they are fundamentally useless, clearly you lack.
Re:The Janet Language
by otabdeveloper4 on Saturday February 18, 2023 @04:16PM
(#34851174)
> Linked lists have real performance benefits in some applications.
Maybe in 0.01% of the cases. In reality they just ruin your cache and memory allocator performance for no real good reason.
Re:The Janet Language
by mtlmtlmtlmtl on Saturday February 18, 2023 @05:25PM
(#34851730)
In many cases you can get around these issues by being a little more clever in how you allocate nodes. In some cases you don't have the luxury of allocating all elements next to eachother anyway, in which case an intrusive linked list is often the best option to minimise copying. You might say use a vector of pointers or a circular buffer, but if you're in a timing sensitive context you might be unable to realloc.
Hell, memory allocators themselves are often implemented using some form of linked list. You tend to see them quite a bit at very low levels like in kernels.