I have done now some rough performance tests and (to my surprise) linked-lists are a bit faster than array. (And of course they get faster and faster the more transformation you add). But both are very fast and there is not so much difference on V8 especially with the build in map/filter/reduce functions of V8. Just construction using (::) is much faste with linked-lists.
So performance wise there is not much difference other wise I have the following pros/cons
pros - for having a differnt implementation for lists:
- closer to yeti
- as you say have two data-structures with different characteristics
- lazy lists (+ transformations)
- slightly more performant
- more save from accidental muatation - but not guranteed
cons:
- have to cast when using with JS
- less clear semantics regarding sideeffects (ie when was/will be the mapping performed, is the result cached or is it reevaluated each time the value is accessed etc). Arrays are always immediate evaluated and just once.
- lazy lists are very dangerous for memory-leaks (as you have pointed out)
The last point (memory-leaks) is my main concern. I think in JS with all its events and async functions lazy-infinte-lists will be much more used than in 'traditional' JVM enviroments. So I'd rather have a seperate sequence/iterator type for that instead of the :. operator to encourage use of that type instead of lazy lists.
Chris