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

LuaJIT is being used in various commercial games. You may not see that real world code, but it is out there.

Watch the YouTube video of the Wikipedia presentation linked elsewhere in this discussion.

From the video, they picked Lua also because they could have multiple concurrent Lua states (no globals), easy to override the default memory allocators for security, Lua VM instances are very cheap and fast to create and launch, and the code base was small enough that their security guy could actually audit all the code (and they even submitted a patch).

All these properties are hard to find with Javascript, but with Javascript, you have to go further and first decide which Javascript implementation to use. The ECMA spec says nothing about C interfaces or embedding so every Javascript engine (e.g. V8, JSCore, SpiderMonkey) is completely different.

They also said they are using the standard Lua interpreter and not LuaJIT because stock Lua happened to already be really fast and fast enough for their purposes right now.



> LuaJIT is being used in various commercial games. You may not see that real world code, but it is out there.

I didn't say otherwise, I know LuaJIT is used. What I did say was I have not seen speed comparisons on such real-world code - but I would love to see a link if you have one.

> and the code base was small enough that their security guy could actually audit all the code

A small codebase is indeed good, but JavaScript VMs have very large teams of people working on hardening them, both reading and reviewing the code and applying methods like fuzzing to look for security problems. The fact is that JS VMs are likely the more hardened of anything out there, simply because they are used in web browsers.

> with Javascript, you have to go further and first decide which Javascript implementation to use.

Lua has at least two implementations as well, mainstream Lua and LuaJIT.

> They also said they are using the standard Lua interpreter and not LuaJIT because stock Lua happened to already be really fast and fast enough for their purposes right now.

That's cool.


> Lua has at least two implementations as well

The difference is that the Lua C API is standardized meaning that C code can work with either just fine. The only big incompatibility problem is that LuaJIT provides an extra, non-portable, FFI library in addition to the standard one.


and luajit isn't 5.2 :(




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

Search: