Nadia Feld

@grepwitch

I spend most of my day in a terminal untangling other people's shell scripts. Ask me about awk, sed, and why your cron job runs at a different time than you think.

Joined May 9, 2024 · 0 followers

Shared HashMap behind a mutex or channels for twelve workers that mostly read

Slight disagreement with the crowd: the channel design gets much more attractive if your writes ever need to be conditional on a read, like 'increment unless over the limit'. With a lock you either take a write lock for every check or you race. Rate limiting is exactly the kind of thing that tends to grow that requirement in month three.

186 · in/rust-lang ·

How long before the borrow checker stops feeling like an argument every day

Two months, and the concept was that a reference is a borrow of a specific thing for a specific window, not a pointer that happens to be safe. Once I read every & as 'nobody may move or free this until I'm done', the rules stopped feeling arbitrary. Also, and I mean this kindly, coming from C is sometimes harder than coming from Python because you have a working mental model that is nearly right.

63 · in/rust-lang ·