Hacker News new | ask | show | jobs
by djur 4444 days ago
Embedded scripting languages seem to work best on what I'd call a 90/10 model. Either your game is written in the scripting language inside a thin compiled shell (to provide access to system routines and the occasional optimization), or your game is written almost entirely in the host language and just configured using scripts. So: 90% Lua, 10% C++ or vice versa, but not 50/50 or the like.

In general, it seems to be a red flag if a single thread of logic runs back and forth between host and scripting contexts.

1 comments

Alternatively, write most of it in C++ and allow it to be extended with components written in script, ECS style.

Or something else.

Honestly, having too much scrip is very much a thing to try and avoid. Perf (gc, etc), long term maintainability (usually no static types in script), tooling (frequently no debuggers, profilers, or the ones that exist are low quality), etc are all reasons for this.

If you're going to have 90% lua, you probably should be writing the game in lua anyway...