lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Oct 25, 2017 at 4:38 PM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great dyngeccetor8 once stated:
>> On 10/25/2017 09:23 PM, Egor Skriptunoff wrote:
>> > But maybe someday Lua would become UTF-8-only language...
>> ...
>> > Such UTF-8-only language would have some disadvantages:
>> > 5) All operations listed above would fail or generate exception on invalid UTF-8
>> > strings.
>> > 6) There would be no byte strings in Lua, but many users want something like
>> > "mutable byte arrays".
>>
>> Probably we can introduce new type "byte_string" for strings like '\0xD8'.
>> Similarly as Lua 5.3 "integer" and "float" subtypes for type "number".
>
>   That was done between Python 2 and Python 3 and it has caused all sorts of
> pain---enough that not everyone migrated to Python 3.
>
>   In the case of Lua, it would most likely hurt in the parsing of network
> packets and some binary file formats (with embedded strings).
>
>   -spc
>

The difference between bytes and str wasn't the main thing that killed
Py3k adoption. It was ONE thing, but it was one thing that could have
been managed in and of itself. The problem was that they tried to
FORCE the Unicode migration down everyone's throats and in doing so
shattered compatibility (and then they also decided to break
everything at once on the theory that you'd have to port your code
anyway, which made the porting effort that much harder). Lua could
easily avoid that problem by maintaining a focus on compatibility.

/s/ Adam