Comment A return to the era of "buggy" compilers (Score 5, Interesting) 141
When I learned C++, back in the 1980s, the "compiler" (Cfront) was really just a translator that generated C code. That was a good thing, because it occasionally generated bad code, and being able to keep the intermediate C code around during compilation meant you could figure out what was going wrong at that level instead of having to dig into the assembly code. Code-generation bugs still happen occasionally in compilers, I'm sure, but not like it was in those days. Now, it's rare anyone has to worry about the code that ends up executing being functionally different from what was expressed in the higher level language (at least not due to code generation bugs).
But that semantic gap (the levels of abstraction between what the programmer considers as an abstract execution model and what the hardware actually executes) was increased by going from C to C++, and Cfront was the tool that enabled that expansion. Newer, even higher level languages have continued to increase that semantic gap, aiding productivity gains. But, they still generate code in a predictable, consistent way. The same code, compiled by the same compiler version, will generate the same executable code every time.
But here we are again. LLM-generated code is just the new "Cfront", taking very high level language descriptions of what we want, in the form of "prompts", and translating them into code at one (higher) level of semantic gap into another (lower) level of semantic gap. Great. Except now we're back to having to deal with "bugs" in the code generation. Worse yet, it doesn't generate the same code consistently, because the "temperature" parameter is a trade-off between output quality and consistency. Perhaps one day we'll get to where modern compilers and code generators are. Until then, we are still responsible, even liable, for the code we create, either directly or via some LLM-based model. So, we'd better be able to read and understand the code being generated at the layer most prone to bugs, until that layer gets to the same level of reliability as modern compilers are at today.
But that semantic gap (the levels of abstraction between what the programmer considers as an abstract execution model and what the hardware actually executes) was increased by going from C to C++, and Cfront was the tool that enabled that expansion. Newer, even higher level languages have continued to increase that semantic gap, aiding productivity gains. But, they still generate code in a predictable, consistent way. The same code, compiled by the same compiler version, will generate the same executable code every time.
But here we are again. LLM-generated code is just the new "Cfront", taking very high level language descriptions of what we want, in the form of "prompts", and translating them into code at one (higher) level of semantic gap into another (lower) level of semantic gap. Great. Except now we're back to having to deal with "bugs" in the code generation. Worse yet, it doesn't generate the same code consistently, because the "temperature" parameter is a trade-off between output quality and consistency. Perhaps one day we'll get to where modern compilers and code generators are. Until then, we are still responsible, even liable, for the code we create, either directly or via some LLM-based model. So, we'd better be able to read and understand the code being generated at the layer most prone to bugs, until that layer gets to the same level of reliability as modern compilers are at today.