lensm icon indicating copy to clipboard operation
lensm copied to clipboard

Web version

Open TheYkk opened this issue 3 years ago • 9 comments

I think It would be great to use this tool on the web with webassembly.

TheYkk avatar Jul 18 '22 09:07 TheYkk

This implementation depends on being able to access source code and the binary. While uploading the binary is a trivial change, however accessing the local disk -- not so much. It'll be probably easier to run the program locally and use it that way.

I'm not against someone adding it, but I don't see a reason to add it myself.

egonelbre avatar Jul 18 '22 10:07 egonelbre

@TheYkk i agree that seeing the wasm matching the golang is really useful . Especially to see the output on tinygo compared to the standard golang wasm compiler.

I think that running it locally on your desktop should be the initial scope so that it’s easy to access local disk.

later we can use hackpadfs ( a web based file system weiten in golang ) to access the source and wasm in a browser .

let me know if desktop is suitable for phase 1

gedw99 avatar Jul 25 '22 20:07 gedw99

Sure, WebAssembly support definitely would be nice.

However, for supporting wasm you need a way to get source-line mapping... and AFAIK, Go doesn't emit dwarf/line-info https://github.com/golang/go/issues/33503

TinyGo might have sourcemap support, but I haven't checked.

So the first step would be to add necessary support for them.

Hackpadfs seems rather large dependency and I wouldn't want to pull it in. It also doesn't seem to solve the problem of accessing the data.

egonelbre avatar Jul 25 '22 21:07 egonelbre

TinyGo might have sourcemap support, but I haven't checked.

Yes, it works with TinyGo (just checked)

llindemann avatar Jul 29 '22 08:07 llindemann

@llindemann Got a demo of this ?

@egonelbre hackpadfs provides a file System in the browser itself . Does that help ?

gedw99 avatar Jul 29 '22 16:07 gedw99

@gedw99 the issue of getting data to the program isn't about having a filesystem, it's about uploading and/or binding to the local filesystem.

egonelbre avatar Jul 30 '22 04:07 egonelbre

@llindemann Got a demo of this ?

@gedw99 Yes, here: https://blog.noops.land/debugging-webAssembly-from-go-sources-in-chrome-devtools

llindemann avatar Aug 01 '22 15:08 llindemann

Hey @llindemann The article is really useful. I had no idea that debugging wasm was that easy in google chrome

gedw99 avatar Aug 01 '22 16:08 gedw99

I can confirm that tinygo def has DWARF support. Been using it for debug info for a few days.

https://github.com/emad-elsaid/debugger

gedw99 avatar Sep 29 '22 14:09 gedw99