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

Lua is popular for games because it’s so small, focused, flexible and very easy to embed, not because the core language is so great. The Lua core language really is as bare bones as it gets but that’s by design, because of its simplicity and good design it is very amenable to extend it to be exactly what it needs to be for your application and nothing else.

I would probably never write a standalone game in pure Lua because that’s not what it is intended for, it’s strength is easy embedding in a host application that does the heavy lifting, low-level stuff and provides the new primitives and functions for the application-specific parts of the code that runs in Lua. Other languages may be better in terms of language feature and tooling but none of these come close to the easy of use for embedded scripting.



Well, it's nice for writing short pieces of logic etc. (or for example lua nginx etc). It's super nice for a quick iteration, as the host (game engine or whatever) can quickly reload.

I've written a few commercial games in lua (corona, and others), and it must be me, but my code becomes a nightmare to maintain at a certain point.


IIRC that's how and why World of Warcraft embedded Lua for the user API. Which seems like a reasonable choice.




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

Search: