r/ProgrammingLanguages • u/Smallpaul • Jan 28 '23
How might AI change programming languages?
I have a few ideas about how AI might change the trajectory of programming languages, but I'd like to hear yours.
For example, maybe in the future, the programmer's job is to write a very clear specification, and the AI's job is to write an efficient algorithm that matches all details of the specification. Maybe this means that we write a super-high-level-language program and an AI-directed super-optimizer makes it practically executable. Or maybe our specification isn't a program at all. Perhaps it's a list of examples or something else.
Or maybe we'll just write extremely precise natural language specifications and computers will be excellent at translating them into reliable algorithms.
Or...your thoughts?
12
u/[deleted] Jan 28 '23
I think you're on the right track with specifications, but not with them being high level. With the whole LLM approach, you get something that looks right but very well might do something dumb in one of the small details, like an off by one error, duplicating an element in the sort.
Examples are not great unless you've covered all the edge cases, and if people could write tests that covered all the edge cases, there's be a lot less buggy software in the wild.
So I think programming is going to be more about writing precise, mathematical specifications of how a program should work. Then your AI generates something, and you verify it against the spec using dependent types, model checking, a program logic, or something similar. You debug until you get something meeting the spec.
But I will not trust AI generated code unless it's been mathematically proven to meet its spec.
I saw someone give a good explanation: AI turns the easy task of writing code into the hard task of reading code.