[erlang-questions] correct terminology for referring to strings

Michael Turner michael.eugene.turner@REDACTED
Wed Aug 1 02:51:21 CEST 2012


On Wed, Aug 1, 2012 at 12:13 AM, Masklinn <masklinn@REDACTED> wrote:
> On 2012-07-31, at 16:37 , Richard Carlsson wrote:
>
>> On 07/31/2012 04:19 PM, Michael Turner wrote:
>>>> At runtime, Erlang's strings are just plain sequences of Unicode code points
>>>> (you can think of it as UTF-32 if you like).
>>>
>>> Can you go further and say that it actually *is* UTF-32? A footnote
>>> like "[*] Basically, UTF-32; see ref XYZ for details" might be
>>> helpful.
>>
>> I'm loath to say that it *is* UTF-32, because with that term follows a bunch of connotations such as word width and endianism, which don't apply to the representation as Erlang integers. I'd like to just refer to it as Unicode, but apparently that makes most people think it's either UTF-8 or UTF-16.
>
> Say it's a sequence of code points (reified as integers)? That's exactly
> what it is.

But as Richard Carlsson points out, that's NOT quite "exactly what it is."

> ... If people don't know what a code point is, they can look it
> up. In any case, this shouldn't bring along any undue semantic baggage
> and misconception.

The perfect is often the enemy of the good. Perfect precision is
sometimes the enemy of good initial comprehension. In my experience,
that's *definitely* true of most approaches to Unicode.

I hope we haven't lost track of Joe's goal here: a reasonably accurate
description of what Erlang strings are, in a passage  that, at the
very least, should not intimidate newbies. A quick and approximate
gloss of "codepoint" in the main text, together with a footnote
apologizing for the oversimplification and suggesting a more detailed
reference, strikes me as the best compromise between precision and the
need to appeal to the reader. Appealing to the reader is not exactly
optional for Erlang. Every day, I hear more about Scala and Node.js.

-michael turner



More information about the erlang-questions mailing list