haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Implement language-independent source maps

Open jushar opened this issue 8 years ago • 4 comments

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.

jushar avatar Sep 17 '17 17:09 jushar

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.

RealyUniqueName avatar Sep 17 '17 17:09 RealyUniqueName

@jdonaldson: Any interest in looking into that?

Simn avatar Sep 18 '17 07:09 Simn

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

nadako avatar Sep 18 '17 07:09 nadako

I am a necromancer. Source maps for Lua specifically is still not supported?

h3902340 avatar Sep 06 '22 03:09 h3902340