Javascript 作为可调试字节码
输出 javascript 的语言有所增加,例如 CoffeeScript 和 ClojureScript。由于 javascript 不会很快消失,我认为这种开发模式将继续下去。
人们遇到的一个问题是用一种语言编写代码并用另一种语言进行调试。 C 和汇编之间的关系也是如此,但是生成的汇编可以嵌入调试元数据,以便 C 调试器知道汇编如何与 C 源代码相关。例如:该程序集块代表的行号。
现在我的问题是:
是否有人知道任何类似的努力,允许将调试元数据嵌入到来自 CoffeeScript 和 Clojurescript 等语言的生成的 javascript 中?
据我所知,这至少需要一个支持该理论元数据的调试器。
There is a rise in languages that output javascript, such as CoffeeScript and ClojureScript. Since javascript will not be going away anytime soon, I presume this pattern of development will continue.
One problem people have is that you write code in one language and debug in another. The same can be said about the relationship between C and assembly, but assembly generated can have debugging metadata embedded so that the C debugger knows how the assembly relates to the C source sode. So for example: the line number that this block of assembly represents.
And now for my question:
Is anyone aware of any similar efforts to allow for debug metadata to be embedded in the resulting javascript from languages such as CoffeeScript and Clojurescript?
As far as I am aware this would require at least a debugger that supports this theoretical metadata.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。 Firefox 和基于 Webkit 的浏览器计划支持 CoffeeScript 和其他编译为 JS 的语言的调试: http://www.infoq.com/news/2011/08/debug-languages-on-javascript-vm
Yes. Firefox and Webkit-based browsers are planning to support debugging for CoffeeScript and other languages that compile to JS: http://www.infoq.com/news/2011/08/debug-languages-on-javascript-vm