5 ms·
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
by saagarjha 6mo ago
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?
- cpursley 6mo 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 6mo 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 6mo 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 6mo 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 6mo 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.
- 2ndorderthought 6mo agoThe first time I looked at rust code that wasn't in tutorial I was pretty confused. Things I thought I understood I really didn't. I knew maybe 6 programming languages including some c. A lot of people struggle to learn rust because it's an ML as in OCAML and really isn't much like C at all. Some people adapt to it more easily, especially coming from languages like scala but it has a lot of unique characteristics that aren't in C or are even related. Like lifetimes, dynamic dispatch through enums, the borrowchecker, pattern matching, the ? Operator, etc. Maybe you all are way smarter than me, super possible, but I wouldn't expect much to translate between go and rust. I think some evidence for that is the blog post here...
- hnlmorg 6mo agoScala is a great language. And Rust definitely has noticeable influences from ML. But I’d say Rust is closer to C++ than it is to ML. But, to be fair to you, I’ve not touched Rust in a couple of years so maybe my memory is fallible here?
- 2ndorderthought 6mo agoI don't think it's a memory thing. The original rust compiler was written in OCAML. I think it's closer to an ML personally because of the strong focus on the type system rather than the chr* magic of c/c++. Over the years c++ has been influenced to offer things people like from rust. So modern c++ looks a little more like rust. But older c++ really doesn't. Similarly rusts approach to dynamic dispatch is more like OCAML than c++. You can use rust and c++ for similar objectives though. Anyone can reduce two technical things until they are identical or expand them until they are completely different. I think the most sober take is they are sufficiently different from one another.
- hnlmorg 6mo agoI think the crux of our disagreement is this: How much familiarity do you need to be starting from scratch? In a later comment you said the following: > You aren't starting from scratch in the same way that if you have written javascript you aren't starting from scratch writing c++. But I’d argue that you wouldn’t be starting from scratch with C++ as a JS developer either because you already understand all the fundamentals of imperative programming: - objects, properties and methods - functions - iteration (for loops are literally written the same) - variable assignment - expression notion and the order of precedence for operators - global variables vs local variables And so on and so forth. Whereas going to ASM, LISP, Forth, or Prolog would require relearning everything you thought you knew about programming. So to that point, once you learn Go, you could write a function in JS, C, Rust, and so on. You’d know roughly how to structure it and what syntax to use. You might not write the best and most idiomatic version of that function because you might not fully appreciate the differences with type system, variable referencing, macros, and so on. But that’s all knowledge you’d build upon from the experience you already have. And the reason I make this distinction is because we were specifically talking about using an LLM for teaching. To learn the nuances between languages of the same paradigm, the best way to learn is to write a project in that language. Whereas when going to something entirely alien like Prolog, you first need to learn the fundamentals (eg “from a book”) before you could even think about starting a project. And what this guy did was work with an LLM on a project to learn the differences between Go and Rust. So my point was those two languages are similar enough that the authors approach seems very reasonable to me. Whereas if he’d tried to do this with (for example) Haskell, then I’d have agreed with the naysayers.
- deleted 6mo ago[deleted]
- victorbjorklund 6mo agoMaybe you are slower than me then. I can pretty much understand almost everything in a similar programming language that I already know. Do I know exactly why X was choosen instead of Y? Do I know best practices? Do I know best libs etc? No, that is the reason to ask about it.
- hnlmorg 6mo agoNot 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.
- 2ndorderthought 6mo agoGo and rust share very few similarities when you consider the syntax.
- hnlmorg 6mo agoIf you believe that then you haven’t spent much time working in different paradigms of programming languages. Syntax is the easy stuff to learn. It’s any shifts in paradigms (eg pure functional vs imperative vs logic… etc) that takes time to learn. And I say this as someone who’s written professional software in well over a dozen different languages. So I understand well the challenges learning something new.
- 2ndorderthought 6mo agoI have written production code in about a dozen languages as well believe it or not. I have also trained people who were good to decent software engineers in other languages to write rust. The syntax is nontrivial for a lot of people. There are a lot of people who gave up trying to learn rust, especially before the rust book became what it is today. People typically fight the borrowchecker until it clicks. Learning from an LLM and reading only means you have to be as good as the rust compiler without any experience writing the language. It's got to be way harder that way.
- hnlmorg 6mo ago> I have written production code in about a dozen languages as well believe it or not. You said 6 in your other comment. Which is half a dozen. But I take your point about the syntax being complex. That was the main reason I stopped coding in Rust: not because I couldn’t learn the language but because I didn’t enjoy the complexity. To me it felt like it needed someone to reign in design choices (Python is suffering from this problem now too). On a slight tangent: one of my pet peeves is feature creep in programming languages. It makes it harder to learn the language. Harder to agree on coding styles in teams. Easier to fuck up and thus requires you to be on your A-game when writing code for it. I don’t always agree with Go’s choices, but I respect that the language is conservative in what gets approved into the language. This is a takeaway more languages need to learn from. Anyway, back on topic: I don’t agree that the syntax and borrow checker constitutes as “a different paradigm”. But I’ll concede that I might be overstating how easy it is for others to learn these idioms.
- commandersaki 6mo agoHave you tried? Give it a shot and see for yourself.
- saagarjha 6mo agoYeah I have had LLMs write scripts and changes in languages I can't really read for throwaway uses but I have not really found it useful to go and inspect the code because I don't feel I would learn much
- atorodius 6mo agoThat's a terrible analogy:) It is more like you wanting to build a bed out of wood so you hire a carpenter and watch them and ask questions about every step and maybe help a bit at the end. I find it amazing to learn new programming things
- saagarjha 6mo agoWell it's an LLM so it's more like you ask your uncle Vinny who is pretty good at a bunch of stuff but sawed off their arm the other day
- 2ndorderthought 6mo agoAfter sawing off his arm while assembling an barstool he also gives advice about assembling rocket engines without any loss in confidence. Good old uncle Vinny always there when you need him.
- Culonavirus 6mo agoIt's one of the best use cases for LLMs IMO. Programmers being empowered to do stuff they wouldn't dare before and/or do what they know, but faster. Having a person who never wrote much code (if any) before is a recipe for disaster because LLMs, even latest models with CC/Codex make mistakes and often code where a happy path (kinda) works, but edge cases don't . You have to check and iterate and specify. But also, programmers (seniors at the very least) have an intuition about how the system should work and they know algorithmization in general. They know how to do a thing in pseudocode on paper. In the end, you become kind of an architect of the system. LLMs give you the ability to choose the right tool for the job even if you have suboptimal or even very little experience with the given tool. There are footguns of course and I wouldn't work on say a system handling client money (banks...) this way, but most uses can take it. As far as being taught a new language and its ecosystem through an LLM, is SO much faster than reading a book + documentation, it's like asuperpower.