Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is. But JavaScript is the new assembly language, all you need is a Lua to JS compiler or a whatever to JS compiler.


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.


It's a joke. Like haha, but serious, because some people actually believe this.


lua compiled to asm.js is 64% of the speed of lua native

https://kripken.github.io/lua.vm.js/lua.vm.js.html


... which is about 10 times slower than the LuaJIT compiler used by OpenResty.


So that might be good enough in the browser but on the server where an optimized Lua engine exists, why?


That'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...


> 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?


JavaScript 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.



I genuinely can't tell whether you're joking.


Not joking, just dying a little inside.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: