5 ms·
Great work. Put it on my favourite list now. Do you have any tips for debugging? I use the same combo Rust-WASM for my Glicol music programming language: https
by chaosprint 5y ago
Great work. Put it on my favourite list now. Do you have any tips for debugging? I use the same combo Rust-WASM for my Glicol music programming language:
https://glicol.org https://glicol.org
The audio runs in AudioWorklet thread while I guess for Zaplib it runs in Workers, right? Did you use SAB in Zaplib?
For me, one use case is to use Zaplib for visualising the audio. The built-in canvas and 2d drawing is really slow. Yet one concern is for the support on Safari. It really has a slow support for SAB. I have to switch to postMessage on Safari as a compromise.
- janpaul123 5y agoThat looks awesome! For debugging we support full Rust source maps in the browser (using DWARF). :D (This is something that wasm-bindgen doesn't support, for example!) See https://zaplib.com/docs/developer_environment.html#chrome-debugging https://zaplib.com/docs/developer_environment.html#chrome-de... for how to set it up. Since we also support running the Rust code natively (even when doing rendering!) you can also use that and attach whatever native debugger you like. That same page also has info on how to set up native debugging with VSCode.
- chaosprint 5y agoreally cool. I will try to test it on the weekend.
- janpaul123 5y agoRe audio: yeah we currently only use Web Workers and we don't have audio support yet. We do use SAB, but we're thinking of adding support for running without SAB so you can use it with older browsers.
- chaosprint 5y agoThat would be a smart move as SAB also requires CORS now, which adds more trouble for getting started. It can be a feature to keep for some context that really needs to get rid of GC such as audio.
- janpaul123 5y agoYeah exactly; the headers are such a pain to set up!
- chaosprint 5y agoI always encourage users to use vite, and it is quite easy for the dev server. https://github.com/vitejs/vite/issues/3909 https://github.com/vitejs/vite/issues/3909 For deployment it's a different story then but for example netlify has a quite intuitive way to set headers for CORS: https://github.com/padenot/ringbuf.js/blob/master/public/_headers https://github.com/padenot/ringbuf.js/blob/master/public/_he...