Live data from Hacker News

A Gopher Meets a Crab

miren.dev

61–70 of 79 posts

Re: A Gopher Meets a Crab

#62
post #27

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?

Not the author but this seems a good approach to me because you learn more about a language from implementing a project in it. This is especially true when you already have experience in a language from the same paradigm (like Go and Rust are). So getting an LLM to write an example project then dissecting the code and interrogating those choices, seems like a very good way to learn the idioms of another language.

Except it generated bad unidiomatic code, so you’re just learning bad habits.

Re: A Gopher Meets a Crab

#63
post #27

Earlier quoted context omitted.

Not the author but this seems a good approach to me because you learn more about a language from implementing a project in it. This is especially true when you already have experience in a language from the same paradigm (like Go and Rust are). So getting an LLM to write an example project then dissecting the code and interrogating those choices, seems like a very good way to learn the idioms of another language.

Except it generated bad unidiomatic code, so you’re just learning bad habits.

Can you share which parts of the code were bad?

Re: A Gopher Meets a Crab

#66
post #65

Earlier quoted context omitted.

Basically all of the code they shared in the article.

You’ll need to be more specific than that. Why was it bad? How would you have written it differently?

Um, it’s pretty obvious why Result>>> or Result is bad, I’m not going to spend time explaining when I doubt you’re asking in good faith.

Re: A Gopher Meets a Crab

#67
post #65

Earlier quoted context omitted.

You’ll need to be more specific than that. Why was it bad? How would you have written it differently?

Um, it’s pretty obvious why Result >>> or Result is bad, I’m not going to spend time explaining when I doubt you’re asking in good faith.

Of course I’m asking in good faith. I wouldn’t have asked how you’d implement the same problem yourself if I wasn’t interested.

But you also have to understand that it’s very easy for people to say “x is bad” when actual real world problems sometimes require a small smattering of ugly code. So it’s not unreasonable for me (or anyone else) to ask how you’d write a solution to the same problem.

Now what I’m trying to understand is whether the examples highlighted by the author as ugly, was ugly because it’s bad code. Or ugly because it was the right solution which lead to ugly code. Which is why I was asking for your preferred solution.

Re: A Gopher Meets a Crab

#68
post #67

Earlier quoted context omitted.

Um, it’s pretty obvious why Result >>> or Result is bad, I’m not going to spend time explaining when I doubt you’re asking in good faith.

Of course I’m asking in good faith. I wouldn’t have asked how you’d implement the same problem yourself if I wasn’t interested. But you also have to understand that it’s very easy for people to say “x is bad” when actual real world problems sometimes require a small smattering of ugly code. So it’s not unreasonable for me (or anyone else) to ask how you’d write a solution to the same problem. Now what I’m trying to u…

Looking at the code briefly, the first example could be written as

   let msg = timeout(Duration::from_secs(2), receiver.next()).await.ok()??;

   // not shown in article, but next line of code

   let Message::Text(frame) = msg_result.ok()? else {
      return None;
   };
Looks like the fixed the second issue with anyhow::Result

Re: A Gopher Meets a Crab

#69

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….

A 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.

Re: A Gopher Meets a Crab

#70
post #69

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….

A 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.

Interesting that the talk was quite different, because this clearly AI generated article was condescending and infuriating. Quite a difference apparently.
Post reply on HN