Fengari: Lua for the Browser
fengari.io
fengari.io
I like Lua very much, and in my mind, if the stars had been aligned just a little differently, it would now occupy the space inhabited by Javascript.
I cannot help but wonder, tough: A Lua VM implemented in Javascript? Is the performance hit not enough to make this useless for anything beyond proof-of-concept-sites/apps?
A Lua to Javascript compiler would have made sense. Given all the languages you can compile to Javascript these days, it would have made sense. And in terms of semantics, both languages are close enough that I think it would not be that big a problem.
Still, it is an impressive piece of work. Implementing a bytecode VM a) in Javascript, b) running in the browser must make debugging rather ... interesting.
The point was to make an extremely light, yet programmatic access to web data and almost static html.
When I use dillo I don't miss much, maybe a few css fix here and there. What I feel is that I want some emacs-ish capabilities in it so I can do more with less. And I love the ridiculous resource consumption of dillo, 30 dillo tabs = half a chromium one; and without parsing js and fetching scripts .. network + rendering is hard to measure.
Lua really is the MLIR (mid-level intermediate representation) from the future.
Currently in the process of porting the parser & codegen that's implemented in Javascript to Lua so that I can have the implementation bootstrap itself. Plus the codegen was for a bytecode I came up with in JS but which has evolved quite a bit since getting everything in place to happen in WASM
It looks like you are in the process of porting the .js to .lua? Wasm will exist in many more places than Js will.
I think I would have started with many of the Lua on Js implementations and used zero Js.
Have you seen http://stefan-marr.de/2015/10/jit-data-structures-fully-refl...
Check out this paper, https://www.cs.purdue.edu/homes/rompf/papers/amin-draft2017a... Collapsing Towers of Interpreters
Thanks for the links
[1] https://httpd.apache.org/docs/trunk/mod/mod_lua.html
iirc, Cloudflare uses mod_lua for a lot of its packet filtering stuff because Luajit is basically magic.
There is a very nice collection of libraries with pretty much everything one can think of https://github.com/bungle/awesome-resty
http://github.com/moai/moai-dev/[0]: https://www.lua.org/wshop17.html [1]: https://www.youtube.com/watch?v=xrLIgmd8xik