TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Source Maps Are an Insufficient Debugging Format for the Web

71 pointsby mnemonikalmost 10 years ago

4 comments

skybrianalmost 10 years ago
We do need a good way to inspect the JavaScript heap when it contains data structures from non-JavaScript languages. However, I&#x27;m not convinced this should be represented as data. It seems better to represent it as a reflection API that&#x27;s implemented as a JavaScript library provided by the compiler. The debugger can load the javascript file into the web page when needed, and it can use whatever data format it likes.<p>Chrome is working on a way to this [1]. However, it&#x27;s not done yet, and it needs to be be turned into a real standard. It&#x27;s also not likely to work well for asm&#x2F;wasm as-is.<p>New standards are important but we also need to properly implement the standards we already have. Sourcemaps have been around for years but they&#x27;re not fully implemented by most browsers that claim to support it. (Firefox sourcemaps didn&#x27;t work well when I tried it in January, though some bugs have been fixed since then.) I think someone needs to write something like the Acid tests [2] for browser debuggers.<p>[1] <a href="https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U&#x2F;edit#heading=h.xuvxhsd2bp05" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;1FTascZXT9cxfetuPRT2eXPQK...</a><p>[2] <a href="http:&#x2F;&#x2F;www.acidtests.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.acidtests.org&#x2F;</a>
评论 #9748032 未加载
评论 #9748831 未加载
评论 #9748373 未加载
Touchealmost 10 years ago
fyi, the author of this post is the lead developer of mozilla&#x2F;source-map, the defacto SourceMap library.
malkiaalmost 10 years ago
I&#x27;m fairly new to the web-development, and on my new job I&#x27;ve been tasked to use java (new to me) with gwt (just knew the name) which is translated to javascript (yes, not enough experience there).<p>Now SourceMaps and Chrome&#x2F;Firefox debugging tools are great savers. I wish Eclipse had better debugging (actually it seems it has, since it&#x27;s also new to me, the curve for learning it is much steeper - I&#x27;m an ex - Visual Studio Debugger guy :)).<p>But even with SourceMaps gwt translated (from java-&gt;javascript) names do not always match - often _g or _0 _$ are added, and object properties are intermixed with original java defined ones, and some internal - I&#x27;m used to it now, but was wondering whether it would&#x27;ve been better if it work ideally (e.g. show real Java &quot;view&quot; of the things even from the &quot;Javascript&quot; land). While this might&#x27;ve been the right choice, what I have now gives me more usable information.<p>What doesn&#x27;t work always, is that sometimes the debugger would display the javascript, not java code (maybe gwt&#x27;s fault, or something I do incorrectly with gwt&#x27;s SuperDevMode )<p>I wish there is an option (for gwt, and other languages) to somehow show the transition, and allows intermixing when displaying. To give you an example - When debugging &quot;C&#x2F;C++&quot; code most of the debuggers can intermix the assembly generated code in there... I&#x27;m not sure whether this would be as good as intermixing java and javascript (or say another language with javascript) because they look very similar, but at least to allow me to sometimes see the javascript, rather than always show me the java code (it&#x27;s possible that this is already available, and I haven&#x27;t found it yet).
malkiaalmost 10 years ago
&quot;We can embed snippets of JavaScript within the debugging data to locate a binding&#x27;s value.&quot; - I see this as a security risk, but then again so much code is executed by the browser so it probably is okay.
评论 #9751937 未加载