atlanticaccent / starsector-mod-manager-rust

A mod manager for Starsector, a space fleet-battle and economics simulator. This time written in Rust.
https://atlanticaccent.github.io/starsector-mod-manager-rust/
MIT License
33 stars 1 forks source link

Target web #113

Open atlanticaccent opened 2 years ago

atlanticaccent commented 2 years ago

Rust supports wasm. Both iced and egui/eframe support wasm (the latter better than the former).

The real stickler is getting heavy duty archive support into the browser client. Whilst it's more than easy to build an app that uses a server client structure (client upload archive -> server unpacks -> server delivers loose files to client) that would have major overheads in terms of computation, scales incredibly poorly, has a huge number of security issues, is massively taxing in terms of network capacity to deliver every single file in the archive loosely, and worst of all makes the app no longer completely self contained (it's now arguably two apps).

As such, this task would require a libarchive port that either is in rust and can target wasm, or is the C lib ported to wasm. The latter will require an additional bridge between the rust code and the javascript wrapping the c-wasm lib, whilst the former probably would be a nightmare to compile.

This is incredibly worth doing however, because it means the app no longer requires a "real" download and will be useable from practically any device or OS, so long as it has a competently implemented browser (if it doesn't the user has bigger issues).

atlanticaccent commented 2 years ago

Ok yeah it'll probably be impossible to do anything with a rust crate