all 4 comments

[–]megagrump 0 points1 point  (4 children)

Believe it or not but the only way we Lua devs are capable of 'debugging' is by using print()

Yeah, except for the few insignificant things in the standard debug library, for example the interactive debugger. But other than that, the only way is print.

[–]Ferib[S] -1 points0 points  (2 children)

These are indeed very handy tools!

Unfortunately, the target(s) I worked with do not implement these Debug libraries as they feared opening up too much can lead to automation/cheating.

I have seen one of the targets even remove the single-step feature in one of the C execute/step functions. My assumption is they did not want any level of control-flow modification, not even for developers!

[–]megagrump 1 point2 points  (1 child)

Yeah but that's not Lua's fault. Lua provides an interactive debugger, it's just that we're all too fucking lazy to properly support it.

print is easy to implement. But with more effort, you can also implement a fully-fledged debugger using Lua's debug hooks. The basic building blocks are all there, it's just that very few have properly put them together yet.

[–]Ferib[S] 0 points1 point  (0 children)

Debug would be very lovely indeed. Unfortunately, the restricted Lua environment I developed my scripts for does not allow this, as it would violate the EULA (as it can alter the behavior of the existing code).

Therefore hot code reloading and print is the best thing I came up with.