asomers / blosc-rs Goto Github PK
View Code? Open in Web Editor NEWRust bindings for C-Blosc
Rust bindings for C-Blosc
This crate allows copying values of arbitrary type, which can lead to double free.
Only values that are Copy
should be allowed to be compressed/decompressed.
Example:
fn main() {
let data: Vec<String> = vec!["string".into()];
let ctx = blosc::Context::new();
let compressed = ctx.compress(&data);
let decompressed = blosc::decompress(&compressed).unwrap();
drop(data);
drop(decompressed); // Double free
}
blosc-rs uses galvanic-test in its integration tests. However, that crate is unmaintained and it's been surpassed by rstest. We should switch to rstest.
By linking a C library, it's obviously harder to get blosc-rs to run in a browser. However, c-blosc itself can be compiled to WASM (see Blosc/c-blosc#238 (comment) and https://github.com/manzt/numcodecs.js/tree/main/codecs/blosc ). I don't know much about linking C libraries or WASM itself (other than running cargo build
and praying...); is it possible to bake that kind of configuration into a build.rs
and gain WASM support for blosc-sys? I gather the hard bit is the FFI between rust and C.
I suppose there could alternatively be a separate crate which generates a WASM blob as above and then writes a dependent rust wrapper around it with js_sys for API niceness.
When trying to build a small project with blosc
as a dependency, I get this linker error:
= note: ld: library 'blosc' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
blosc version: 0.2.0
OS: Mac
Processor: Apple Silicon
Rust version: 1.73.0
Per discussion in #17 C-Blosc has removed Snappy support. blosc-rs should follow suit and deprecate it.
This is due to unconditional setting of the two last parameters of blosc_get_complib_info
and blosc_get_complib_info
not accepting a string which it does not recognize.
This is fixed upstream, but older libraries are still in use by some distros
Blosc/c-blosc#227
Blosc/c-blosc#228
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.