How do you use AI to learn internals of massive repos? Surely the context is too big and/or it requires opening org code up and I'd never get approval for that. What LLM do you use?
> I have a solid understanding of GCC (GNU Compiler Collection) internals, including its architecture, optimization techniques, and various components such as the front end, middle end, and back end. If you have specific questions or need detailed information, feel free to ask!
> Can you break down for me what I have to do to add a builtin function that generates some code following a specific calling convention?
> To add a built-in function to GCC that generates code following a specific calling convention, you'll typically follow these steps: ...
> I've gotten as far as step 4 already. Got stuck because I'm not familiar with the internal data structures and APIs. Can you show me how such a thing could be accomplished with example code?
> Certainly! Here's a simplified example of how you might add a built-in function to GCC that generates code following a specific calling convention. This example assumes you're targeting the x86 architecture, but the principles can be adapted for other architectures. First, let's define...
And I just kept asking it questions, drilling down into the complexity until I felt like I understood enough to attempt it on my own. It showed me the files I had to modify and introduced me to the internal compiler APIs needed to accomplish my goal. At some points it generated some insane code but it still saved me a ludicrous amount of time and effort.
Sadly it was a lot less useful for QEMU:
> How extensive is your knowledge of QEMU source code and its internals?
> My knowledge of QEMU source code and its internals is limited. While I can provide some general information and insights based on publicly available knowledge up to January 2022, I may not be able to provide in-depth details or specific code-level explanations.
Not GP. Context length for chatGPT enterprise is 128k tokens. By pasting the repo tree and readme file and maybe a couple entry points you can get help from ChatGPT to find out what parts of the codebase are more useful to you, or you can simply paste a lot of it and ask questions.
> How much do you know about GCC internals?
> I have a solid understanding of GCC (GNU Compiler Collection) internals, including its architecture, optimization techniques, and various components such as the front end, middle end, and back end. If you have specific questions or need detailed information, feel free to ask!
> Can you break down for me what I have to do to add a builtin function that generates some code following a specific calling convention?
> To add a built-in function to GCC that generates code following a specific calling convention, you'll typically follow these steps: ...
> I've gotten as far as step 4 already. Got stuck because I'm not familiar with the internal data structures and APIs. Can you show me how such a thing could be accomplished with example code?
> Certainly! Here's a simplified example of how you might add a built-in function to GCC that generates code following a specific calling convention. This example assumes you're targeting the x86 architecture, but the principles can be adapted for other architectures. First, let's define...
And I just kept asking it questions, drilling down into the complexity until I felt like I understood enough to attempt it on my own. It showed me the files I had to modify and introduced me to the internal compiler APIs needed to accomplish my goal. At some points it generated some insane code but it still saved me a ludicrous amount of time and effort.
Sadly it was a lot less useful for QEMU:
> How extensive is your knowledge of QEMU source code and its internals?
> My knowledge of QEMU source code and its internals is limited. While I can provide some general information and insights based on publicly available knowledge up to January 2022, I may not be able to provide in-depth details or specific code-level explanations.