5 ms·
This is definitely an example where "character" was the wrong word. We start out OK with bytes being distinct, but by the end we're talking about how a characte
by tialaramex 5y ago
This is definitely an example where "character" was the wrong word. We start out OK with bytes being distinct, but by the end we're talking about how a character is made out of several characters. If we think in terms of code points (Rust's native char type actually provides here a slightly different thing, a Unicode Scalar Value, which certain types of code point are not, but close enough) clearly a code point isn't made out of several code points, so we needed a different word.
I like squiggle, if you're a text rendering engine you might want to use "glyph" although you might already need that word for something else. But try to avoid character because that word already has far too many meanings, most of which won't be what you wanted.
- ademarre 5y agoI think the term you are looking for is grapheme cluster. https://manishearth.github.io/blog/2017/01/14/stop-ascribing-meaning-to-unicode-code-points/ https://manishearth.github.io/blog/2017/01/14/stop-ascribing...
- kibwen 5y agoWe're so lazy that we can't even be bothered to type "character" half the time, so "grapheme cluster" has no chance to catch on unless we can think of a "char"-style abbreviation. I'll start the bikeshed with "gracl", but ambitious folks may wish to argue for "clog" ("cluster of graphemes").
- pbiggar 5y agoIt's really an Extended Grapheme Cluster. In our codebase (Darklang) we abbreviate it to EGC.
- irrational 5y agoHow about graph? One character longer than char and probably not already in use in the area of computer science.
- lloeki 5y agoIs that what Go uses "rune" for? https://golangdocs.com/rune-in-golang https://golangdocs.com/rune-in-golang
- _nalply 5y agoNo, because a grapheme cluster is à where the letter is combined by a and ` which are two Unicode Scalar Values. A Go rune is more like one Unicode Scalar Value. However, be careful, terminology is subtle: what is a Code Point, what a Scalar Value, etc.
- tgsovlerkhgsel 5y agoNo. A "rune" is one codepoint, Golang just decided that they can't use the same name as everyone else (as is tradition in Go).
- zzt123 5y agocharacter…grapheme cluster… Charster!
- deleted 5y ago[deleted]
- homarp 5y agoclugr 'sounds' better than clog though (unless you want to evoke pipe somehow)... clugr evokes more Freddy to me
- contradistinct 5y agoElixir uses the term grapheme already: https://hexdocs.pm/elixir/1.12/String.html#graphemes/1 https://hexdocs.pm/elixir/1.12/String.html#graphemes/1
- wahern 5y agoUnicode uses the term grapheme cluster to emphasize the fact that it can be composed of a cluster of codepoints, and perhaps also to distinguish it from the linguistic term grapheme. But ultimately in the context of Unicode I think you could just get away with using grapheme. That's what Perl did when it invented Normalization Form Grapheme (NFG).
- IncRnd 5y agoYou can refer to the definitions of these terms. [1] It's best not to reinvent how these terms are used. There has been far too much of that, already. [1] http://www.unicode.org/glossary/ http://www.unicode.org/glossary/ PS Be prepared for a long read.
- xyzzy_plugh 5y ago> I like squiggle Go uses "Runes" which is a pretty unambiguous and memorable term. Though, in Go's case they don't include use of ZWJ, as they're limited to 32-bits.
- bobbyi_settv 5y agoIt's somewhat ambiguous because Unicode has a code block for actual runes which are not the same as the "runes" you're talking about https://en.wikipedia.org/wiki/Runic_(Unicode_block) https://en.wikipedia.org/wiki/Runic_(Unicode_block)
- slimsag 5y agoA Go "rune" is not the same as a "single rendered/visible character" though, a grapheme cluster/glyph/squiggle is from what I understand. example: https://play.golang.org/p/jJdS2WRWDXs https://play.golang.org/p/jJdS2WRWDXs
- tobinfricke 5y agoI believe this name is inherited from Plan 9 (which also happens to be the origin of UTF-8). https://9fans.github.io/plan9port/man/man3/rune.html https://9fans.github.io/plan9port/man/man3/rune.html
- hamilyon2 5y agoI think, zwjchar has a chance: it is unambiguous, so when in future standard evolves we could distinguish it. Besides, technical people like precision and cryptic names.