Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Containers [POLL][PERCEPTION]

Name: Anonymous 2011-09-26 1:44

You stumble upon a new programming language.

1) The programming language has a main built-in data type called list, used as such: l = [1,2,3];. What would you normally expect of the underlying implementation -- would you expect it to be a linked-list (random access O(N)), an array (resize O(N)), or perhaps an unrolled link list (random access and resize amortized O(log(N)))?

2) You discover that the programming language also has a built-in data type called array. How does this affect your assumptions relative to list, and what will your new expectancies relative to array be?

Name: Anonymous 2011-09-27 9:22

>>23
Cons cells implemented as simple linked lists on top of a naïve memory pool allocator (that obviously doesn't care about cache locality) are great way to load useless shit into most of your cache. I can't see how you can possibly think that linked lists are a better idea than unrolled linked lists, unless of course you're writing most of your Common Lisp code imperatively, in which case you should be taken outside to the parking lot and shot.

[]non-generic[/b] hash tables
You mean the ones where you can't supply your own comparator function so it uses the reference casted to an integer as a key? Yeah, no, no thanks.

other generic data structures are bad
A language whose standard library doesn't supply a B-heap or B-tree data structure isn't worth its salt.

The STL especially is a crime against humanity.
I agree, but we're talking about decent languages here, which excludes C++.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List