3 ms·
I think there's a weird disconnect between the author's experience (the automated tools are good but they induce dependency) and my own experience (the tools ar
by abeppu 2y ago
I think there's a weird disconnect between the author's experience (the automated tools are good but they induce dependency) and my own experience (the tools are bad, produces code that doesn't type-check, produces explanations that don't make sense, or suggest back to me the half-broken code I already have).
I continue to believe that these tools would be more reliable if rather than merely doing next-token-prediction on code, we trained on the co-occurrence of human-written code, resulting IR, and execution traces, so the model must understand at least one level deeper of what the code does. If the prompt is not just a prose description but e.g. a skeleton of a trace, or a set of inputs/outputs/observable side effects, then simultaneously our generative tools only allow outputs which meet the constraints, with the natural and reasonable cost that the engineer needs to think a little more deeply about what they want. I think if done right, this could make many of us better engineers.
- rsynnott 2y agoI think it's particularly weird that many of these tools simply do not seem to know about the type-checker at all. You'd think that'd be basic, at least for the likes of essentially fancy autocompletes like copilot; if the thing you're going to output does not type check, do not output it.
- AnimalMuppet 2y agoThat would require actually understanding types. GPTs don't understand anything - not really. They know the words and how the words connect to each other, and that's all. What you want - what everybody wants - is a GPT plus. In this case, GPT plus a compiler's parsing ability. I don't think that's what we have, though. What we have is a GPT that was trained on more and better code snippets. That's not good enough.
- danielbln 2y agoThe tooling can take that over. Code has been generated that fails the type check? Let the type system of the IDE spit out diagnostics, feed it back to the LLM and let it output correct code. This can be made automatic, same with automated testing. The problem with people sneering at LLM assisted coding is that they miss the developments and advancements in tooling and integration. Copy pasting from the ChatGPT browser tab and hoping for the best is not where it's at anymore.
- rsynnott 2y ago> Copy pasting from the ChatGPT browser tab and hoping for the best is not where it's at anymore. I mean, maybe there's a magic tool out there? The only one I've used (briefly, before turning it off in annoyance) is Copilot, which appears to pretty much just do that.
- danielbln 2y agoI don't know about magic, but Aide.dev, Cursor, Windsurf for the editor, and aider.chat for the terminal do exactly that.
- rsynnott 2y agoSure, but you could presumably have some logic like "Copilot wants to type the string `MyClass.non_existent_method()`. Does the type checker accept this line? If not, tell Copilot to try again." (I suspect possibly the reason that this does _not_ seem to be commonly done is that reliably producing _something_ (even if it's nonsense) is seen as more appealing to users than potentially not producing anything. And of course passing type checking is no guarantee of correctness.)
- AnimalMuppet 2y ago> And of course passing type checking is no guarantee of correctness. No, it's not. It's a guarantee that it should at least compile, though. That is, it means certain kinds of incorrectness are ruled out.