/Rust

Rust std fs Slower Than Python!? No, It's Hardware!

- Xuan Wo tl;dr: "I'm about to share a lengthy tale that begins with opendal op.read() and concludes with an unexpected twist. This journey was quite enlightening for me, and I hope it will be for you too. I'll do my best to recreate the experience, complete with the lessons I've learned along the way. Let's dive in!"

featured in #469


When Zig Outshines Rust - Memory Efficient Enum Arrays

- Adrian Alic tl;dr: Adrian discusses the issue of memory fragmentation in Rust, particularly when using Enums with different-sized variants explaining that one of the biggest motivators for efficient Enum arrays has been compilers, as "Big ASTs can incur a hefty performance penalty during compilation." The article suggests using a "struct-of-arrays" (SoA) approach or creating one vector per variant, termed as "array of variant arrays" (AoVA), to mitigate fragmentation.

featured in #450


I Wrote A String Type

- Miguel Young De La Sota tl;dr: Miguel explores the intricacies of string representation in Rust, critiquing common string types for their memory inefficiencies. The author introduces "byteyarn," a string type optimized for memory usage, emphasizing its properties like "Small String Optimization" (SSO) and compatibility with 'static lifetime strings. The piece further discusses layout optimization, stealing bits, and niche optimization to achieve memory efficiency.

featured in #447


I Built A Garbage Collector For A Language That Doesn't Need One

tl;dr: “I built a garbage collector - in short, a piece of software that manages allocations for another, more exciting piece of software. The cool part: I made it in Rust, for Rust - a language designed to eliminate garbage collection and which provides few facilities for making it work properly. Not only that, I managed to make my garbage collector work with relatively few compromises…”

featured in #440


Making Python 100x Faster With Less Than 100 Lines Of Rust

- Ohad Ravid tl;dr: “Our system also has to work on-prem with limited CPU resources, and while at first it performed well, as the number of concurrent physical users grew we started running into problems and our system struggled to keep up with the load. We came to the conclusion that we had to make our system at least 50 times faster to handle the increased workload, and we figured that Rust could help us achieve that.”

featured in #426


Writing Python Like It's Rust

- Jakub Beránek tl;dr: “Eventually, I started adopting some concepts from Rust in my Python programs. It basically boils down to two things - using type hints as much as possible, and upholding the good ol’ making illegal states unrepresentable principle. I try to do this both for programs that will be maintained for a while, but also for oneshot utility scripts.”

featured in #416


Rust Is A Scalable Language

- Alex Kladov tl;dr: Rust is vertically scalable as you “can write all kinds of software in it,” as well as horizontally scalable - you “can easily parallelize development of large software artifacts across many people and teams.” Alex elaborates on both.

featured in #402


Zig And Rust

- Alex Kladov tl;dr: I now find myself writing Zig full-time, after more than seven years of Rust. This post is a hand-wavy answer to the “why?” question. It is emphatically not a balanced and thorough comparison of the two languages.

featured in #401


Rust Coreutils: Fixing Low-Hanging Performance Fruit

- Patrick Jackson tl;dr: “A few months ago I took a look at the [uutils coreutils](https://github.com/uutils/coreutils) project, which is a rewrite of the core GNU utils in Rust, to try to get some experience writing newbie code in the language. I saw the maintainers themselves mention that a lot of the code quality isn’t great since a lot of contributions are from people who are very new to Rust, so I figured there would be some easy fixes available for me to take on.”

featured in #393


Rust’s Ugly Syntax

- Alex Kladov tl;dr: "People complain about Rust syntax. I think that most of the time when people think they have an issue with Rust’s syntax, they actually object to Rust’s semantics. In this slightly whimsical post, I’ll try to disentangle the two."

featured in #386