Settings

Theme

Announcing Zstandard in Rust

trifectatech.org

60 points by jmillikin a day ago · 7 comments

Reader

ikawe 17 hours ago

It’d be nice if they at least mentioned the existing pure rust implementation.

https://github.com/KillingSpark/zstd-rs

And better yet if they compared it explicitly in their “why” section. As it is, I’m left guessing.

  • merlincorey 16 hours ago

    The "Why" section exclusively opens with a reference to zstd-rs:

    > Why though?

    > Using zstd in Rust is already supported via the zstd crate, so why bother with a whole new implementation?

    Separately, I'd say their end goal seems to be replacing the C library dependency in Rust's zstd-rs:

    > We have our own fork of the zstd that uses libzstd-rs-sys instead of the C library. We'd like to upstream this at some point.

zamalek 9 hours ago

That is an absolutely massive amount of unsafe, is the plan to reduce it over time? The benefits of the Rust build system are reason alone to use this (as a direct competitor to the C version), but claims about memory safety are suspect no matter how confident the authors are about correctness.

tnelsond4 5 hours ago

I was using the original zstd rust crate for my web app, but I couldn't get my module any smaller than 150kb, but when I switched to C for web app I was able to do a whole lot of optimizing and culling until I got it down to 39kb.

I wanted to like Rust, but I was using unsafe code for performance and such anyway that it made more sense to switch to C.

  • elevation 2 hours ago

    > I got it down to 39kb.

    If you're counting KBs and you have to include zstd yourself (a reverse proxy isn't handling it for you) does that mean you're targeting an embedded device? Are you supporting TLS at that size?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection