Standardizing source maps
75 points by Timothee 17 hours ago | 11 comments
cadamsdotcom 15 hours ago
Very cool to see so much work going on to make the web platform even more awesome - and in the open!
replyStuff like this makes me believe open wins over closed in the end :)
sureglymop 13 hours ago
This is a great endeavour. Recently I have been thinking about how to add syntax and metaprogramming extensions to programming languages without forking the compiler/interpreter. Source maps are needed there in order to have good editor support through e.g. an LSP server proxy. In researching it I was a bit let down I couldn't find too much research and specifications for the topic.
replystmw 7 hours ago
They told us that the great benefit of scripting languages was that it was just text, no wait for any compilers or linkers, that it was so much easier to debug and so portable.
replyThey promised us we would be forever happy once we abandoned our antiquated love for compiled and strongly typed languages.
They lied.
fluffybucktsnek 45 minutes ago
"They" who? Never seem anyone argue that, specially with this level of bad faith.
replyMaybe you should avoid strawmans. Just sayin'.
https://github.com/EpicGamesExt/raddebugger?tab=readme-ov-fi...
First up is mapping from address to file, line and column. This one is basically a custom data compression scheme in the form a custom byte code. Strange but not too bad.
Second is “DWARF expressions", which is Turing complete and used for many things, such as figuring out where in memory or registers a given high level variable can br found at at any point of the program execution. It is baroque to say the least.
Then there is EH frames, which is used for unwinding (on exceptions in C++ or panics in Rust for example). This is used to specify how to find the base of the current stack frame given the current instruction pointer. This is needed if you don't use frame pointers. In itself it isn't Turing complete, but it can call out to Dwarf Expressions as subroutines, so it actually is TC. Except from what I have read, no compiler actually makes use of that capability, thankfully.
Surprisingly, the DWARF specification itself is actually reasonably readable and well written.
> figuring out where in memory or registers a given high level variable
Isn't the task itself Turing-hard? Or at least complex enough so that coming up with a non-Turing-complete solution would be impractical?