News for hackers. Stuff that matters.

pretzelhammer

Re:Using Rust in Non-Rust Servers to Improve Performance on Monday October 28, 2024 @06:01PM (#41976910)
As the article mentions, the test server had 12 cores. The Node.js server ran in "cluster mode" so that all 12 cores were utilized during benchmarking. You can see the implementation here (just ~20 lines of JS): https://github.com/pretzelhammer/using-rust-in-non-rust-serv...
Re:Using Rust in Non-Rust Servers to Improve Performance on Monday October 28, 2024 @05:31PM (#41976559)
Here's the list of my benchmark targets: https://github.com/pretzelhammer/using-rust-in-non-rust-serv...

Vegeta, the tool I used for benchmarking, iterates through all those targets round-robin style while attacking the server and then averages the results when reporting the average response size in bytes (and it only measures the size of the response body, it doesn't include other things like headers).

Even using the same library and same compression algorithm not all 200px by 200px QR code PNGs will compress to the same size. How well they can be compressed depends a lot on the encoded piece of text as that determines the visual complexity of the generated QR code.

Re:Using Rust in Non-Rust Servers to Improve Performance on Monday October 28, 2024 @03:14PM (#41974940)
Author here. The benchmarking tool I used for measuring response size was vegeta, which ignores HTTP headers in its measurements. I believe the difference in size is indeed in the QR code images themselves.
Re:Using Rust in Non-Rust Servers to Improve Performance on Monday October 28, 2024 @03:11PM (#41974900)
Author here. I believe I generated both of those images using the Rust lib, they shouldn't be used for comparing the compression performance of the JS lib vs the Rust lib.
Re:Show HN: Tiny Brainfuck Compilers Written in Rust on Wednesday November 11, 2020 @09:59AM (#25058885)
I wrote 4 tiny brainfuck compilers in Rust targeting x86, ARM, WebAssembly, and LLVM. The code is 100% safe Rust and is dependency-free. Excluding shared code (just the brainfuck parser) each compiler is standalone and is between just 100-180 lines of Rust. To share my learning experiences I wrote an accompanying article called Learn Assembly by Writing Entirely Too Many Brainfuck Compilers in Rust which goes into detail of how I arrived at all my implementations: https://github.com/pretzelhammer/rust-blog/blob/master/posts...

Please let me know if you have any questions or feedback. Thank you!

Re:Common Rust Lifetime Misconceptions on Saturday May 23, 2020 @10:34AM (#23283252)
I also came to Rust from JS! I plan to write an article in the future comparing Rust to Typescript.
Re:Common Rust Lifetime Misconceptions on Saturday May 23, 2020 @09:48AM (#23282906)
Hi, document author here. I learned Rust because I was too scared to learn C++, lol.

Rust has a steeper learning curve than most languages but it also has a very beginner-friendly and welcoming community. So don't be scared, you can do it! If you get stuck on something it's always easy to get help.

Re:Learning Rust in 2020 on Wednesday May 13, 2020 @09:00AM (#23166444)
Hi, author here. I enjoy reading about programming and I think it's fun, just not _as fun_ as programming. I tried to choose my words carefully because I didn't want to come across like I was bashing reading. Perhaps I should have said, "reading about programming is fun but programming is even more fun."

Learning the hard concepts in Rust is the best part, but The Book isn't going to teach you those. The Book, by design, is a very broad but shallow overview of the entire language. It'll never teach you, for example, why you can't write a self-referential struct in Rust. That's a lesson every Rustacean has to learn the hard way: by programming in Rust. And that's what I hope to encourage more Rust beginners to do: learn the hard lessons by actively programming in Rust.

Re:Learning Rust in 2020 on Wednesday May 13, 2020 @08:23AM (#23166123)
Hi, author here. Rustlings took me only a few hours but I came back to it after I had already finished reading The Book and finished about ~100 exercises between LeetCode and Exercism, so my experience with Rustlings wasn't that of a "true newbie". I still think it's one of the best resources out there, but like anything it can continually improve.

Your feedback as a beginner is very valuable! If you have some structured feedback for Rustlings please consider opening an issue on the repo. Also, the official Rust Discord Server is very beginner-friendly and has a #beginners channel, if you're struggling with anything don't be afraid to join and ask your question. The invite for the server is here https://discord.com/invite/rust-lang

Re:Learning Rust in 2020 on Wednesday May 13, 2020 @08:08AM (#23165981)
A Rustacean recently started https://tourofrust.com/ as the Rust-version of the Tour of Go! It's still WIP but looks pretty great so far.