A Gopher Meets a Crab

miren.dev

41 points by radimm 2 days ago


joshka - 3 hours ago

The weird-looking Rust isn’t really Rust being weird, it’s the type telling the truth.

   Result<Option<Result<Message, WsError>>, Elapsed>
That’s three independent “not the happy path” channels: timeout, stream closed, and websocket error.

The nicer version is not a cleverer match. It’s choosing a domain error shape and converting into it one layer at a time:

    let timed = tokio::time::timeout(duration, receiver.next()).await;
    let next = timed.map_err(|_| ReceiveError::Timeout)?;
    let item = next.ok_or(ReceiveError::Closed)?;
    let msg = item.map_err(ReceiveError::WebSocket)?; 
The ugly line is what happens when you have not decided where to normalize the shape yet.
saagarjha - 2 hours ago

I feel like having an LLM write code in a language you aren't familiar with and then inspecting the results is kind of like hiring someone to speak Spanish for you and then being confused at the weird words they are using. Like, what would make you want to do this?

RobotToaster - 3 hours ago

Was anyone else expecting OpenClaw over gopher protocol?

wiseowise - an hour ago

Still better than deciphering C++ soup of characters.

nothinkjustai - 2 hours ago

Um? Person vibe codes Rust. Output is stupid. The conclusion is either

a) Vibe coding produces bad code

b) Rust is weird

Somehow we’re supposed to accept b as the answer? Give me a break….