[erlang-questions] beginner: other array implementations

Jonathan Amsterdam <>
Thu Dec 6 21:28:21 CET 2007


Here's another question about arrays. There are two other array
implementations I can think of, and I'm wondering why they weren't
chosen. I am not criticizing the existing array implementation, which
I'm sure is great. I'm just trying to understand the Erlang culture
better by understanding the design choices you've made.

1. Standard imperative arrays, as in, say, Java. You've already got
ets tables, why not add another mutable data structure? In combination
with HiPE, this will let Erlang match Java speeds on many algorithms
that frequently set and get array elements.

2. A functional array with an imperative implementation, the simplest
of which uses the "shallow binding" or "trailers" technique (see,
e.g., http://home.pipeline.com/~hbaker1/ShallowArrays.html). The data
structure is functional, with constant-time performance in the
single-threaded case, but requires an imperative implementation. There
are more complex techniques that give better performance when
accessing a version that is not the most recent, e.g.
http://citeseer.ist.psu.edu/328736.html.



More information about the erlang-questions mailing list