frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

A Gopher Meets a Crab

https://miren.dev/blog/gopher-meets-crab
24•radimm•2d ago

Comments

joshka•1h 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.
loeg•59m ago

  Result<(), ()>
Is pretty weird, though, no? Why would you want a unit value / error type?
tux3•22m ago
Sometimes you just want a fancy boolean. The advantage is that Result has all the Result APIs and you can compose it with other Results, but otherwise this is just a success bool.
MrJohz•22m ago
It's basically doing the same thing that, say, `return true` might do to indicate a function succeeded, but with more explicit types. However, because it uses `Result`, it can be used with the `try`/question mark operator which can be convenient in some situations.

That said, a couple of the examples here feel a bit strange - they're clever things you can do, but they're not necessarily things you often have to do, particularly for a relatively simple task like this. I think the problem with the author's approach is that they can't distinguish between "weird because Rust is weird" and "weird because the LLM generated bad code", because they (understandably) don't have enough experience in what good Rust code looks like.

stingraycharles•12m ago
It’s the equivalent of Haskell’s Either, with Option being the equivalent of Maybe. They’re fairly well-defined idioms.
RobotToaster•48m ago
Was anyone else expecting OpenClaw over gopher protocol?
coqadoodle•8m ago
I was looking forward to retro deep-dive back into the 90s. I just couldn't figure out where the crab fit in.

Why does it take so long to release black fan versions?

https://www.noctua.at/en/expertise/blog/how-can-it-take-so-long-to-release-black-fan-versions
180•buildbot•4h ago•85 comments

Ti-84 Evo

https://education.ti.com/en/products/calculators/graphing-calculators/ti-84-evo
437•thatxliner•12h ago•374 comments

A Gopher Meets a Crab

https://miren.dev/blog/gopher-meets-crab
24•radimm•2d ago•7 comments

Artemis II Photo Timeline

https://artemistimeline.com/#artemis-ii-walkout-nhq202604010003
185•geerlingguy•2d ago•12 comments

Ask.com has closed

https://www.ask.com/
243•supermdguy•4h ago•126 comments

New research suggests people can communicate and practice skills while dreaming

https://www.newyorker.com/culture/annals-of-inquiry/its-possible-to-learn-in-our-sleep-should-we
329•XzetaU8•15h ago•190 comments

To Restore an Island Paradise, Add Fungi

https://e360.yale.edu/digest/atoll-islands-sea-level-rise-fungi
58•Brajeshwar•2d ago•9 comments

The USB Situation

https://randsinrepose.com/archives/the-usb-situation/
12•herbertl•2d ago•3 comments

K3k: Kubernetes in Kubernetes

https://github.com/rancher/k3k
43•jzebedee•4h ago•20 comments

LFM2-24B-A2B: Scaling Up the LFM2 Architecture

https://www.liquid.ai/blog/lfm2-24b-a2b
34•nateb2022•2d ago•7 comments

I'm Peter Roberts, immigration attorney who does work for YC and startups. AMA

155•proberts•17h ago•214 comments

Lib0xc: A set of C standard library-adjacent APIs for safer systems programming

https://github.com/microsoft/lib0xc
146•wooster•13h ago•51 comments

CollectWise (YC F24) Is Hiring

https://www.ycombinator.com/companies/collectwise/jobs/rEWfZ6R-senior-forward-deployed-engineer
1•OBrien_1107•4h ago

Ask HN: Who is hiring? (May 2026)

257•whoishiring•17h ago•276 comments

A Report on Burnout in Open Source Software Communities (2025) [pdf]

https://mirandaheath.website/static/oss_burnout_report_mh_25.pdf
71•susam•9h ago•18 comments

Show HN: WhatCable, a tiny menu bar app for inspecting USB-C cables

https://github.com/darrylmorley/whatcable
497•sleepingNomad•1d ago•144 comments

Eka’s robotic claw feels like we're approaching a ChatGPT moment

https://www.wired.com/story/when-robots-have-their-chatgpt-moment-remember-these-pincers/
136•zdw•2d ago•190 comments

The smelly baby problem

https://www.worksinprogress.news/p/how-disposable-diapers-conquered
175•dionysou•2d ago•112 comments

Direct electrochemical black coffee quality appraisal using cyclic voltammetry

https://www.nature.com/articles/s41467-026-71526-5
50•bookofjoe•2d ago•16 comments

Show HN: Stop playing my matchstick puzzles, start building your own in seconds

https://mathstick.github.io
9•trangram•3h ago•12 comments

Apocalypse Early Warning System

https://ews.kylemcdonald.net/
180•carlsborg•16h ago•94 comments

Whohas – Command-line utility for cross-distro, cross-repository package search

https://github.com/whohas/whohas
142•peter_d_sherman•17h ago•35 comments

Create an MP4 video of a web page scrolling at a steady speed

https://github.com/upenn/web-scroll-video
27•shawnzam•6h ago•11 comments

Integer Overflow Checking Cost

https://danluu.com/integer-overflow/
23•iwsk•2d ago•5 comments

I built the Playwright for desktop apps. 80% token savings

https://github.com/lahfir/agent-desktop
65•lahfir•6h ago•23 comments

The gay jailbreak technique (2025)

https://github.com/Exocija/ZetaLib/blob/main/The%20Gay%20Jailbreak/The%20Gay%20Jailbreak.md
518•bobsmooth•15h ago•212 comments

Whimsical Animations Course Open House

https://courses.joshwcomeau.com/wham/open-house/00-introduction
93•SpyCoder77•13h ago•9 comments

City Learns Flock Accessed Cameras in Children's Gymnastics Room as a Sales Demo

https://www.404media.co/city-learns-flock-accessed-cameras-in-childrens-gymnastics-room-as-a-sale...
399•joshcsimmons•14h ago•103 comments

DeepSeek V4–almost on the frontier, a fraction of the price

https://simonwillison.net/2026/Apr/24/deepseek-v4/
82•indigodaddy•16h ago•27 comments

Show HN: AI CAD Harness

https://fusion.adam.new/install
85•zachdive•15h ago•86 comments