Articles
Articles are single-page pieces that give a whirlwind tour of a specific topic.
They're different from series, which go very in-depth, taking many detours.
Why is my Rust build so slow?
I've recently come back to an older project of mine (that powers this website), and as I did some maintenance work: upgrade to newer crates, upgrade to a newer rustc, I noticed that my build was taking too damn long!
For me, this is a big issue. Because I juggle a lot of things at any given time, and I have less and less time to just hyperfocus on an issue, I try to make my setup as productive as possible.
My ideal Rust workflow
Writing Rust is pretty neat. But you know what's even neater? Continuously testing Rust, releasing Rust, and eventually, shipping Rust to production. And for that, we want more than plug-in for a code editor.
We want... a workflow.
Why I specifically care about this
Cool bear's hot tip
This gets pretty long, so if all you want is the advice, feel free to directly.
A terminal case of Linux
Has this ever happened to you?
You want to look at a JSON file in your terminal, so you pipe it into jq so you can look at it with colors and stuff.
Cool bear's hot tip
That's a useless use of cat.
...oh hey cool bear. No warm-up today huh.
Sure, fine, okay, I'll read the darn man page for jq
... okay it takes
a "filter" and then some files. And the filter we want is.. which, just
like files, means "the current thing":
Understanding Rust futures by going way too deep
So! Rust futures! Easy peasy lemon squeezy. Until it's not. So let's do the easy thing, and then instead of waiting for the hard thing to sneak up on us, we'll go for it intentionally.
Cool bear's hot tip
That's all-around solid life advice.
Choo choo here comes the easy part 🚂💨
We make a new project:
What's in the box?
Here's a sentence I find myself saying several times a week:
...or we could just box it.
There's two remarkable things about this sentence.
The first, is that the advice is very rarely heeded, and instead, whoever I just said it to disappears for two days, emerging victorious, basking in the knowledge that, YES, the compiler could inline that, if it wanted to.
withoutPin and suffering
I'd like to think that my understanding of "async Rust" has increased over the past year or so. I'm 100% onboard with the basic principle: I would like to handle thousands of concurrent tasks using a handful of threads. That sounds great!
And to become proficient with async Rust, I've accepted a lot of things. There are blue functions and red functions, and red (async) functions are contagious.
2020 Retrospective
Against all odds, it looks like the year 2020 will actually come to an end - in less than a day now. I know! Hard to believe for me too.
A lot of things have happened for me personally, and professionally. It's been a big year in many ways, and I feel like, to get some closure, I need to highlight some of them.
From "looking at graphs" to "driving to the hospital"
Aiming for correctness with types
The Nature weekly journal of science was first published in 1869. And after one and a half century, it has finally completed one cycle of carcinization, by publishing an article about the Rust programming language.
It's a really good article.
What I liked about this article is that it didn't just talk about performance, or even just memory safety - it also talked about correctness.