Top all-time · #4550
Sergey Davidoff
Personal blog · shnatsel.medium.comprogrammingsecurity
Sergey Davidoff writes Stories by Sergey "Shnatsel" Davidoff on Medium, a personal blog at shnatsel.medium.com about programming and security. Since 2021, 17 different Hacker News readers have linked it 21 times, most often “How to avoid bounds checks in Rust (without unsafe)”. It is still writing: the last post was on 2026-07-22, and you can follow it by feed.
Most-linked posts?
- How to avoid bounds checks in Rust (without unsafe)5 people · 5 mentions · first linked 2023-01-17
- Safe SIMD in Rust, even on the inside3 people · 3 mentions · first linked 2026-06-20
- rustc_codegen_GCC: The simpler alternative to GCC-RS3 people · 3 mentions · first linked 2021-05-30
- /how-rusts-standard-library-was-vulnerable-for-years-and-nobody-noticed-aebf0503c3d62 people · 4 mentions · first linked 2021-10-12
- Do not run any Cargo commands on untrusted projects2 people · 2 mentions · first linked 2025-03-03
What Hacker News says?
> Yes. Java and python are not competitive for graphics and audio processing. Because Python is an interpreted language and Java has garbage collection, not because they have bounds checking. Using a language like Rust the bounds checking overhead compared to C code is usually minimal, like 0-5%. The compiler can even optimize away many bounds checks (safely) if you structure your code properly, such as with iterato…
Comment linking /how-to-avoid-bounds-checks-in-rust-without-unsafe-f65e618b4c1e
on “The world could run on older hardware if software optimization was a priority”Submitted The state of SIMD in Rust in 2025 as a story · 237 points
HN discussionThere are many ways to get rid of bounds checking in Rust. One of those ways is just utilizing iterators. For alternatives, there's a bounds check cookbook you should checkout [0]. Thus far, I've written two libraries that utilize Rust, and they are usually associated with "high performance". I was able to exceed the performance of similar libraries written in C/C++. To be perfectly clear, this doesn't mean Rust can…
Comment linking /how-to-avoid-bounds-checks-in-rust-without-unsafe-f65e618b4c1e
on “Mold Linker Version 3.0.0 Release – Rewritten in Rust”Submitted Do not run any Cargo commands on untrusted projects as a story · 6 points
HN discussion> a nice low-level language The usability is not great, too opinionated. For example, they have decided their strings are guaranteed to contain valid UTF-8. Many external components (like Linux kernel) don’t have these guarantees, so the Rust has another OsString type for them. I think Rust is the only language which does that. The rest of them are fine keeping invalid UTF8 / UTF16 in their strings. > proper and eas…
Comment linking /how-rusts-standard-library-was-vulnerable-for-years-and-nobody-noticed-aebf0503c3d6
on “Scan HTML faster with SIMD instructions – Chrome edition”Submitted rustc_codegen_GCC: The simpler alternative to GCC-RS as a story · 5 points
HN discussionRust only catches integer overflows in debug builds, my C# programs catch it everywhere. The compiler setting is off by default but it is available. In Rust, many libraries especially the standard one have lots of unsafe code, with a history of security bugs there [1]. In C#, the standard library is written in almost 100% safe code. About threading, while it doesn't catch all data races automatically, C# implements…
Comment linking /how-rusts-standard-library-was-vulnerable-for-years-and-nobody-noticed-aebf0503c3d6
on “So You Want to Rust the Linux Kernel?”Submitted The simpler alternative to GCC-RS as a story · 2 points
HN discussion> C# is not more safe than Rust By design, Rust requires unsafe code to implement any non-trivial data structures (except trivial POD types). This applies to both Rust standard library, and third-party crates. The issue is not a theory, security bugs actually happened in reality. Here’s an example about the Rust standard library: https://shnatsel.medium.com/how-rusts-standard-library-was-v... By contrast, thanks to…
Comment linking /how-rusts-standard-library-was-vulnerable-for-years-and-nobody-noticed-aebf0503c3d6
on “OpenD, a D language fork that is open to your contributions”Submitted Safe SIMD in Rust, Even on the Inside – By Sergey "Shnatsel" Davidoff as a story · 1 points
HN discussionThanks, Frank. :) NGL, SIMD in Rust has not been a great experience. Philbin uses the "CPU Feature Tokens" pattern that the Fearless SIMD team (which the root article's author is a part of) came up with: https://shnatsel.medium.com/safe-simd-in-rust-even-on-the-in... The pattern provides a safe abstraction for runtime CPU detection and SIMD dispatch. It's gnarly AF, but Fearless SIMD 1.0 came out a few days ago so p…
Comment linking /safe-simd-in-rust-even-on-the-inside-c6f1ff381828
on “The state of SIMD in Rust in 2026”Submitted The unreasonable effectiveness of LLMs for auditing Rust code as a story · 1 points
HN discussionshnatsel wrote a post on bounds checking performance implications in Rust. Money quote: > The real-world performance impact of bounds checks is surprisingly low. > The greatest impact I’ve ever seen on real-world code from removing bounds checks alone was *15%,* but the typical gains are in *1% to 3% range,* and even that only happens in code that does a lot of number crunching. > You can occasionally see greater im…
Comment linking /how-to-avoid-bounds-checks-in-rust-without-unsafe-f65e618b4c1e
on “Rewrite the VP9 codec library in Rust”Submitted Safe SIMD in Rust, even on the inside as a story · 1 points
HN discussionIn case you hadn’t read the article making the case for this: https://shnatsel.medium.com/the-simpler-alternative-to-gcc-r... I thought it was pretty interesting, though based on the reddit comments ( https://reddit.com/r/rust/comments/noby1t/the_simpler_altern... ) the main concern seems to be if a second Rust is implemented without a spec, it could lead to subtle incompatibilities?
Comment linking /the-simpler-alternative-to-gcc-rs-90da2b3685d3
on “GCC Rust Monthly Report #6 May 2021”Submitted Smoke-testing Rust HTTP clients (2020) as a story · 1 points
HN discussion> What worries me is that when it comes to safety, surely the chain is as strong as the weakest link? You declare one thing unsafe, and then suddenly, all bets are off. And maybe you don't even know that what you're doing is unsafe. Yes, you are correct. If some code or module contains a memory safety or data race bug, then the code which uses it could realize that bug in the form of a crash or race. This paper is n…
Comment linking /auditing-popular-rust-crates-how-a-one-line-unsafe-has-nearly-ruined-everything-fab2d837ebb1
on “Is Rust Used Safely by Software Developers?”Submitted How to avoid bounds checks in Rust (without unsafe) as a story · 1 points
HN discussion> Writing the implementation in Rust does sigh , not true. https://tgrez.github.io/posts/2022-06-19-buffer-overflow-in-... https://shnatsel.medium.com/how-rusts-standard-library-was-v... "This is a buffer overflow bug in the standard library’s implementation of a double-ended queue." "Rust will panic if you attempt to write out of bounds." Writing the implementation will increase memory safety but only if the implem…
Comment linking /how-rusts-standard-library-was-vulnerable-for-years-and-nobody-noticed-aebf0503c3d6
on “Rosenpass – formally verified post-quantum WireGuard”> The article mentions bounds checks, but gives no measurements. Have they ever measured? Related, the prominent Rust community member "Shnatsel" wrote an article [1] about exactly that in January. It's a great look at the problem, and gives some actual data to evaluate with. [1]: https://shnatsel.medium.com/how-to-avoid-bounds-checks-in-ru...
Comment linking /how-to-avoid-bounds-checks-in-rust-without-unsafe-f65e618b4c1e
on “I think C++ is still a desirable coding platform compared to Rust”https://shnatsel.medium.com/do-not-run-any-cargo-commands-on... > any command starting with cargo can run arbitrary code when operating on an untrusted repository, and should be treated the same as cargo run.
Comment linking /do-not-run-any-cargo-commands-on-untrusted-projects-4c31c89a78d6
on “Supply Chain Attack on Arrayref”