Originally posted by smitty3268
View Post
Rust-Based, Memory-Safe PNG Decoders "Vastly Outperform" C-Based PNG Libraries
Collapse
X
-
-
-
Originally posted by hasnoidea View Post
Idk where you live that your graduates are "noobs". But sounds like you should start a school yourself then.
Comment
-
-
Originally posted by TheMightyBuzzard View Post
That's kind of the point. If someone else uses features you weren't taught all over the place, they've written write-only code.
(And yes, metaclasses are a Python language construct, not just a design pattern. They're an extension of the Python type system that are to classes as classes are to instances. I'm not sure whether it's a more C++-ish or Haskell-ish idea.)
Second, as with Django ORM, most people aren't writing or maintaining the next Serde. I've never implemented a "tt muncher" in Rust's declarative macro system because I've never needed to... just like the overwhelming majority of people.Last edited by ssokolow; 10 December 2024, 09:21 AM.
Comment
-
-
Originally posted by ssokolow View PostIt's been my experience that these rewrites aren't to prove anything but, rather, to escape the hassle of integrating with C's (lack of a) build system.
C does not have a build tool - it works with any build tool. Similarly, it has no package manager, or centralised library repository. This makes things flexible, and you can make your own choices about how to handle things. But also inconsistent and people do lots re-invention of wheels. But it is a poor C programmer who can't write at least a very simple makefile and type "make" for their build. Bigger projects will, naturally, require more effort in their build tools - but that is no different for Rust or any other language. After all, your tools should handle things well beyond just the language - you need to work with testing, deployment, "linting", documentation generation, and many other features.
Originally posted by ssokolow View PostIf you have a pure Rust codebase, for example, you can statically link musl-libc instead of dynamically linking glibc for non-cross-compiling Linux builds (i.e. achieve a Go-like result for deployment to Linux on the same ISA) just by rustup target add-ing a musl-libc target and then specifying it via --target when invoking cargo build or cargo run.​
Originally posted by ssokolow View Post(The convenience of Rust's tooling is actually one of the things I saw C and C++ devs commenting on most when coming over to Rust, and it's also the inspiration for the least bad of the build/dependency management systems currently available for Python.)
...so, basically, the exact same reason the Go ecosystem is NIH-ing the world except that Rust has a whole ecosystem (1, 2) of tooling for exposing bindings to Rust libraries for non-Rust languages and Rust is also more suited for compiling to WebAssembly than Go is.
What I can say for sure, however, is that there is no one-size-fits-all for tooling. Look at package management, for example. For some kinds of development, you want to be able to get the latest versions of libraries quickly and easily - often you want to pull in fixes to packages as soon as you can. (You'd also want to use dynamic linking for libraries whenever possible.) But for other kinds of development, that's the last thing you would consider - you want everything to be as static and fixed as you possible.
So as I see it, there is no single "correct" philosophy here. Standardising tools will be good for some people and bad for others. For every C or C++ developer who says they wish C++ had something like "cargo", there will be another one saying they are glad C++ does not push anyone into a standardised package management tool and a third who says they wish there was a standardised C++ package tool but it should work in a completely different manner from "cargo".
Comment
-
-
Originally posted by DavidBrown View PostThat is not a motivation for re-writing the PNG libraries (or any other existing code). It might be a motivation for choosing Rust as the language for a re-write, but not for doing the re-write in the first place.
C does not have a build tool - it works with any build tool. Similarly, it has no package manager, or centralised library repository. This makes things flexible, and you can make your own choices about how to handle things. But also inconsistent and people do lots re-invention of wheels. But it is a poor C programmer who can't write at least a very simple makefile and type "make" for their build. Bigger projects will, naturally, require more effort in their build tools - but that is no different for Rust or any other language. After all, your tools should handle things well beyond just the language - you need to work with testing, deployment, "linting", documentation generation, and many other features.
It's another of those "Don't like it? Then get off your ass and compete! I'm doing something to address my needs, whether or not you like what I'm doing." situations.
Originally posted by DavidBrown View PostI don't follow this - there is no problem statically linking C code to musl-libc if that's what you want to do.
Originally posted by DavidBrown View PostI don't know the Rust tools well, so things I say here might not be accurate.
What I can say for sure, however, is that there is no one-size-fits-all for tooling. Look at package management, for example. For some kinds of development, you want to be able to get the latest versions of libraries quickly and easily - often you want to pull in fixes to packages as soon as you can. (You'd also want to use dynamic linking for libraries whenever possible.) But for other kinds of development, that's the last thing you would consider - you want everything to be as static and fixed as you possible.
So as I see it, there is no single "correct" philosophy here. Standardising tools will be good for some people and bad for others. For every C or C++ developer who says they wish C++ had something like "cargo", there will be another one saying they are glad C++ does not push anyone into a standardised package management tool and a third who says they wish there was a standardised C++ package tool but it should work in a completely different manner from "cargo".
Comment
-
-
Another article about something Rust, and again it sets the comments on fire. Again, trying to falsely attribute Rust with being fast. And all it took was for Phoronix to quote a Reddit article. Did people even look past the inflammatory Reddit article? It does not look that way judging by the number of insults and tangents. Just one search for "fast png library" yields me fpng, which is said to be a very fast C++ PNG reader/writer with 23x faster compression and 2.5x-3x faster decompression compared to libpng. Thus, Wuffs claim of being fastest with 1.5x-2.75x when compared to libpng falls short of its claim. The author of fpng even compares to Wuffs PNG with being 10% faster than Wuffs.Last edited by sdack; 10 December 2024, 10:09 AM.
Comment
-
-
Originally posted by sdack View PostJust one search for "fast png library" yields me fpng, which is said to be a very fast C++ PNG reader/writer with 23x faster compression and 2.5x-3x faster decompression compared to libpng. Thus, Wuffs claim of being fastest with 1.5x-2.75x when compared to libpng falls short of its claim.
However! Since we're talking about fpng, it would be remiss of me to mention that the Rust png crate adopted the fpng algorithm in its fast compression mode. So if you use Rust, you get the benefits of fpng transparently, without having to pull down a whole other library and adding a codepath for a whole new API.
And there used to be a fast path for decoding fpng-encoded images in Rust's png crate as well, but it got removed because the general-purpose decoding code is just as fast.
Comment
-
-
Originally posted by ssokolow View Post
First, I didn't say you never learn them. I'm saying that any language (except maybe Go, given it tries to be primitive so the learning process is short) has a learning curve. I don't see you criticizing Python, yet most people (myself included) have never needed to get into the kind of metaclass hackery that allows what gets instantiated by Django ORM to be different from what you write.
(And yes, metaclasses are a Python language construct, not just a design pattern. They're an extension of the Python type system that are to classes as classes are to instances. I'm not sure whether it's a more C++-ish or Haskell-ish idea.)
Second, as with Django ORM, most people aren't writing or maintaining the next Serde. I've never implemented a "tt muncher" in Rust's declarative macro system because I've never needed to... just like the overwhelming majority of people.
As for the rest? There are plenty of ordinary places where obscure arcane trickery isn't strictly needed but the code could significantly benefit from it. In any language. Which is what we're talking about. Strawmaning it off and acting like it only gets done in Rust in libs like Serde is straight bullshit.
Comment
-
-
Originally posted by TheMightyBuzzard View Post
Criticizing Python is redundant.
As for the rest? There are plenty of ordinary places where obscure arcane trickery isn't strictly needed but the code could significantly benefit from it. In any language. Which is what we're talking about. Strawmaning it off and acting like it only gets done in Rust in libs like Serde is straight bullshit.
Comment
-
-
Originally posted by Shnatsel View Post... it would be remiss of me to mention that the Rust png crate adopted the fpng algorithm in its fast compression mode. So if you use Rust ...
Comment
-
Comment