8 ms·
Debugging WebAssembly with Modern Tools
- ArtWomb 6y agoAwesome! This is the web summit talk I was looking forward to. So part of the promise of wasm is its integration with the web api and dom. In the fractal application for example if we extend that to include a zoom function that handles mouse events and updates variables, I'm probably employing something like blazor or js-sys in rust. How will that high level integration be handled in the dev console? And is it possible to create custom visualizations? Thanks in advance ;)
- RReverser 6y agoDid you mean ChromeDevSummit talk or there was a separate WebSummit talk on this too?
- rhencke 6y agoI never that the tools I used for tracing (chrome://tracing) and now debugging C/C++ code would be my web browser itself.
- flohofwoe 6y agoI just tried it and it works pretty well. Awfully slow on my mid-2014 MacBookPro though, especially the variable-view-panel redrawing takes very long (1..2 seconds). But definitely a promising new start compared to the older source-map debugging solution. Hopefully this will also lead to a 'seamless debugging experience' inside VSCode. It would be pretty awesome to have (for instance) a HTML panel with a WebGL canvas in one VSCode tab while stepping through the C/C++ code in another tab. With a bit of tinkering this would also make a nice shadertoy-style live-coding environment.
- kowbell 6y agoNot WebAssembly related, but there are already VSCode plugins for "a nice shadertoy-style live-coding environment!" GLSL preview: https://marketplace.visualstudio.com/items?itemName=circledev.glsl-canvas https://marketplace.visualstudio.com/items?itemName=circlede... Full on Shadertoy environment (preview panel, lets you use Shadertoy's uniforms): https://marketplace.visualstudio.com/items?itemName=stevensona.shader-toy https://marketplace.visualstudio.com/items?itemName=stevenso...
- RReverser 6y agoInteresting, are you on the latest Chrome Canary? If so, could you please report a bug with a simple repro to the https://bugs.chromium.org/p/chromium/issues/entry?template=DevTools+issue https://bugs.chromium.org/p/chromium/issues/entry?template=D... link mentioned in the article?
- worik 6y agoAlthough I have no use for it currently I am fascinated by Web-assembly (and PWAs). But is it actually useful? I understand why theoretically it is, but is it being useful in practise? Answering my own question, a little, I use figma.com a lot. But the potential seems so great, and the available PWAs so poor.... Expecting this is a good place to ask
- brundolf 6y agoIt's mainly hamstrung right now by the hoops you have to jump through to get it talking to the actual web page, is my understanding. Some companies though, like Cloudflare, are playing with it as a cross-platform server/desktop runtime, which is interesting
- merb 6y agowebassembly would be a good thing to have extensions within your app via wasmer/wasi unfortunatly not many languages are going into webassembly
- Birch-san 6y agoIt's absolutely useful in practice. Sometimes the library you need was written in C++, and needs to run performantly and offline. I needed WASM and PWA to make an offline Japanese dictionary: https://birchlabs.co.uk/mecab-web/index.html https://birchlabs.co.uk/mecab-web/index.html It uses WASM to do linguistic processing via the C++ library, mecab. It tells you where the spaces should go in a Japanese sentence, and what the dictionary form is of each word (so you can lookup the meaning).
- RReverser 6y ago> Answering my own question, a little, I use figma.com a lot. But the potential seems so great, and the available PWAs so poor.... It's just that WebAssembly, like any new technology, can and usually is used in very specific paths that require it. As a result, it's true that there is not that many full WebAssembly-powered PWAs, although the ones that are, like Figma you already mentioned or Google Earth or various Blazor-powered apps already speak for themselves. However, there is even more apps and websites out there that use Wasm either directly or via library dependencies for calculations, graphics or even things like hyphenation - in my research https://github.com/mnater/Hyphenopoly https://github.com/mnater/Hyphenopoly was one of the most popular Wasm-powered libs used across a bunch of CMS and blog platforms - probably the last place you would expect to find WebAssembly in, and yet...
- emeraldpanda 6y agoIf a Google person is reading this, the blog has a dead link at "Please install it by going to this link: goo.gle/wasm-debugging-extension"
- RReverser 6y agoThanks, going to fix soon-ish! Not sure how it slipped by.
- jsheard 6y agoDoes this work with Rust's WASM target yet? The article only discusses C/C++ via Emscripten.
- RReverser 6y agoIt does work with basic Rust compiled to Wasm, but most of the ecosystem uses wasm-pack / wasm-bindgen, which currently doesn't support DWARF. You can subscribe to https://github.com/rustwasm/wasm-bindgen/issues/2389 https://github.com/rustwasm/wasm-bindgen/issues/2389, but, unfortunately, wasm-pack currently is maintainerless until someone steps in. (see https://twitter.com/ag_dubs/status/1319651621698232322 https://twitter.com/ag_dubs/status/1319651621698232322)
- saagarjha 6y agoI wonder if one could connect GDB to this by writing some sort of WASM backend for it?
- RReverser 6y agoYou will be able to build your own extension with any backend in the future, but I'm curious what you're looking to gain from that? I don't know whether GDB understands the Wasm-specific constructs in DWARF, while the current integration uses LLDB under the hood, which does support those.