This page may be out of date. Submit any pending changes before refreshing this page.
Hide this message.
Quora uses cookies to improve your experience. Read more
8 Answers
Colin Maharaj

I will say no not yet, and I will go further and say it is not that important, but if it were possible, it will be inconsistent with the requirements.

Why?

Because there is always a communications barrier between those who make the requirements and those who have to fulfill it.

That said, this is not new. The process of extracting exact requirements from the customer is never a perfect one and in some cases, users will have to get involved because they will be the ones who may have difficulty trying to run 2 apps at once including the new database app that you are creating and the issue is one of not enough RAM on the machine and the steps that THAT user had to jump through, to be able to get things working so they don’t crash their machine is nothing short of amazing.

Now we are dealing with non-functional requirements - she/he needs a better terminal (PC), which management is unwilling to purchase.

Now the developer app is working fine on his test rig, and the user is having issues and the developer has to come into the customer office, and talk to the user, cutting out the executives, the s/w consultant and the in house engineer who is suppose to tell the development firm that management sucks since they cut the PC budget yet again. And don’t even want to buy RAM.

NOW! The developer has to start a process to find ways to cut the memory requirements of the application, by not loading too many windows on the screen and use less colorful dialog (or whatever). He is trying hard not to say, that you need to upgrade the terminals, since the firm he works for already signed a contract, part of which indicated that the PC specs were adequate - but no one really checked.

….

OK, so the point is, I don’t think AI is at the point where it will need to deal with all this craziness.

Colin B Maharaj

Developer.

Shayne Miel
I guess you have to ask yourself what it means for a computer to "write code". Let's define it like this:

Given a goal, generate machine-readable instructions to accomplish that goal.

If we take that as the definition of writing code then we are already at a place where computers can do that. Technically, we've been there since (just after) the beginning.

We started off having to communicate with the processor in 1s and 0s (which was already an abstraction of the high and low voltages a computer actually uses). Eventually, we invented low level assembly languages, which let us make more abstract statements that the computer turned into binary code for us. If our "goal" was to add two numbers, then we could ask the computer to generate code that would do that, although we had to type that request out it in a fairly arcane language.

The progression has been to create more and more abstract languages, so that now I can write something like the following (assuming variables have been set, etc):

if apple in basket:
    get(apple)

and the computer will generate the code necessary to check on the contents of the basket and get me an apple.

Speaking of apples, I can casually say out loud, "Siri, call mom" and my phone will generate the binary code needed to connect my phone with my mom's phone on the other side of the country.

All of the above assumes that I am the goal-generating agent. In order to skip the philosophical dogfight over whether my command to Siri is any different from the text I received from my brother earlier telling me to call mom, let's assume it's the future and we've solved that quandary and given computers the ability to be goal-generating agents (which is what people mean when they talk about strong AI or general AI). In that case, the very first thing an AI would be able to do is generate code to accomplish goals. [If we're talking about something other than strong AI, then we already have this ability in any compiler]
Your response is private
Is this answer still relevant and up to date?
Nick Granny
Absolutely...

Systems I've developed are already doing this.  For example, my fpgaARCHITECT platform allows a user to graphically define a system (think digital whiteboard and block diagrams), annotate nodes and edges with requirements, and the system generates the FPGA Verilog code needed to realize the system.
Your response is private
Is this answer still relevant and up to date?
Ishan Dutta

What do you mean by writing code. AI is actaully wrting code. What AI is doing is it writes invisible instructions set from input and output specification which otherwise would have been very complicated and would have take millions(or maybe more) of lines if humans would have coded those usecases by hand themselves. The code we write to train the data and the consume the model is actually very small part of the code. Actual code is hidden within the trained model which woiuld have taken probably millions of lines if humans would have written by conventional programming methods. Do Check is what Andrej Karpathy [1]says.

Probably what you meant is will AI be able to generate human readable code snippets in high level programming languages that we write to build applications today. To answer that part yes there are efforts from few startups in that direction as well. There are efforts where an entire app is being generated by AI. There can be two approaches to it, either make the code invisible (ie in form of trained model) which can only generate the end app or the trained model can generate human readable code in a high level language which in turn compiles into an app.

My personal take is it would not take more than a decade or two before you can build a fully customized app or website or webservice as per your exact requirements by just convesing with a voice agent like apple siri or google home or amazon alexa.

Footnotes

[1] Software 2.0 – Andrej Karpathy – Medium

James Burkill

Constructive hyper-heuristics are said to generate their own algorithms.  But what they actually do is take snipets of other heuristic algorithms and piece them together. 

Imagine you are trying to solve a combinatorial optimisation problem, like traveling salesman.  You have an array with 200 different heuristic algorithms that you can choose from.  You then use something like reinforcement machine learning to determine which heuristics to call and when and for how long.

You end up with a list of instructions run algorithm 55 for 5 seconds followed by algorithm 42 for 3 seconds and then algorithm 105 for 10 seconds.  Your hyper-heuristic then returns that list of instructions as its output and you can run it against your data instance.

A travelling salesman algorithm was constructed by a machine learning algorithm, though one could argue that the hyper-heuristic hasn't actually written any code.

Hi, this is my first answer so I will not give a big explanation like other’s but I would like to share this great web link I found on Google.

Using Artificial Intelligence to Write Self-Modifying/Improving Programs

And its source code is also available at GitHub (GitHub - primaryobjects/AI-Programmer: Using artificial intelligence and genetic algorithms to automatically write a program, in the BrainF programming language. Read the tutorial at http://www.primaryobjects.com/cms/article149)

You can use online interpreter’s to test the output by your self.