haxe
haxe copied to clipboard
Implement language-independent source maps
It would help a lot to have source maps that are language-independent in a Haxe-specific file format.
My context is: I'm compiling Haxe to Lua code, but unfortunately, unlike Javascript, Lua doesn't have an official source map format (Lua's approach is to embed all required debug information into the bytecode output). But since Haxe compiles to Lua code rather than Lua bytecode, there's currently no way of getting a connection between Haxe and Lua.
Therefore, my suggestion is to generate a universal source map that I can use as a developer to handle error messages myself. In case of Lua, I can for example use Lua's debug library in conjunction with pcall to catch errors and the source map to map the line numbers correctly.
Actually we already have language-independent sourcemap generator. But it's only used for php7 now. I think it should be relatively easy to attach it to lua.
@jdonaldson: Any interest in looking into that?
We discussed it before, but since there was no issue, I'll link it here. Here's (one of?) the debugger for lua that supports line mapping, so we could load and map sourcemaps: https://github.com/pkulchenko/MobDebug
I am a necromancer. Source maps for Lua specifically is still not supported?