Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The reason why functional languages like linked lists so much is because they are very easy to make immutable without a lot of pain all around. If you implement an immutable vector in a straightforward way, though, you basically need to do a lot of copying for any operation that needs to construct one (the rigmarole with immutable strings, and existence of hacks such as StringBuilder, is a good illustration of the problem).

But you can have a data structure that is more like vector under the hood while still supporting efficient copy-with-modifications. Clojure vectors, for example.



That makes sense. But LinkedIn lists are horrible for cache efficient things no? I think there was an article on HN from a Golang perspective padding structs or something such that they are efficient wrt to cache hits.


> But LinkedIn lists are horrible for cache efficient things no?

LinkedIn Lists you say? (Sorry. (But not that sorry.))

Edit meta sidenote: in this modern meme world, it's virtually impossible to know if a typo is a typo or just a meme you haven't heard of yet.


LinkedIn lists will tell you they contain one new element, but you have to click on a link and scroll through their suggested new elements to see what it is


Do they also always end with an element that tells you what the LinkedIn list taught it about B2B sales?


lol my phone autocorrected ugh.

But you know what I mean. Some grace would be nice.


I know. It was just too hard to pass up. :)


Well you got me. I audibly groaned and slapped my forehead.


They are, but you don't tend to keep them around in memory long enough. Start consuming the front before you produce the back.


Which is a pity, you can fit entire small arrays in a cache line to end up with no pointer chasing at all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: