Re: Lua in Javascript environments [was: iLuaBox Now Available - Run Lua on Your iPad]
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua in Javascript environments [was: iLuaBox Now Available - Run Lua on Your iPad]
- From: Louis-Philippe <default@...>
- Date: 2010年10月26日 15:58:40 -0400
Not to discourage anyone, but the only road to Lua in the browser without plugins, would be to have a Lua VM built with _javascript_ itself. The best example of this kind of effort so far is
CoffeeScript, so successful that some parts of Node.js are written with it. Might be a good starting point for the Lua JS VM and some might even find it good enough to use.
2010年10月26日 Jonathan Castello
<twisolar@gmail.com>
On Tue, Oct 26, 2010 at 4:03 AM, Matthew Wild <mwild1@gmail.com> 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...
~Jonathan