3 ms·
I'm puzzled why anyone would incorporate code on trust. I certainly don't trust LLMs for code, but I use code from LLMs on most work days ... not because I trus
by delichon 3y ago
I'm puzzled why anyone would incorporate code on trust. I certainly don't trust LLMs for code, but I use code from LLMs on most work days ... not because I trust it, but because I understand it and tested it. So, the same as code from anyone, including from myself six months ago. Trust doesn't enter into it. Clear and workable solutions do, and I've gotten an impressive number of those.
- GenerocUsername 3y agoAgree. The snippets from ChatGPT are essentially open-source as in they are fully inspectable and can be freely modified before execution. There is zero trust required.
- yevlasenko 3y agoI would back this one up as well. The code I generate in chat gpt is rather "dumb" (mostly react components, nestjs modules, etc) and in this case I trust myself to test and use it.
- argc 3y agoYeah, to use it effectively you use it for inspiration and generation of template code. The code may need a lot of changes or may need relatively few. But don't copy it expecting it to work without validating and testing it.
- fassssst 3y agoRight, hopefully no one is sprinkling eval(prompt) into their codebase.
- 1f60c 3y agoI had an idea about that the other day! What if you could write something like: @implement_this def prime_sieve(n: int) -> list[int]: pass And the decorator reads the function name and optional docstring, runs it through an LLM and replaces the function with one implementing the desired behavior (hopefully correctly). I remember there was something like this for StackOverflow.
- deleted 3y ago[deleted]
- adhamsalama 3y agohttps://github.com/retrage/gpt-macro https://github.com/retrage/gpt-macro
- matsemann 3y agoI made that as a joke in javascript 8 years ago. Not using LLM, but using javascript proxies so that if a function doesn't exist it tries to implement it runtime based on the name of the function using a sql like grammar. I really hope to not see something like that in real use, heh. https://github.com/Matsemann/Declaraoids https://github.com/Matsemann/Declaraoids Maybe I should make a LLM version of this.
- LegionMammal978 3y agoThe funny part is, Spring Data JPA has a quite serious take on this, in the form of query methods [0]. You create a repository interface with certain method names, and it dynamically creates an implementation that queries the columns of the underlying table, according to the name of the method. [0] https://docs.spring.io/spring-data/jpa/reference/jpa/query-methods.html https://docs.spring.io/spring-data/jpa/reference/jpa/query-m...
- Nodejsmith 3y agoI've never tried it myself, but Prefect does have something like this with their Marvin AI library for Python. https://github.com/PrefectHQ/marvin?tab=readme-ov-file#-build-ai-powered-functions https://github.com/PrefectHQ/marvin?tab=readme-ov-file#-buil...
- jackmpcollins 3y agoI'm building magentic https://github.com/jackmpcollins/magentic https://github.com/jackmpcollins/magentic which has basically this syntax, though it queries the LLM to generate the answer rather than writing + running code. from magentic import prompt from pydantic import BaseModel class Superhero(BaseModel): name: str age: int power: str enemies: list[str] @prompt("Create a Superhero named {name}.") def create_superhero(name: str) -> Superhero: ... I do have plans to also solve the case you're talking about of generating code once and executing that each time.
- _akhe 3y agoNot gonna lie... llama.cpp... LlamaIndex... Ollama... kinda is eval(prompt) a lot of the time! Of course AI data pipelines are a totally different conversation than code solutions.
- gordon_freeman 3y agoyes. LLMs are great at giving a template or code block for specific usecase and then I use it after understanding, modifying (if needed) and testing it. I am not sure about ChatGPT but Gemini Advanced even allows modifying code and running it within the answer itself which is convenient to test out minor changes. Also, getting template of 100s of LOC saves time in writing it from scratch even if I know exactly what I'd need to write.
- chrisjj 3y ago> LLMs are great at giving a template or code block for specific use case and then I use it after understanding, I suspect the typical ChatGPT user is using it for code that's beyond his ability to write. That being the whole point of his using it. It follows that such code is likely beyond his ability to understand. But worse, beyond his ability to understand he doesn't understand it.
- Brian_K_White 3y agoI can read and modify all kinds of code I couldn't write in the first place. I haven't used any llm for code yet but most code I ever touched was mostly written by others, and I wouldn't have been able to write it from scratch, but was able to modify it, take only chunks out of the whole to use for something else, take only the structure and not the verbatim code and use in some other language, refactor to satisfy my own priorities vs the original, get useful results in languages I don't even know, etc etc. It doesn't seem like using some pattern-matched uber-autocorrect code would be much different, especially once you understand that understandingless nature of what your getting.
- repelsteeltje 3y ago> Also, getting template of 100s of LOC saves time in writing it from scratch even if I know exactly what I'd need to write. I rarely know exactly what I need to write and writing it usually isn't the problem. Sans LLM, there have always been tools and techniques you can lean on, like syntax highlighting, auto completion, your compiler feedback, or unit tests. I find that writing code consumes only a small percentage of my time. And while writing code is obviously where bugs originate, it's not where the big problems come from. Making software good is the easy part, making the right software is where the trouble lies. It's why I spend most time not coding, but talking to people. Figuring out what needs to be done, how, when and why.
- burnte 3y ago> I'm puzzled why anyone would incorporate code on trust. Really? You can't understand why people do things based on trust? Do you trust no one?
- 2OEH8eoCRo0 3y agoSo you've audited all code that you're running on your system?
- chrisjj 3y ago> I'm puzzled why anyone would incorporate code on trust. Because almost every programmer these days has learned by a route that relies on incorporating code on trust. E.g. using someone else's compiler. > I use code from LLMs on most work days ... not because I trust it, but because I understand it and tested it. The snag there is that one can rarely verify test coverage is sufficient. > the same as code from anyone, including from myself six months ago. But it is not the same. ChatGPT delivers completely untested code. Not even syntax-checked in my case. Would you accept such code from any human? > Trust doesn't enter into it. Clear and workable solutions do Plenty of clear and workable solutions are discovered unsafe. I suspect that's much more likely when the code comes from a source such as ChatGPT that delivers code in a completely untested state.
- Brian_K_White 3y agoSyntactically incorrect code is not much different than an outline or pseudocode. There are way too countless many stories of people successfully accomplishing tasks by getting an llm to give them a starting point or outline or even a complete solution that only needed a few fixups, hardly any different from debugging your own first draft, to say it doesn't or can't work. That's already sailed. The fact that it doesn't produce finished correct code, or even appropriate outline for every single case, doesn't seem especially remarkable or damning to me. It is what it is, it's not what it's not. (I haven't used any myself, but I'm not primarily a coder who is obligated to take advantage of every available tool, and don't like how any of the llm companies are training on open source code without either consent or attribution and then selling that. And don't like how ai and even mere speech to text voice interface before that is being added to everything in general.)
- dllthomas 3y ago> hardly any different from debugging your own first draft I find this take surprising. Leaving AI aside entirely, debugging my first draft seems very different than debugging your first draft.
- 3y ago
- zouhair 2y agoI am no programmer and I love how chatgpt can explain a bash script to me line by line, makes reading those way easier and more enjoyable.