Perhaps it is faster than already-existing implementations, sure, but not "faster than C", and it is odd to make such claims.
Perhaps it is faster than already-existing implementations, sure, but not "faster than C", and it is odd to make such claims.
zlib-ng can be compiled to whatever target arch is necessary, and the original post doesn't mention how it was compiled and what architecture and so on.
It's another case not to trust micro benchmarks
I also wonder how much of an improvement you’d get by just asking for a “simple rewrite” in the existing language. I suspect there are often performance improvements to be had with simple changes in the existing language
5-15% is a big deal for a low-level foundational code, especially if you get it along with some other guarantees, which may be of greater importance.
As is the case with any languages, of course, it is not in favor (nor against) Rust.
Which is: people complaining about Rust zealots are much more than actual Rust zealots. Thinking of it, I haven't seen a proper Rust zealot on HN for at least a year at this point.
So I don't know, maybe do less cheap digs. Tearing down straw men is pretty boring to watch.
I'm currently working with ~150 dependencies in my current project which I know would be a major hurdle in previous C or C++ projects.
For example, cargo-vet and cargo-crev allow you to rely on others you trust to help audit dependencies.
Every interaction I've had with a rust programmer has led me to believe they are a toxic community of cultists. It's unlike any programming community I've seen.
I took 15 minutes to write one in Rust (a language I had just learned by that point) using a "that should work" approach and became second place, with some high effort C-implementations being slower and a highly optimized assembler variant taking first place.
Since then I programmed a lot more in C and C++ as well (for other reasons) and got more experience. Rust is not automatically faster, but the defaults and std library of Rust is so well put together that a common-sense approach will outperform most C code without even trying – and it does so while having typesafety and memory safety. This is not nothing in my book and still extremely impressive.
The best thing about learning Rust however was how much I learned for all the other languages. Because what you learn there is not just how to use Rust, but how to program well. Understanding the way the Rust borrow checker works 1000% helped me avoiding nasty bugs in C/C++ by realizing that I violatr ownership rules (e.g. by having multiple writers)
For example, he says they didn’t set out to improve the code, but they were porting decennia-old C code to rust. Given the subject (truetype font parsing and rendering), my guess would be that the original code had more memory copies copying data out of the font data because rust makes it easier to safely avoid that (in which case the conclusion would be “C could be as fast, but with a lot more effort”), but it could also be that they spent a day figuring out some code did to realize that it wasn’t necessary on anything after Windows 95, and stripped it out, rather than porting it.
I'm happy to share then. Here's my most recent encounter with a rustacean: https://x.com/_chjj/status/1829989494298460636
I asked if he/she/they had ever used the unsafe keyword. That was the response I got. It's usually some vile insult involving furry or transgender genitalia.
Yes, if your code in Lang-X is faster than C, it's almost certainly a skill issue somewhere in the C implementation.
However, in the day-to-day, if I can make my code run faster in Lang-X than C, especially if I'm using Lang-X for only a couple of months and C potentially for decades, that is absolutely meaningful. Sure, we can make the C code just as fast, but it's not viable to spend that much time and expertise on every small issue.
Outside of "which lang is better" discussions on online forums, it doesn't matter how fast you can theoretically make your program, it matters how fast you actually make it with the constraints your business have (time usually).
So I called the poster out to show proof. So far there's none, except one Twitter post (because we all know that's the best technical discussion forum on the planet, clearly) which does not surprise me at all.
So they are the ones who get triggered by something that does not exist.
That is what is toxic.
If you go around claiming fantasies and people call you out then that falls more under curiosity and discussion. Not toxicity.
Toxic people are everywhere on the net. That's not an interesting insight. If you point us at some lunatic on Twitter who loses their marbles over everything, that's not interesting either.
Do you get trolled on actual technical forums though?
EDIT: but I do agree that starting greenfield from an old code base is often a path towards performance.
I'm always reminded of this video, where the author writes the same program in Rust and Go.
https://www.youtube.com/watch?v=Z0GX2mTUtfo
> Now, the Rust version took me about five times as long as the Go version
> The Go one performed almost identically well
Now this was for netcode rather than number crunching. But I actually had a similar surprise with number crunching, with C# and C++. I wrote the same program (rational approximation of Pi), line for line, in both languages, and the C# version ran faster. Apparently C# aggressively optimizes hot code paths while running, whereas to get that behavior in C++, you need to collect profiler data and use a special compiler flag.
It is interesting how you can't see that you are inflating one nut case and extrapolating to an entire community.
Not necessarily—sometimes languages are especially poorly suited for tasks or difficult to hire for.
It’s trivial to find examples of people in any community who are a bit off the rails, but you shouldn’t let that define your perception of the community, especially given the fact that you’re currently in a context where your thesis doesn’t have much to support it.
What do you mean by that?
There is plenty of hand-rolled assembly in low-level libraries, whether you look at OpenBLAS (17%), GMP (36%), BoringSSL (25%), WolfSSL (14%) -- all of these numbers are based on looking at Github's language breakdown (which is measured on a per-file basis, so doesn't count inline asm or heavy use of intrinsics).
There are contexts where you want better performance guarantees than the compiler will give you. If you're dealing with cryptography, you probably want to guard against timing attacks via constant-time code. If you're dealing with math, maybe you really do want to eke out as much performance as possible, autovectorization just isn't doing what you want it to do, and your intrinsic-based code just isn't using all your registers as efficiently as you'd like.
But yes you are technically correct, congratulations.
If you're referring to my above post, I'm pointing out that you're having a very emotional reaction to what I'm saying. That's typically what I see from rust developers.
It is somewhat similar, actually, when someone states a negative opinion on Rust community and marketing around it. It is usually followed by those that say "you met wrong people".
Of course, you won't find any examples in this thread xd.
For the record, I only picked Rust 5-ish years ago out of a 23 years of career. I know plenty of other languages. I was a skeptic at the start as well. Never generalized a pretty big group like you do though.
You should be ashamed.
What I dislike, if we can even call it that, is that you misrepresent intentionally and are falling victim to extremely easy to avoid ego trips like claiming that your anecdotal evidence is universal.
That is not OK and is not intellectually fair.
Be intellectually fair. If you are not then I posit that you don't belong in tech as you have no scientific and analytic approach to things. That's my takeaway here.
You have left an extensive record of your bias in multiple comments. Including purposeful deflection and projection, as you try to make it out that I react emotionally. Which is false.
You seem like a lost cause though. So bye.
What is actually funny in our exchanges is that I don't even actively work with Rust anymore. I work with multiple languages, it included. I've met very smart, humble and fairly hardcore [Rust] devs from whom I learned a lot and got severely humbled as a result (as I was under the illusion that there's not much more I could learn in programming back then).
My other comments are fairly trivial English. Surely you can very easily make something out of them.
I wonder whether you believe these people would ever be endorsed by the faces of the Rust language or whether the majority of people in the community would behave so. In my experience (not to minimise yours), the Rust community and FOSS in general, are some of the most open and welcoming communities online, albeit with clear exceptions
Literally that's what you're saying: they have a different opinion therefore they're zealots!
Unless people posting an opinion is itself zealotry... but in that case why are you complaining about the replies and not the comments they reply to?
By claiming they are hard-working, you are generalizing. It is usually only a couple or few that are actually hard-working people, but then again, I am generalizing because I do not know, I do not wish to actually claim to know.
Judging by your comments, e.g. "you should be ashamed" (for simply expressing his dislike of YOUR community), you sound exactly like a zealot.
Why do you feel the need to claim moral superiority and tell someone to be ashamed just for simply expressing their dislike of your community? And while we are at it, he probably dislikes the community because of people like you. We have gone full circle.
I am not even going to bother commenting on a lot of things you have said, but:
> My other comments are fairly trivial English. Surely you can very easily make something out of them.
Sounds condescending as well, but this is a minor nitpick. :)
Obviously the code isn't going anywhere, and obviously we DO have reliable code we've built with C. But acting like C and Rust deliver equivalent value is simply farcical: you choose C for rapid development and cheap devs (or some other niche concern, like using an obscure embedded arch), and you choose rust to solve the problems that C introduced.
I think exegesis is a skill you need to hone further.
Fair, I appreciate the call-out and it's a valid one.
> Judging by your comments, e.g. "you should be ashamed" (for simply expressing his dislike of YOUR community), you sound exactly like a zealot.
It's not that. I said he should be ashamed because he doubled down on generalizing. Even said he usually does that a lot. To me if you work in tech you should be more analytical and more unforgiving towards your own assessments. We all thought the bug is in X but it turned it was in Y, right? That's what I called out.
As you yourself pointed out, we don't truly know much people in the community are generally nice and hard-working, which I agree is an accurate call for a balanced take.
My problem is the outright negative generalization. I was in the mood and didn't leave him alone about it. He eventually seems to have admitted that he only demonstrated his own anecdotal evidence. I disengaged at that point because that's a valid way to exit a discussion... though I still would worry what kind of people he communicated with if he had such an overwhelming negative experience, and only with its most lunatic members to boot.
You are free to think of me as a zealot but I'd think that's an emotional and unfair reaction and would ask you to revise it. My comments were not a stubborn push-back, but a call to being objective.
> Why do you feel the need to claim moral superiority and tell someone to be ashamed just for simply expressing their dislike of your community? And while we are at it, he probably dislikes the community because of people like you. We have gone full circle.
I claimed analytical superiority, not a moral one. I've met Rust zealots. I've met Golang and (oh boy are they MANY) C/C++ zealots. Even my favorite Elixir has some weird people that think everything should be written with it.
The difference between me and the poster you seem to defend a bit emotionally is that I don't claim my outlier negative experiences are the norm. He did that. I did not.
As for the full circle thing: I ain't giving the other cheek. I don't owe grace to people who are rudely generalizing. I am aware many people would assess me much better if I just gave the other cheek. I know. But I choose not to abide by those expectations. Sadly this leads to people like yourself branding me like a zealot. Regrettable. But it's ultimately your loss for missing out on interesting and informed and unbiased discussions with me.
Feel free to check my comment history. I am not always super level-headed but I always look for the truth.
> Sounds condescending as well, but this is a minor nitpick. :)
Couldn't resist, admittedly. See above. ;)
And it's not "my" community. I don't belong to a single one so I don't emotionally defend any of them.
I mean, by that logic, people of my nationality would have to be fenced off and never allowed in other countries... because we do indeed have thousands of nasty scammers out there in the world.
99.99999% of us are chill, work, pay taxes, have fun etc.
So generalizations like the one that moved me to start pursuing the guy and not leave him alone until he ultimately said "it's just my anecdotal experience" (and stopped claiming it's universally true), because you know, we can pick ANY group, find several lunatics and claim the group is bad in this or that way.
As said to another guy a few minutes ago -- I can get such "opinions" in every bar. I come to HN for better discussions than this.
How do you know this exactly?
The answer is that its more ergonomic and easier to reason about. So while you can TECHNICALLY have "algebraic data types" in C i.e. "its just a tagged union so whats the big deal?" I prefer to use them in Rust than C, for whatever unknown reason...
I also don't want to spend my brain cells thinking about pointer provenance and which void* aliases with each other. I would rather spend it on something else, thank you very much.