3 ms·
Last I checked Javascript implementations were slower than LuaJIT. Cost of implementing Lua tables, meta-tables, co-routines, etc. in Javascript will be rather
by vardump 11y ago
Last I checked Javascript implementations were slower than LuaJIT. Cost of implementing Lua tables, meta-tables, co-routines, etc. in Javascript will be rather high. Anywhere between 2-50x. If native Lua engine is removed, you can just forget about it then.
So what you're saying doesn't make any sense for anything remotely performance sensitive.
- bryanlarsen 11y agolua compiled to asm.js is 64% of the speed of lua native https://kripken.github.io/lua.vm.js/lua.vm.js.html https://kripken.github.io/lua.vm.js/lua.vm.js.html
- pygy_ 11y ago... which is about 10 times slower than the LuaJIT compiler used by OpenResty.
- Touche 11y agoSo that might be good enough in the browser but on the server where an optimized Lua engine exists, why?
- daurnimator 11y agoThat's not compiling lua to asm.js; it's running the lua vm in asm.js. A straight up transpilation is other projects like lua.js. But you loose really nice core lua features like coroutines...
- striking 11y agoIt's a joke. Like haha, but serious, because some people actually believe this.
- kybernetikos 11y ago> Cost of implementing Lua tables, meta-tables Tables and meta tables are nearly identical to objects and prototypes in javascript. Why would the cost of implementing them be high?
- fanf2 11y agoJavaScript objects are indexed by strings. Lua tables are indexed by arbitrary objects. In JS a[1] and a["1"] are the same element but they are different in Lua. In Lua a[{}] is a new element indexed by the identity of the new object literal, and will be a different element every time the expression is evaluated.