Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Lua scripting woes

$
0
0
I need some advice. After I changed my scripting language from in-memory C to Lua I've had numerous problems I've never encountered in other languages. Prototypes? Type signatures? Calling functions with any number of parameters? How do you deal with all the random bugs you can get that you have really no way of determining the cause of? If I call a function with one less parameter than it should have, I might just get a Lua error somewhere else in the script. At a later time. What do you do to make your code (which isn't bottlenecked at all, so there is tons of room to add checks and balances) more correct and more sane? If I scripted sanely in C I would rarely have these issues. For example any pointers passed between the engine and the script goes through a sanitizing stage where it actually checks if the pointer points to an actual valid existing entity. If it sounds like I am regretting the change, I don't know how to answer that. Lua can construct tables and pass them around, which is very nice, unlike C where I would have to malloc (and that is just not going to happen).

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>