|
Hi Tim,I wonder if it's possible to add (even limited) support for debug.sethook and debug.getinfo which would allow using remote debuggers like MobDebug (although those I've seen require coroutine support). I could probably try making it to work over WebSockets, which, if successful, would allow debugging of Lua pages from an IDE (like ZeroBrane Studio).> The really time consuming part is finishing the implementation and building proper dev tools. The built-in tools are _javascript_-centric and not much good for debugging lua code. Either the abstraction is leaky (debugging at the JS level) or someone needs to write new dev tools that work at the lua level. This can be done, but it's more work than I am able to do without some form of sponsorship.
Paul.On Wed, Jan 2, 2013 at 1:38 PM, Tim Caswell <tim@creationix.com> wrote:The reason I started (but never finished) brozula was to play around writing a luajit byte interpreter. But there is no technical reason that a full lua runtime can't be implemented in browser _javascript_.While working on brozula, I tried a few techniques and I'm confident that a full-featured lua runtime complete with coroutines is not only possible, but will be fast enough for most uses. (The trick to get good speed is to JIT _javascript_ code on the fly and let the browser's JIT engine chew on that.) I was able to get over 3 million runs per second of the following lua program:
local data = {"This", "is", "a", "stream?"}local index = 1print("before")while data[index] doprint(data[index])index = index + 1endprint("after")The best DOM interface I've come up with so far is allowing lua to call JS functions directly and doing a best effort to translate. For example, I have to store references to how a function was last looked up (to know the "this" value in js)I was able to port my dombuilder.js library to lua and run it mostly successfully. https://github.com/creationix/brozula/blob/master/widgets/dombuilder.luaThe really time consuming part is finishing the implementation and building proper dev tools. The built-in tools are _javascript_-centric and not much good for debugging lua code. Either the abstraction is leaky (debugging at the JS level) or someone needs to write new dev tools that work at the lua level. This can be done, but it's more work than I am able to do without some form of sponsorship.
-Tim CaswellOn Wed, Jan 2, 2013 at 2:16 PM, Javier Guerra Giraldez <javier@guerrag.com> wrote:
depressing but quite true. that's why a Lua-DOM bridge can be soOn Wed, Jan 2, 2013 at 1:05 PM, Tim Mensch <tim-lua-l@bitgems.com> wrote:
> In my opinion, HTML5 is the only cross-platform GUI API that is even halfway
> decent on all platforms. Qt is the next contender
useful regardless of how widely deployed any underlying technology is.
Extra points if it runs 'real Lua' (or LuaJIT) and doesn't involve
JS.
--
Javier