Small example "freewheeling" app that can be modified without restarting

bugfix: show error message on infinite recursion

Scenario: on.draw = function() f() end

f = function() f() end

Before this commit, the app would crash without error.

Summary of error handling in Lua and LÖVE:

  • errors in the xpcall handler silently crash the program. I always knew this. Error handlers are hard, because they must never throw an error no matter what situation they find themselves in. But it's impossible to know in advance all the situations they find themselves in.
  • LÖVE has some secret sauce that causes errors in the xpcall handler (NOT love.errorhandler, which I'm not using lately) to only interrupt the current frame, and resume on the next frame. They don't crash the entire program.
  • I've also seen some signs that running out of stack destabilizes things. I found a string that would throw an error any time I tried to use it. So it seems a good idea to minimize work in error handlers on stack overflow. Prioritize getting some error message out on stack overflow.

Created by  akkartik  on March 1, 2025
4PL4QEWRE6FXUWJPVZ5RAJRXCC5G6FQK3ZTBJ4VCC2DN2HQKTP3AC
Change contents