[webkit-dev] the name "AtomicString"

Darin Adler darin at apple.com
Tue Dec 18 19:31:02 PST 2018


The name “AtomicString” was inspired by the term of art, “atom”, traditionally used in at least some programming language implementations for what I see now is often called interned strings. You’ll see a mention of that term in the article https://en.wikipedia.org/wiki/String_interning in the context of ML along with some other terms used for this such as “symbol”.

I’ve gotten used to the name AtomicString over the years, but I wouldn’t strongly object to changing it if other programmers are often confused by it’s similarity to the term “atomic operations”.

A mild objection I have to the term “interned string” is that the term “interned” is not really a normal English word; I wasn’t familiar with that jargon when we named AtomicString and I am still not entirely thrilled with it. I think that specific term comes from the LISP intern function and is familiar to programmers largely because of its use in Java, .NET, and some other modern programming languages and libraries; I had encountered the technique many times over the years without ever hearing the word “interning” and don’t find the jargon entirely logical.

Some people might suggest using the term “flyweight string” instead https://en.wikipedia.org/wiki/Flyweight_pattern and I’m not sure which I’d prefer. Maybe there’s another obvious name?

Apparently in Delphi’s DWScript they called it “unified string” https://www.delphitools.info/2013/06/17/string-unification/ but in the article I cited they are chided for not calling it an interned string.

— Darin

PS: I do love loudly declaiming, “Atomic string, the string of tomorrow!” but I can get over it.


More information about the webkit-dev mailing list