Live data from Hacker News

Zlib-rs is faster than C

trifectatech.org

371–380 of 492 posts

Re: Zlib-rs is faster than C

#371
post #303

Earlier quoted context omitted.

> never actually seen the people doing that thing 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.

Do you not think that the thread you’re currently on here on HN has a lot of rust programmers? So your “most recent encounter” is actually this thread. 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.

Fair enough. I suppose it is my most recent encounter. The result: I still don't like the rust community. You may have different opinions. I see no issue here.

Re: Zlib-rs is faster than C

#372

Earlier quoted context omitted.

No you don’t. You can use the standard linked list that is already included in the standard library. Coming up with these niche examples of things you need unsafe for in order to discredit rust’s safety guarantees is just not interesting. What fraction of programmer time is spent writing custom linked lists? Surely way less than 1%. In most of the other 99%, Rust is very helpful.

I think the point is that it's funny that the standard library has to use unsafe to implement a data structure that's like the second data structure you learn in an intro to CS class

Why is it particularly funny?

C has to make a syscall to the kernel which ultimately results in a BIOS interrupt to implement printf, which you need for the hello world program on page 1 of K&R.

Does that mean that C has no abstraction advantage over directly coding interrupts with asm? Of course not.

Re: Zlib-rs is faster than C

#373
post #363

Earlier quoted context omitted.

- Insult a group with generalization - Members of the group respond non-kindly - "Help! I am being repressed!" I mean, maybe you should try more balanced take next time. Just a thought.

I don't ever recall saying I'm being repressed. Could you point out where I said that? 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.

Where do you see emotional reaction?

All I do in each reply is point out how you generalize and get surprised that you are being called out.

No emotional reactions. Show me where they are?

Re: Zlib-rs is faster than C

#374
post #363

Earlier quoted context omitted.

- Insult a group with generalization - Members of the group respond non-kindly - "Help! I am being repressed!" I mean, maybe you should try more balanced take next time. Just a thought.

I don't ever recall saying I'm being repressed. Could you point out where I said that? 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.

https://www.youtube.com/watch?v=QVVV6AfFZfI&t=0m33s

Re: Zlib-rs is faster than C

#375
post #133

Earlier quoted context omitted.

[flagged]

I am hopping on Rust threads on HN very regularly and I have to tell you my anecdotal experience. 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.

Funny, because I could swear that for every comment that rises some criticism against Rust design/implementation/ergonomics/whatever, I find a dozen that "respectfully disagree", i.e. try very hard to deny validity of original claims.

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.

Re: Zlib-rs is faster than C

#376
post #371

Earlier quoted context omitted.

Do you not think that the thread you’re currently on here on HN has a lot of rust programmers? So your “most recent encounter” is actually this thread. 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.

Fair enough. I suppose it is my most recent encounter. The result: I still don't like the rust community. You may have different opinions. I see no issue here.

I see the issue. Biased people like yourself don't belong in tech.

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.

Re: Zlib-rs is faster than C

#377

Earlier quoted context omitted.

This is not really true. You have to uphold those guarantees yourself. With unsafe preconditions, if you don't, the code will still crash loudly (which is better than undefined behaviour).

With unsafe you get exactly the same kind of semantics as C, if you don't uphold the invariant the unsafe functions expect, you end up with UB exactly like in C. If you want a clean crash instead on indeterministic behavior, you need to use assert like in C, but it won't save you from compiler optimization removing checks that are deemed useless (again, exactly like in C).

> With unsafe you get exactly the same kind of semantics as C, if you don't uphold the invariant the unsafe functions expect, you end up with UB exactly like in C.

This is not exactly true. Even in production code, unsafe preconditions check if you violate these rules.

Here: https://doc.rust-lang.org/core/macro.assert_unsafe_precondit... And here: https://google.github.io/comprehensive-rust/unsafe-rust/unsa...

Re: Zlib-rs is faster than C

#378

Earlier quoted context omitted.

I am hopping on Rust threads on HN very regularly and I have to tell you my anecdotal experience. 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.

Funny, because I could swear that for every comment that rises some criticism against Rust design/implementation/ergonomics/whatever, I find a dozen that "respectfully disagree", i.e. try very hard to deny validity of original claims. 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 c…

You can swear on anything, does not make it any more true. ¯\_(ツ)_/¯

All you do is defend very anecdotal evidence. Surely you can see this is not logically compelling.

Re: Zlib-rs is faster than C

#379
post #348

Earlier quoted context omitted.

I'm not sure why people say this about certain languages (it is sometimes said about Haskell, as well). The code has a C style to it, but that doesn't mean it wasn't actually written in Rust -- Rust deliberately has features to support writing this kind of code, in concert with safer, stricter code. Imagine if we applied this standard to C code. "Zlib-NG is basically written in assembler, not C..." https://github.com…

> Imagine if we applied this standard to C code. "Zlib-NG is basically written in assembler, not C..." We absolutely should, if someone claimed/implied-via-headline that naive C was natively as fast as hand-tuned assembly! This kind of context matters. FWIW: I'm not talking about the assembly in zlib-rs, I was specifically limiting my analysis to the rust layers doing memory organization, etc... Discussing Rust is ju…

I'm not sure anyone really believes `zlib-rs` is a good example of idiomatic Rust performance, though

Maybe the reason I think that is because I've written Rust for a variety of purposes (web application, database bindings, high performance parser) so I account for the "register" of Rust that is appropriate without thinking about it.

https://en.wikipedia.org/wiki/Register_(sociolinguistics)

It might be that a simple description like the headline leads some people to believe they could write Rust the easy way and get code that's as fast as writing "Rust the hard way".

However, that is different than what you earlier said -- "It's... basically written in C.". I have actually written Rust programs where some parts were literally written in C and linked in -- in order to build functioning plugins -- and there is a world of difference with that.

Regarding

Discussing Rust is just exhausting. It's one digression after another, like the community can't just take a reasonable point ("zlib-rs isn't a good example of idiomatic rust performance") on its face.

I'm just not sure what to say to this. What do you expect from me, here?

Re: Zlib-rs is faster than C

#380
post #363

Earlier quoted context omitted.

I don't ever recall saying I'm being repressed. Could you point out where I said that? 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.

Where do you see emotional reaction? All I do in each reply is point out how you generalize and get surprised that you are being called out. No emotional reactions. Show me where they are?

[flagged]
Post reply on HN