A Gopher Meets a Crab

44 points - last Thursday at 6:30 AM

Source

Comments

joshka today at 7:35 AM
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 today at 9:13 AM
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?
JKCalhoun today at 11:40 AM
From vibe coding we now seem to have… tray-table coding?
RobotToaster today at 8:07 AM
Was anyone else expecting OpenClaw over gopher protocol?
wiseowise today at 9:56 AM
Still better than deciphering C++ soup of characters.
huqedato today at 11:48 AM
Learning Go after five years of professional struggle with Rust was a relief; Go feels designed for humans to just get the job done. (not a Google fan!) I'll get a ton of downvote for this but it's ok.
nothinkjustai today at 8:55 AM
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….