4 ms·
Ask HN: More reason-able, maintainable AI-based programming language?
What if there was a language that you couldn't ever look at the code and wonder: "What does this do?"
Because the code would explicitly in plain natural language (e.g. English, or whatever your favorite), tell you exactly what it does.
Not just at the function level, but everywhere. You can still have comments (explaining why you might want this, and other useful information), but the code tells you what it does.
For (a not that great) example
sum all prefixes of this array and create an array listing these sums
Would be a nice document that explains a piece of code (but to be sure, not a great comment in terms of how comments are typically used) like
let sum = 0;
const preSums = nums.map(n => {
sum += n;
return sum;
});
But what if instead of writing the code and the comment, you just wrote the 'actionable, descriptive' comment, and let AI 'compile' it into code?
I'm thinking that this might (with enough thought and refinement) become a good way to code. Not just by chatting with an AI, or using a CoPilot like system, but an actual "natural language" programming language idea (similar to Cobol, but in fact, actually really natural).
Then rather than the finished AI-generated code that still needs to be integrated, understood and maintained, you have the document of the 'prompt' (actual procedural intent of the code), formalized as a language in and of itself, that blackbox AI tools then take care of turning into some kind of code under the hood, much like a compiler.
An actual "AI-compiled" programming language. That brings you the benefits of a dedicated language, with the flexibility of natural language based generation.
I'm sure other people are thinking about the same thing. What are your thoughts?