Skip to main content

Allocations in Rust: Foreword

· 4 min read
Bradlee Speice

There's an alchemy of distilling complex technical topics into articles and videos that change the way programmers see the tools they interact with on a regular basis. I knew what a linker was, but there's a staggering amount of complexity in between the OS and main(). Rust programmers use the Box type all the time, but there's a rich history of the Rust language itself wrapped up in how special it is.

In a similar vein, this series attempts to look at code and understand how memory is used; the complex choreography of operating system, compiler, and program that frees you to focus on functionality far-flung from frivolous book-keeping. The Rust compiler relieves a great deal of the cognitive burden associated with memory management, but we're going to step into its world for a while.

Let's learn a bit about memory in Rust.

QADAPT - debug_assert! for allocations

· 5 min read
Bradlee Speice

I think it's part of the human condition to ignore perfectly good advice when it comes our way. A bit over a month ago, I was dispensing sage wisdom for the ages:

I had a really great idea: build a custom allocator that allows you to track your own allocations. I gave it a shot, but learned very quickly: never write your own allocator.

-- me

I proceeded to ignore it, because we never really learn from our mistakes.

More "what companies really mean"

· 2 min read
Bradlee Speice

I recently stumbled across a phenomenal small article entitled What Startups Really Mean By "Why Should We Hire You?". Having been interviewed by smaller companies (though not exactly startups), the questions and subtexts are the same. There's often a question behind the question that you're actually trying to answer, and I wish I spotted the nuance earlier in my career.

Let me also make note of one more question/euphemism I've come across:

A case study in heaptrack

· 5 min read
Bradlee Speice

I remember early in my career someone joking that:

Programmers have it too easy these days. They should learn to develop in low memory environments and be more efficient.

...though it's not like the first code I wrote was for a graphing calculator packing a whole 24KB of RAM.

But the principle remains: be efficient with the resources you have, because what Intel giveth, Microsoft taketh away.

Isomorphic desktop apps with Rust

· 10 min read
Bradlee Speice

I both despise Javascript and am stunned by its success doing some really cool things. It's this duality that's led me to a couple of (very) late nights over the past weeks trying to reconcile myself as I bootstrap a simple desktop application.

Primitives in Rust are weird (and cool)

· 7 min read
Bradlee Speice

I wrote a really small Rust program a while back because I was curious. I was 100% convinced it couldn't possibly run:

fn main() {
println!("{}", 8.to_string())
}

And to my complete befuddlement, it compiled, ran, and produced a completely sensible output.

What I learned porting dateutil to Rust

· 7 min read
Bradlee Speice

I've mostly been a lurker in Rust for a while, making a couple small contributions here and there. So launching dtparse feels like nice step towards becoming a functioning member of society. But not too much, because then you know people start asking you to pay bills, and ain't nobody got time for that.

Hello!

· One min read
Bradlee Speice

I'll do what I can to keep this short, there's plenty of other things we both should be doing right now.