Live data from Hacker News

A Gopher Meets a Crab

miren.dev

21–30 of 79 posts

Re: A Gopher Meets a Crab

#22

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?

I’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.

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

Re: A Gopher Meets a Crab

#23
post #2

The weird-looking Rust isn’t really Rust being weird, it’s the type telling the truth. Result >, 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…

Off topic but using “shape” like this is LLM coded

Re: A Gopher Meets a Crab

#24
post #2

The weird-looking Rust isn’t really Rust being weird, it’s the type telling the truth. Result >, 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…

Off topic but using “shape” like this is LLM coded

I guess I'm an LLM then. I've been referring to the structure of types as "shape" for more than a decade and so have plenty of others

Re: A Gopher Meets a Crab

#25
post #2

The weird-looking Rust isn’t really Rust being weird, it’s the type telling the truth. Result >, 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…

Off topic but using “shape” like this is LLM coded

Probably on topic here - I talk like an LLM sometimes, and parse my points through them sometimes. I’d reasonably use that terminology and think nothing of it as it’s precise and correct. That said, this was partially LLM and my thinking here.

Re: A Gopher Meets a Crab

#26
post #21

Still better than deciphering C++ soup of characters.

std::expected and the utility functions for it (and_then(), or_else()) are pretty much the same, though? Or am I completely misunderstanding something?

No, you’re not, the person you replied to is failing to look at their own criticism objectively.

Re: A Gopher Meets a Crab

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

Re: A Gopher Meets a Crab

#28

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?

Have you tried? Give it a shot and see for yourself.

Re: A Gopher Meets a Crab

#29

Earlier quoted context omitted.

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

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

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

Re: A Gopher Meets a Crab

#30
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.

Go and rust share very few similarities when you consider the syntax.
Post reply on HN