Open burmecia opened 5 years ago
This would be possible at the cost of platform independency. See #36 for example.
Additionally, when I last tried wasm with Rust months ago, crates required ![no_std]
to properly work. lz4-sys
is no_std
but lz4
uses collections and IO traits.
I just looked it up and I think wasm does not require no_std
, but a lot of libstd
is simply unsupported.
For your specific problem, I'ld suggest doing one of two things:
Alright, I just saw you did that already, awesome :-)
https://github.com/burmecia/lz4-rs
This crate needs some tidying up anyways, so I think, I'll note wasm support for a future lz4 2.0, where I am going to add stream mode and refactor the API to match alexcrichton's flate2
Thanks @jheyens. Yes, I've already forked and am playing around with it, hopefully will make it run in browser!
Is that possible to support wasm? I know currently
libc
crate doesn't support wasm yet (https://github.com/rust-lang/libc/pull/1126), but since this crate only used limited number of c types (c_char, c_int and etc.). Replace them with Rust types like i8, i32 and etc, could be a possible temporary solution.Any thoughts?