lua-users home
lua-l archive

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

On Tue, Oct 26, 2010 at 4:03 AM, Matthew Wild <> wrote:
> As far as I know it's quite possible, bar some browser API problems
> (with \0, etc.). The only other problem I foresee would be inefficient
> internal representations of binary data, like using wide character
> strings. As far as I know V8 uses UTF-8 internally.

I was under the impression that UTF-8, which Javascript strings use,
puts restrictions on certain bytes. From Wikipedia's page for UTF-8,
bytes above 127 are either part of a sequence, or are reserved.

> In any case, I'm sure we can cope with any ugliness until they finally
> decide on a standard for binary representation in Javascript. They
> need it for the FileReader and websocket APIs for example.

Lua won't be able to run on any current versions of browsers then,
will it? Since its unlikely that client-side Lua will be reading in
the output from luac, and instead parsing script source, it seems like
it would be easier to go with a different internal format.

A thought occurs to me, though: Could Lua bytecode be packed into an
image for the server to send, and then can the client unpack it into
an array of integers? Stranger things have been done...