Unfortunately most modern languages like Rust and JS follow the XID_Start/XID_Continue recommendation (not very well-motivated imo) which excludes all emoji characters from identifiers.
[1] https://github.com/microsoft/TypeScript/blob/81c951894e93bdc...
UPD. This code is like that picture with Disney princesses. The closer you look, the scarier it gets
I do use a lot of emojis in logs and status windows and in my comments. I'd not really thought about them in my code, but now I'm going to try to think of a way they could be used to improve code in a sensible way.
The reasons are complicated but, many people prefer unicode normalization so that different forms of what appear to be the same word are considered the same word. People argue whether or not this is important but it can certainly be argued that it would be frustrating to get an error like
let café = 1;
café += 1; // error, unknown identifier 'café'
The error happens in non-normalizing languages because those to idenifiers are not the same unicode.But, choosing a normalization affects emoji as well. Worse, when new ones are added the normalization rules can change.
8×8 is a tight squeeze, and 16×16 works a lot better. But that would make your approach vastly more space hungry than a normalization approach using the actual Unicode code points.
Non-ASCII comments in a source code can be scary enough sometimes, unless it's for an all-Unicode system like Android or something HTML based.
Easter egg: The example is named dogcow, after a 90s Mac icon, designed by Susan Kare, which later became a small mascot: https://512pixels.net/dogcow/
Regarding .length: Effectly that is just the result of Unicode, there is no one-to-one equivalent between characters code points, the code units in an encoding and the resulting grapheme clusters. That is in effect a result of the complexity of the world's alphabets, including Emoji.
The other aspects of strings are also centered around things being of uncertain length, like how it's O(n) to take the nth character of a string, and how there are rather complicated objects involved in taking substrings. There's a lot more thought and resulting complexity than other languages' default strings. And yes a few languages use extended grapheme clusters, but I feel like emojis were the real motivation.