Live data from Hacker News

Show HN: GPT Repo Loader – load entire code repos into GPT prompts

github.com

121–130 of 162 posts

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#121

Earlier quoted context omitted.

I'm already at the point where I get frustrated when GPT writes some incorrect code - despite it saving me enormous amounts of time. The appetite for productivity seems to be insatiable. I want to be able to create a million lines of code per month by myself.

> I want to be able to create a million lines of code per month by myself. That sounds terrible . Who is going to read all that code when you need to understand and modify it? The LLMs, I guess? I'd much rather be able to write 10,000 lines of code that can do what your million lines of code does. Better programming languages, libraries, and other abstractions are what we need.

>> I'd much rather be able to write 10,000 lines of code that can do what your million lines of code does.

Sure, who wouldn't. Unfortunately this is my hypothetical and I get to control what I mean by it. The million lines of code in my hypothetical is good quality, maintainable with reasonable density.

>> Better programming languages, libraries, and other abstractions are what we need.

In the entire history of languages, we've only managed about a 10X improvement via these mechanisms (that is being charitable probably). Several important things are still written in C which would mostly be recognizable to a programmer from 40 years ago. There are still problems to solve but I feel we are on the asymptotic section of the curve in this regard.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#122
post #62

61 LOC for implementation, 42 LOC for tests. this repo currently has more HN upvotes than LOC. very high leverage code!

https://github.com/mpoon/gpt-repository-loader/pull/17/ If you look at this PR, he had ChatGPT write the tests for him. He wrote the issue on https://github.com/mpoon/gpt-repository-loader/issues/16 and summarized https://github.com/mpoon/gpt-repository-loader/discussions/1... "Open an issue describing the improvement to make Construct a prompt - start with using gpt_repository_loader.py on this repo to generate the…

I've got a hunch that AI will be able to put Hyrum's Law (https://www.hyrumslaw.com) to good use in the future: given an application, generate unit tests for all documented and undocumented behaviours of the system. Do all the refactoring you need afterwards and you'll have a large safety net backing you up. With refactoring complete, regenerate unit tests for all new behaviours of the system.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#123

Earlier quoted context omitted.

So relatable! I find myself getting irritated when it gets stuck on something and I have to intervene, yet it helps absolutely shred LOCs in some other cases.

"If we wish to count lines of code, we should not regard them as lines produced but as lines spent." — Dijkstra

I think these days, LOC is a reasonable metric for a peer-reviewed code base. It is unlikely that the lines of code in a given project can be reduced by 10X in a maintainable way. Can we easily reduce the LOC in the Linux kernel or Postgres by 10X for example? It seems unlikely.

LOC is a fuzzy proxy for the amount information in a code base. It should never be used for any kind of productivity metric however since that is obviously dumb and easily gameable (win by writing terrible code). Of course most productivity metrics are fall into the dumb/gameable category so lets not use them.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#124
post #74

Earlier quoted context omitted.

Here is what GPT-4 says about it. "As an AI language model, I can understand and work with various text encoding schemes and compression algorithms. However, to work with a raw bytestream, you would need to provide specific details about the encoding and compression used. To teach me to understand a particular binary encoding and compressed text format, you should provide the following information: The binary encodin…

When GPT gives an answer like that, is it actually a meaningful description of its capabilities? Does it have that kind of self-awareness? Or is it just a plausible answer based on the training corpus? Genuine question.

My guess is that the training data includes things specifically about the GPT itself and its capabilities, so it would be somewhat correct. But it's also known to just make shit up when it feels like it, so you can't 100% trust it, same as with all other prompts/responses.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#125
post #10

This is awesome, can't wait to get api access to the 32k token model. Rather than this approach of just converting the whole repo to a text file, what I'm thinking is, you can let the model decide the most relevant files. The initial prompt would be, "person wants to do x, here are the file list of this repo: ...., give me a list of files that you'd want to edit, create or delete" -> take the list, try to fit the con…

Maybe someone can correct me, but my understanding is that you would calculate the embeddings of code chunks, and the embedding of the prompt, and take those chunks that are most similar to the embedding of the prompt as context. Edit: This, btw, is also the reason why I think that this here popped up on the hackernews frontpage a short while ago: https://github.com/pgvector/pgvector

This sounds like a reasonable start. Eventually we need to get to the point where we can expose an API for models to request additional information on their own.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#126
post #115

Earlier quoted context omitted.

Actually, programming languages were invented because speaking machine code was too much of a pain in the ass! Programming in English is a natural next step. Ambiguity is not an issue -- you keep speaking until its resolved. (We already program in English, in a sense, when we tell humans what we want, and they go code it. Now we'll just be telling machines.)

This type of well-defined language actually predates computers by several thousand years. Even way back in antiquity they used "programming languages" like these to get around the inherent ambiguities of natural language. Originally as formulaic syllogisms and Aristotelian logic, but then onto other forms of codified language, formal logic etc. Adding more words often makes things less clear, not more so. What you ne…

I disagree that logic or math are the same as a programming language; a programming language is defined by the fact that a machine can execute it.

Plus also most math and logic is still communicated and developed in a mix of human languages (English etc) and ad-hoc, not rigoursly defined notation; it's nowhere near the precision of a programming language.

Though you CAN of course grind it out at that level, if you want, but it's very unwieldy and not how people actually work.

If you're looking to deduce some sort of proof from well-defined principles and you wish to eliminate the possibility of error, then sure well-defined terms (a rigorous language) is useful.

If you're looking to produce a sofwtare artifact, just saying what you want in high-level terms and providing iterative natural language feedback is going to work great and be way nicer than trying to formalize everything.

(Maybe not true for low-level plumbing and things that need to be secure. But for like "build an app", "build a game", "make a shell script that does x", I think it will certainly end up being true.)

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#127
post #126

Earlier quoted context omitted.

This type of well-defined language actually predates computers by several thousand years. Even way back in antiquity they used "programming languages" like these to get around the inherent ambiguities of natural language. Originally as formulaic syllogisms and Aristotelian logic, but then onto other forms of codified language, formal logic etc. Adding more words often makes things less clear, not more so. What you ne…

I disagree that logic or math are the same as a programming language; a programming language is defined by the fact that a machine can execute it. Plus also most math and logic is still communicated and developed in a mix of human languages (English etc) and ad-hoc, not rigoursly defined notation; it's nowhere near the precision of a programming language. Though you CAN of course grind it out at that level, if you wa…

Well what you want is one and only one behavior. You're going to need to be specific to the point where what you're specifying is that singular behavior. An interesting example is a binary search, which is easy to informally specify, although it's shockingly difficult to produce a correct implementation. [1]

Given what you want is a singular specific behavior, not just sorta that behavior, but exactly that behavior, it makes sense to use a language that caters to specificity.

As an aside, we've experimented with more natural-language like programming languages before (COBOL, BASIC). They're a pain in the ass because you needed to type a novel to do even trivial things. The terseness of modern programming languages is a feature.

[1] https://ai.googleblog.com/2006/06/extra-extra-read-all-about...

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#128
post #29

Fully automated junior swe but on hyper speed. Natural next step

How will we grow new senior SWEs in the future?

Software engineering will never be the same. The LLM will teach its users about programming. This is the worst LLM tech will ever be. That is an incredible statement. The rate of error will decrease to near zero or at the very least significantly better than human. Universities will resist at first but the new tools that will emerge will be core curriculum at university. Just as I now don't use the pumping lemma day to day, programmers of the future will not write code. They will primarily review and eventually AI systems will adversarially review and programmers will do final review.

All programmers will become translators from product vision to architecture implementation via guided code review. Eventually this gap will also be closed. Product will say: Make a website that aggregates powerlifting meet dates and keeps them up to date. Deploy it. Use my card on file. Don't spend more than $100/month. The AI will execute the plan.

Programmers will come in when product can't figure out what's wrong with the system.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#129
post #76
post #10

This is awesome, can't wait to get api access to the 32k token model. Rather than this approach of just converting the whole repo to a text file, what I'm thinking is, you can let the model decide the most relevant files. The initial prompt would be, "person wants to do x, here are the file list of this repo: ...., give me a list of files that you'd want to edit, create or delete" -> take the list, try to fit the con…

Working with GPT becomes like coding in plain English.

And we are back with Cobol haha full circle

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#130
post #10

This is awesome, can't wait to get api access to the 32k token model. Rather than this approach of just converting the whole repo to a text file, what I'm thinking is, you can let the model decide the most relevant files. The initial prompt would be, "person wants to do x, here are the file list of this repo: ...., give me a list of files that you'd want to edit, create or delete" -> take the list, try to fit the con…

Please see the following repos for tools in this area:

https://github.com/jerryjliu/llama_index

and/or

https://github.com/hwchase17/langchain

Post reply on HN