Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile to WASM #1

Open
Tails opened this issue Oct 8, 2022 · 1 comment
Open

Compile to WASM #1

Tails opened this issue Oct 8, 2022 · 1 comment

Comments

@Tails
Copy link

Tails commented Oct 8, 2022

Hi Chris,

thanks for this! Does the code support WASM as a compilation target so it can be loaded in a browser?

@chriscoomber
Copy link
Owner

Hi, I'm afraid I don't know much about compiling to WASM. I haven't done anything special to make that work. The short answer is I don't have any time to test it out, I'm afraid. I'll happily accept Pull Requests.

This library provides Rust bindings for a C library (which is actually bundled with the library, since it's a single file). Based on reading https://rustwasm.github.io/docs/book/reference/add-wasm-support-to-crate.html and https://rustwasm.github.io/docs/book/reference/which-crates-work-with-wasm.html, it seems like it might not work at all because of the C file, however I recommend testing it anyway.

Also, if you want to consume this crate directly with JS code (rather than with other rust code), someone would need to add JS bindings to it, I think. (The #[wasm_bindgen] stuff.) Possibly it makes sense for that to be a separate crate? (bindings of bindings...)

After all of that, it might be easier to write the C library in pure rust (and no_std probably)! But one would have to understand soundfonts for that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants