I want to build a static app - a p2p github replacement - using a mix of Rust and Golang compiled to Wasm with a Svelte frontend (because I think Svelte + Rust/wasm has good tooling and I like Rust), which will rely on functionality provided by a Golang library (based on git-bug to implement issues in local and remote repos), and a git implementation (using a suitable Rust library).
Both the git and git-bug parts will need access to a filesystem interface to access github repositories which will be stored on a p2p storage system (https://safenetwork.tech).
So I'm wondering how best to structure this. git-bug uses the Go
os package which has a POSIX style fs interface, and my p2p storage will have a similar fs API made available via JS in the browser.
So I think I'll need to create a Rust fs emulation library which:
- can be called from git-bug in Golang by substituting the Go
- can be called from git-rs (or something providing git functionality) in Rust
- routes fs calls to the JS p2p storage API
This way my Svelte frontend can just talk to Rust, and the Rust can route any fs calls to the p2p storage API.
I've tested out a couple of trivial wasm apps in Rust and Golang, but not made anything which calls between Golang and Rust yet, so I'm wondering if my approach makes sense.
Any feedback or alternative ideas appreciated.