Breaking news: async rust is REALLY REALLY GOOD

And I know this is coming off me saying that struct-like enum variants are bad, but uh... I'm not a fuckin' cop, dog. Live your life. "Where are all the struct like enum variants in this codebase" is just a reasonable question to ask a computer and have it answer, is all.

Show thread

I mean, there's a decent chunks of lints that are like "why is this bad": "It's not, you can just grep for it if you want, fuckin' relax." but I still feel like there's an attitude bias that prevents it from being the most useful version of itself.

Show thread

I kinda hate that the "all the lints" page has a section for every lint called "why is this bad", 'cause it's SO useful to have lints for things that aren't "bad". Sometimes you just want to be able to locate all the instances of a pattern and have a look at them! Things don't have to be bad for it to be useful to be able to grep for them.

Show thread

To the point that even allowing struct-like variants is maybe a misfeature. Is there a clippy lint for that? >.>

Show thread

Any time you have a struct-like enum variant you really want a tuple-like variant with one value that is a named struct type ANYWAY, so I'm not gonna complain.

Show thread

Wait, never mind, you totally can, you just can't do it with struct-like enum variants.

Show thread

Damn, you can't finish a struct expression like:

MyStruct { field1: x, ..unimplemented!() }

IS THERE ANOTHER PROJECT WITH A PARALLEL NAME BEFORE STREAM FRIENDS!?

Show thread

Wait, is "Friends at the Table" a structural riff on "Stream Friends"?

IDK if it's even a thing to like... put a mutex in epoll in case it's gonna be a long wait & spinning is gonna be a waste.

Show thread

futures has a Mutex, but the tokio Mutex is already fine. I guess you can just use parking_lot's try methods & std::task::yield_now() to cobble together the async versions...

Show thread

This thread IS an invitation to tell me that there's a nice RwLock that fully decked out for both async and blocking in some crate that I don't know about.

Show thread

I wish tokio::sync::Mutex had a blocking_lock(). You CAN just:

let guard = loop { match try_lock() { Ok(x) => x, Err(_) => std::thread::yield_now(), } };

...but I'd rather just .blocking_lock(), ya know.

Show thread

I wish tokio::sync::RwLock had any way to use it from blocking code. You can use tokio::sync::Mutex from both async code and blocking code 'cause it's got try_lock(), but RwLock you're hosed.

But only in the one really obvious surface way, don't dig too deep.

Show thread

Working for capitalists is like fucking the lady from that one Billy Idol song

Show more
Octodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!