You are viewing archived messages.
Go here to search the history.

Kartik Agaram 2023-11-09 05:24:16

Now that I've started inserting coroutines into my apps (💬 #two-minute-week@2023-11-01T06:07:08.191Z) to make them more debuggable, I'm starting to find and plug gaps in error recovery:

  • I have to be careful to check the results of coroutine operations, because the underlying coroutine might have thrown an error.
  • Errors in Lua include a call stack, but errors within coroutines don't return the stack by default.
  • If I create a higher-order helper to abstract away the coroutine munging just to smear a computation across frames, does that impact the quality of debug information in the call stack? (Answer: no it doesn't in Lua, but it wasn't obvious.)
  • Call stacks returned by LÖVE aren't quite as clean as plain Lua.
J. Ryan Stinnett 2023-11-09 18:47:49

How would you rate the Lua / LÖVE debug experience overall? Do you generally get meaningful stack traces? Are there debuggers that work as expected? (Feel free to tell me to go away and figure it out myself! 😇)

Kartik Agaram 2023-11-10 00:47:26

I think it's pretty decent. Baseline Lua gives nice stacks to show you precisely where an error happened. But as a dynamic language it also gives you tools to try to 'improve' on it, and when I run into problems it's invariably because I was trying to be clever and my improvements like regress the experience. LÖVE is a bit like that as well albeit much more mature than my stuff; it has one issue I've noticed that baseline Lua doesn't have.

I tend to be a debug by print person so haven't played with debuggers like much. So it might fall to others to review the debugger side of the eco system. But things have seemed decent enough to me.

Kartik Agaram 2023-11-11 19:13:54

I've cleaned up the code for my debug infrastructure of 💬 #two-minute-week@2023-11-01T06:07:08.191Z and improved the error flow; now you get decent call stacks even if there's a coroutine in the middle somewhere.

The debug infrastructure lives on the surface. I frequently tinker with it while debugging.