I know that Haxe is able to generate source maps for javascript, but the “-debug” compiler option seems to do nothing when targeting lua.
Are source maps supported for lua? If not, is there any way to get mappings to the original source code in order to be able to write a haxe-lua debugger?
I was looking into this. There’s something equivalent for moonscript, and apparently a lua debugger called mobdebug (GitHub - pkulchenko/MobDebug: Remote debugger for Lua.) supports it. However, it’s not well documented.
It seems what MobDebug is doing is simply overriding the error message and converting the internal lua callstack printout to its own. I think we should be able to do that fairly easily, so stay tuned.
It’s a simple command line wrapper for the built-in lua “debug” module. With haxe provided source maps for lua, it should be fairly easy to make it output haxe script information.