<div dir="ltr">Hi,<div><br></div><div>So, atoms are stored in a shared table, using locks to read & write, and never garbage-collected.</div><div>Well we know the issues that emerge from this.</div><div><br></div><div>
What I can't find on the Web is the purpose of this table.</div><div>Why does Erlang needs to assign a unique hash to a <255-characters string and put it in memory?</div><br class="">I thought atoms were just like enums, thus the only actions needed on them were ==, =:= and the various conversions to string or binary.<div>
An atom (approximately) corresponds to this regexp: [a-z'][a-zA-Z0-9_']{,254}.</div><div>Its syntactic representation **already** supports the actions I cited.</div><div><br></div><div>Why not get rid of the atom table and and just use strncmp(3)?</div>
<div><br></div><div>Cheers,</div><div>Pierre</div></div>