-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
What if pngquant was written in Rust? #161
Comments
I do not know. Just recently learned about Rust. I like the good performance of the libimagequant library, and as long as that stays, I guess it will be okay? Make sure you do not change the API. Btw, still waiting on that custom palette setting function. :-) |
Hi, is Rust OS independent ? |
Rust certainly supports Linux, although it may take some time before distros create packages for it: It also getting musl support, which as far as I understand, allows it to create static binaries that work without glibc, so are compatible with any Linux distro (on x86/x64) |
While support for Linux may just be a question of time, older and/or more exotic platforms such as IRIX will probably never get a functioning rust compiler. Currently, pngquant can be compiled basically everywhere even with ancient C compilers. I'd prefer if you'd stick with C and not use features from standards newer than C99. |
Rust is on its way to Fedora and Debian. For platforms without packages it's easy to install and keep up to update via rustup. It can target iOS, Android, *BSD, PPC and MIPS Linux. Not IRIX though. Currently pngquant is annoying on Windows due to poor C support in Visual Studio, POSIX-isms in the code, and need for bash-based configure script. OTOH Rust has very good support for Windows, and Cargo build scripts can be used to hide the pains of C integration. For a while now I've stopped using C for and have been using Rust instead for all new projects, and I'm quite happy with it. For now pngquant works well enough, so I don't feel pressure rewriting it immediately. But if I decide to add any major functionality, I'll probably split libimagequant and pngquant, and rewrite |
Found this today: https://fedoramagazine.org/rust-meets-fedora/ |
I'd also recommend considering Go. It could be great for what you're trying to accomplish. |
I'm already having great results in Rust. Since pngquant and libimagequant are C projects, I think Rust, which does not have GC runtime and can produce pure "C" libraries, is a much better fit for this project. |
Rust is fine, please not Go. |
Now It's still all 100% C, but everything is in Cargo packages. Almost builds on Windows, too. https://crates.io/crates/imagequant-sys |
First Rust code has landed! The good news is the whole program builds on Windows out of the box! |
See #252 |
I'm seeking feedback on moving parts of pngquant from C99 to Rust. At first I'd only move pngquant CLI executable to Rust, but leave libimagequant as a pure C library.
It would build as a statically linked binary on OS X, Linux and Windows, x86 and x86_64. Rust's support for other architectures exists, but AFAIK is still immature.
How does this impact you?
The text was updated successfully, but these errors were encountered: