[erlang-questions] Did Erlang's grammar change in R16A?

Richard A. O'Keefe ok@REDACTED
Fri Feb 15 01:48:13 CET 2013


On 15/02/2013, at 1:02 PM, Björn-Egil Dahlberg wrote:
> 
> Ok, how does this perform against linear scan Eterm data array?

Eh?  You see to be comparing apples with bulldozers here.

> The tradeoff being one word memory saved on the heap also? Keep in mind that most atoms are pretty short.

With atoms typed by hand, that is the case.
With atoms generated by programs (like the function names the Erlang compiler
generates for list comprehensions), there is no tired-finger constraint to stop long
atoms being used.
> 
> .. first thought you were messing with the arity thing meaning .. perhaps i should sleep. putting more stuff in the header .. seems good

EEP 20 was written with no knowledge of Erlang's low level implementation details.
The background for it is a WAM-like architecture, with a 2-bit tag
00 immediate
01 box-of-bits
10 pointer to [_|_] (which has no header)
11 pointer to box-of-tagged-words
and boxes have an "arity" field (the size of a tuple, the length of a binary)
that includes a few "supertag" bits that say what kind of box it is.
The "arity" field used in EEP 20 holds the bits that say "I am a local atom"
and a length, encoded to make *both* "number of bytes" and "number of
Unicode characters" constant-time operations.

The equivrep field is what enables atoms that have been found to be equal
to be chained together; if a 3-word header is too big (despite being the same
size as or smaller than a binary's header), that word could be sacrificed.

> .. wait a minute .. are you proposing an immediate with a payload?

Eh?  If you call a binary "an immediate with a payload", yes.
Otherwise no.
> 
> I think there are many ways to skin this particular cat and I think it should debated what the most effective atom gc could be.


Yeah, well, EEP 20 was created on 25-Aug-2008.
We've had 1635 days since then to debate atom gc, and *now* you want to start?

The key thing about EEP 20 is that IT IS NOT ORIGINAL.  The basic idea there is
proven concurrent programming technology.  We *know* this works.




More information about the erlang-questions mailing list