nickm12
Joined 14 years ago
Joined 14 years ago
What I want to preserve in the AI-code-gen age that I still can form a high-level "theory of the program" and be able to dive deep and understand parts of it, both with and without AI. I'm concerned that we're headed towards a world where it's not possible to understand or modify even the simplest programs without a swarm of agents that you direct with incantation.md files.
while both LLMs and humans are not 100% deterministic, I don't think that's the interesting part. It's both true that there are many assembly language programs that implement a C program and that there are many valid programs (in any programming language) that correctly implement a natural language spec. But there's a significant qualitative difference between the two types of translation and that would be true regardless of whether the translations are stochastic.
Dijkstra's arguments tend not to change their minds. I think the analogy takes hold because there is a kernel of truth in it. AI models now give us the magical ability to program in natural language, but the implication that an AI model is a form of compiler is deeply flawed. AI models don't replace compilers, they replace software developers. The reason software developers rarely look at assembly code is that compilers (and emulators and VMs) are able to precisely preserve the semantics of the original program.
A natural language spec is not a program, and there are many possible programs that can meet the spec. Software engineers and AI models turn specs into code, but the code is not the spec I think the analogy clouds our thinking about the value of programming languages as a tool for formally describing what the computer should do and enforcing properties of the program that should not be left to either humans or AI models to uphold.
I don't believe it's that straightforward. "Intuition" and data are both ways of learning about the world and they complement each other. Sometimes the insights only come when you dig into why intuition and data disagree. The same can be said of process. Processes embody our best practices. But sometimes we should deviate and sometimes we should discard or rebuild them.
These are all tools in the toolbox.
I often see agents skip opportunities for simplification when not explicitly prompted. I have mixed feeling about this, but for now I think it's probably for the best that they stick to the script versus take initiative for things they haven't been told to do.
"A clean interface contract" is actually all I need to stop pulling the thread, but I find that is rare in large software systems. More typical is that the provided interface lacks details about edge cases, such that multiple behaviors could meet the interface. That's what makes me want to dive deeper and figure out what those cases are, what I think is the best behavior, and what the system actually does.
I've heard fans of both statically typed and dynamically typed languages advocate for their language. The static type fans say that the rigorous compilation process gives the LLM a fast iteration loop with clear messages from the compiler on what invariants aren't being upheld. The dynamically typed languages advocates talk about fewer tokens, the popularity of the language in the training data, and so forth. Guess what, these are the exact same arguments these communities made for human developers.
Personally, I don't know the answer. The industry has swung back and forth on this over the decades. Before AI code-gen static languages were on the upswing for a variety of reasons, including runtime efficiency and much better ergonomics thanks to modern type inference engines. I suspect those reasons are still valid, and also that statically typed languages give LLMs a leg up because it is easier to reason about them locally thanks to declared types and information hiding.
I'm not saying it's all mathematical purity. Programming languages themselves have specs and sometimes they are ambiguous or allow undefined behavior. Compilers have bugs. But the gap between the source code and program behavior is typically extremely thin and language implementations work towards making it airtight.