The frontend Svelte code should be able to talk to a client-side WASM Rust or Python "backend" easily, or even a remote one. The difference is ideally mostly invisible to the frontend. The WASM backend should run in a web worker, be called async (maybe via https://github.com/GoogleChromeLabs/comlink?), and have a well-defined TS API. Stuart also pointed to https://github.com/WebAssembly/component-model as possible inspiration / something to use.
The frontend Svelte code should be able to talk to a client-side WASM Rust or Python "backend" easily, or even a remote one. The difference is ideally mostly invisible to the frontend. The WASM backend should run in a web worker, be called async (maybe via https://github.com/GoogleChromeLabs/comlink?), and have a well-defined TS API. Stuart also pointed to https://github.com/WebAssembly/component-model as possible inspiration / something to use.
Edit: adapt https://github.com/stuartlynn/Component_model_example