Source code can be written in natural language instead of computer garbage

Projects can be shared using natural language instead of source code and then have the AI convert it into source code before compiling it… essentially making it a pre-compile step.

It would save a lot of wasted time reading code if the code were like this:

"print out every number prime number from 1 to 100"

and not

function main() {
  for (var i=1; i<100; i++) {
      if (isPrime(i)) {
         console.log(i);
      }
   }
}
function isPrime(n) {
   for (var i=2; i<n; i++) {
        if ((n % i) == 0) { 
           if (i != n) {
              if (n != 1) {
                 return false;
              }
           }
      }
   }
   return true;
}
main();

I feel like code could just be saved as regular text documents in normal language… making source code actually readable so that people can know what a program does before they open it… or find all the bugs in the code in like an hour instead of a month or two.

5 Likes

Clearly written from the perspective of someone who has never actually written any serious code.

1 Like

What makes “code” different from natural language. At the basic level it’s a representation of intention to convey/execute some function/purpose. There is nothing inherently prohibitive in having natural language translation (which is happening as we speak) into “code”. Yes conciseness, ability to be extremely precise in function is still the domain of code, but sooner than later there will be truly nl to code translators.

Now from the other side of the coin, the amount of natural language commands or instructions that would be needed to create semi complex piece of software would be staggering, unless we can somehow come up with mechanisms that effectively translate intent into code with all its intricacies and related functions. (C’mon GPT let’s get crackin’).