4 ms·
A Gopher Meets a Crab
- wiseowise 5mo agoStill better than deciphering C++ soup of characters.
- cenamus 5mo agostd::expected and the utility functions for it (and_then(), or_else()) are pretty much the same, though? Or am I completely misunderstanding something?
- irishcoffee 5mo agoNo, you’re not, the person you replied to is failing to look at their own criticism objectively.
- tialaramex 5mo agoIt's true that `std::expected` is like if a C++ programmer saw a type like Result in a shop window and copied the parts they understood from that and so certainly if you're a C++ programmer this is superficially satisfying. The blog post uses, among other things, the Try operator ? and pattern matching, neither of which are available in C++ and both of which make the Result type much nicer to use than std::expected. There have been similar "I saw it in a shop window" proposals for both these in C++, and I expect that pattern matching in particular will be attempted again targeting C++ 29.
- xigoi 5mo agoUnfortunately, Rust made the great decision to copy most of its syntax from C++.
- joshka 5mo agoThe 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 5mo agoResult<(), ()> Is pretty weird, though, no? Why would you want a unit value / error type?
- tux3 5mo agoSometimes 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 5mo agoIt'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 5mo agoIt’s the equivalent of Haskell’s Either, with Option being the equivalent of Maybe. They’re fairly well-defined idioms.
- loeg 5mo agoI know what Result<> is.
- 2ndorderthought 5mo agoIt's not like people regularly decide this is a good return type. Just because Claude isn't good at designing code or what have you doesn't mean rust is bad/weird. Sure this is something someone can do but it's suggesting the caller doesn't care about why it failed and doesn't need anything from it's success. It's a choice but it's not a typical one. Maybe the fact that it looks weird and there is no comment is a clue that this isn't high quality code. People really should be more skeptical of LLM coding. Claude is not as amazing as marketing makes it sound. It is amazing in that it can write code and follow specs sometimes, but a lot of quality gets lost along the way without close supervision by someone who knows better
- RobotToaster 5mo agoWas anyone else expecting OpenClaw over gopher protocol?
- coqadoodle 5mo agoI was looking forward to retro deep-dive back into the 90s. I just couldn't figure out where the crab fit in.
- SyneRyder 5mo agoYep, I did. While I don't use OpenClaw, I built a small MCP tool for my AI to use Gopher in a minimal harness, and it's been useful. Gopher is almost an ideal protocol for AI, none of the token verbosity of HTML. But I admit in my case, it's mostly being used to access weather data on Floodgap's Groundhog, because the format published on Gopher is much easier to parse & access than the paywalled government APIs in Australia. Claude occasionally uses Veronica to do a search instead of a web search as well.
- nothinkjustai 5mo agoUm? 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….
- 2ndorderthought 5mo agoPeople really are forgetting how to think. While reading this blog post I almost immediately flipped into teaching confused freshmen taking the course that wasn't their major mode.
- joshka 5mo agoA much more charitable reading of the article is "here's some observations I found interesting / different". I met the author at the conf and watched their talk. Their perspective was very much in the camp of exploration, learning, wonder, etc. and not in the camp of criticism of either rust or vibe coding practices.
- nothinkjustai 5mo agoInteresting that the talk was quite different, because this clearly AI generated article was condescending and infuriating. Quite a difference apparently.
- saagarjha 5mo agoI 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?
- cpursley 5mo agoI’ve learned a ton of new things this way, even in a stack that I know really well. Ditto on all sorts of new little command line tricks that I was unaware of before.
- MrJohz 5mo agoI mean, it's not that surprising that you'll learn better in a stack you already know well - you know enough there to know what you don't know and need to learn. But if you don't know anything about a language, it will be very difficult for you to sort fact from fiction.
- victorbjorklund 5mo agoIf you already speak French or another Romance language it isn’t a bad idea to just have a conversation in Spanish directly and then ask for clarifications anytime you don’t understand.
- 2ndorderthought 5mo agoWhich would be all the time? At which point you might be better served by learning from a source that has any guarantees of being correct and doesn't hallucinate. Like text books that have had several editions and are free on the Internet.
- hnlmorg 5mo agoI would be very surprised if you couldn’t figure out what was happening in one C-derivative language when you’re already competent in another C-derivative language. This isn’t like learning JavaScript and then expecting to be an expert in Prolog.
- JKCalhoun 5mo agoFrom vibe coding we now seem to have… tray-table coding?
- huqedato 5mo agoLearning 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.
- 2ndorderthought 5mo agoI find your experience interesting. People below are saying you can understand rust super easy if you know go. Meanwhile you are saying rust was a struggle and go is a relief. So which is it? The answer is rust has very little in common with go. Rust is very explicit and go is not. Some people find the explicit nature of rust and it's guarantees refreshing. Other people find go refreshing because the syntax is more limited and it looks simple on paper.
- huqedato 5mo agoYes: I do say Rust was a struggle and go is a relief. Yes: rust has very little in common with go. Yes: Rust is very explicit and go is not. Yes: Other people find go refreshing because the syntax is more limited and it looks simple on paper. So, you're right. IMO: Go is a very "productive" and clean lang/platform when comparing to Rust. It's depends what you're using it for. In my case (for concurrent backends) Go came as a bliss. And that was before AI (vibecoding).
- 2ndorderthought 5mo agoI am glad you found something that works for you. Go forth and gopher it up