so, i ported #GlasgowInterfaceExplorer to webusb

this is the culmination of my effort to cross-compile literally every fpga-related tool to webassembly, i think

the code isn't... great, mostly because a bunch of things i never intended to be async had to become async. so i'll have to refactor it first

i get about 60% of the native performance in a simple benchmark

here's the pull request with webusb bits that i cleaned up so that they're not awful https://github.com/GlasgowEmbedded/glasgow/pull/958

there are also toolchain bits. the toolchain bits are awful. i am too ashamed to post them

how cool is this?
@whitequark does this mean i can comfortably-ish use glasgow on my phone :3
@dramforever @whitequark does the phone support WebUSB by the default browser?
I just go in to apocalypse theory tinkering, likely it will be fine(🔥).
@whitequark On a scale from "meh" to "very", I'd say "extremely cool" :D
@whitequark for completely untuned/unoptimized? That is totally solid in my book

@jhwgh1968 also the latency is 10x worse lol

400us->4000us

dunno why

@whitequark for the USB bits specifically? I would've hoped USB were the bottleneck there, is it just increased request-response-repeat time/latency?

@equinox yeah

i have no idea why it's slow. maybe chromium doesn't queue enough in-flight requests or something. it's hard to debug this stuff

@whitequark +9000 on "hard to debug this stuff", I've got a bunch of painful memories debugging around the URB layer & particularly when exactly what happens and why 😬
@equinox yes but what i mean more specifically here is that everything is wrapped in a layer of webkit. which i don't appreciate
@whitequark ah. Huh. I would've expected *that* interface to not be all that different from what libusb does. Never looked at it, Firefox user 😅

@equinox it's basically libusb with a few things renamed, but the problem is that... ok, consider this

if my native application breaks while doing syscalls, i run strace
if it's slow i run perf

now image running that on a browser tab.

@whitequark right. Ugh. I've used JS level perf tools before, but no clue about somehow getting useful perf (or trace) out of wasm…

Anyway I shall stop wasting your time, happy hacking & appreciate a whole bunch of your stuff! 😊

@whitequark That's cool as heck?? I'd really want one, but I don't have an immediate need for it and I definitely don't have the money right now, but it is on my wishlist! You're building such a cool project...