How to avoid bounds checks in Rust (without unsafe!)

Memory Safety in a Modern Systems Programming Language Part 1

Taking over a Dead IoT Company

Issue #319



Another beautiful day on planet earth.
Here's the issue.


Today's Sponsor: Could be you!

Are you or your company interested in sponsoring the newsletter? Feel free to reach out to me by replying to this email or clicking the link above.


How to avoid bounds checks in Rust (without unsafe!)

Published: 17 January 2023
Tags: benchmarking, compiler, optimization, rust

Sergey "Shnatsel" Davidoff discusses the runtime cost of bounds checks on indexing and how to avoid them without resorting to unsafe code.
Some highlights:

  • Bounds checks are in place to prevent buffer overflow attacks
  • The real-world performance impact of bounds checks is surprisingly low, with the greatest impact being in the 1-3% range (improvement in speed)
  • Lots of info on profiling performance on different systems


Memory Safety in a Modern Systems Programming Language Part 1

Published: 21 June 2022
Tags: compiler, d

In this first article of the series, Ate Eskola discusses how memory safety can be achieved in D using scoped pointers.
Some highlights:

  • DIP1000 is a set of enhancements to the language rules regarding pointers, slices, and other references
  • DIP1000 is an attempt to solve reference lifetime problem by extending implementation of `scope` keyword
  • "there is no need for scope and return scope for function attributes if they receive only static or GC-allocated data"


Taking over a Dead IoT Company

Published: 9 January 2023
Tags: business, hardware, javascript, python

Kevin Chung breaks down the failure of a IoT sign creating company and dives into the hardware/software of their product.
Some highlights:

  • A mix of business/hardware/software
  • Kevin disassembles the product and discovers its failures
  • Kevin ties it back to his own project making a matrix LED sign


How did I do?

* Amazing
* Articles not relevant to me
* Articles were relevant, but badly written
* Summaries told me everything I wanted to know
* I like turtles

Want to help?

Thank you for reading! If you enjoy the newsletter, I would really appreciate you helping me spread the word by forwarding this to your friends and colleagues or sharing it on social media! Get cool stuff for your referrals using your link

Your referrals:

If you want to discuss or comment on this issue, head on over to this page at A Byte of Coding. You can also subscribe there if you're new!

Have comments or feedback? Just reply to this email or hit me up on Twitter @AByteOfCoding.

Email landed in your promotions tab? Please move it over to primary so you don't miss the latest issues in the future.
Thanks for your Support! 

Big thanks to all of the Patreon supports and company sponsors. If you want to support the newsletter you can checkout the Patreon page. It's not necessary, but it lets me know that I'm doing a good job and that you're finding value in the content.

Stats (updated daily)

Sent: 3040

Opens: 1459

Clicks: 287

Link Clicks Clicks % Unique Clicks Unique Clicks %
How to avoid bounds checks in Rust (without unsafe!) 69 32.70% 72 32.14
Memory Safety in a Modern Systems Programming Language Part 1 54 25.59% 56 25.00
Taking over a Dead IoT Company 88 41.71% 96 42.86


Back to Issues