Hacker News new | ask | show | jobs
by seanmcdirmid 4579 days ago
That persistence can be quite expensive for non-linked collection classes (like say lists, maps), finger trees non-withstanding; though at least in 2006, such immutable collection classes were implemented as being mutable with some safe sharing for performance reasons.

These decisions must be made pragmatically and being ideological about it isn't very useful. Scala is a great language for both functional and imperative programming when you need it.

1 comments

This is no longer the case, in Scala 2.8 they were replaced with persistent collections based on the work by Phil Bagwell, afaik they are faster than the old implementation. Didn't the old implementation have issues when you started sharing these maps between threads?
I haven't used Scala since 2006, so I'm not sure; I always avoided immutable collections (beyond lists sometimes) in favor of mutable ones given the nature of my work then (IDE development). I suspected they weren't thread safe, but Martin was confident at the time.