3 ms·
In my opinion, it needs to be in the core. Imagine you need to go through a library every time your string includes or might include the letter "s" or "v". Bas
by arkx 16y ago
In my opinion, it needs to be in the core.
Imagine you need to go through a library every time your string includes or might include the letter "s" or "v". Basically you'd need to use this library for all your strings. But then you lose compatibility with 'normal' string type and need to be constantly aware of the difference. You might want to use some other library that doesn't support this Unicode library at all, etc. It quickly becomes a very painful world to live in.
As you might imagine, just having support for Unicode baked in the language is very nice. Defaulting to Unicode for all text is even better.
I can understand why Lua in particular doesn't come with Unicode support out of the box, being so small. My comment was written in response to the more general claim that Unicode support is a strange thing to consider essential in a programming language.
(According to http://www.bckelk.ukfsn.org/words/etaoin.html http://www.bckelk.ukfsn.org/words/etaoin.html, s/ä and v/ö are comparable in frequency.)
- silentbicycle 16y agoI think we have slightly different ideas about the language core vs. library distinction. In C, for example, printf and strlen are library functions (stdio.h and string.h), while structs are part of the core language. All the language core needs for Unicode is reasonable support for tagging string literals (i.e., U"blah") and a binary-safe string type. It's best if there's either a standard or de facto community standard library for doing Unicode string ops, but it doesn't need core support anymore than the Linux kernel needs to know about parsing HTTP.