Ask coding questions

← Back to all posts
Self-writing code
mcko7304

What if a computer could write its own code?

Answered by amasad [earned 5 cycles]
View Answer
Voters
omarhegazy5
stem10
Vandesm14
mcko7304
Kiroxxvxx
Abdirahman31
amasad
the_tootoo_guy
Comments
hotnewtop
amasad

Funny story, back in college I studied computer engineering instead of computer science at first because I thought software is a "solved problem". I thought that we'd be able to automate writing software, something like a wizard would take a user through creating the software they needed.

In hindsight that was silly, because if you think about it software is the last thing to be automated. Software is the language of automation. So if we automate software we'd be automating automation itself. This is the basis for what's called intelligence explosion. If an AI can change its own code then the first thing it will do is make itself more intelligent and so on.

Now I think that this kind of stuff is too far away. I've learned some philosophy along the way and realized we don't have a conceptual basis for intelligence, let alone consciousness. How are we going to create something we didn't start to understand?

mcko7304

@amasad
You have two computers with more or less the same code. CPU A and CPU B. CPU A is on, and CPU B is off. CPU A writes code to CPU B, and then turns CPU B on. CPU A turns itself off, and CPU B copies the new code to CPU A. CPU B turns CPU A on, they both run diagnostics, and CPU B turns off.
:)

amasad

@mcko7304 you could probably write a simulation of that on repl.it!

xenox

wouldn't this be the start of ai taking over??

Babbel

@xenox i don't think so. the developer will ever be able to decide what the ai can or can't do. i believe it's impossible to develop "real" intelligence. so if you don't allow your ai to do certain things, it can't do them. i mean, why should an ai extinguish humanity? you have to give it a purpose of life. i hope it's understandable. i don't know how to explain it better

IbraheemRodrigues

There’s already a bunch of research into neutral networks that can edit and design themselves. I remember seeing a Google talk about how they were using a master network to design slave networks which themselves were then trained, and they yeilded far more efficient and accurate results. I would not be surprised if large algorithms such as the infamous YouTube algorithm already uses these techniques. Many speculate there will soon be a day when all programming will be done by AI, we will merely need to supply a description.

the_tootoo_guy

Well maybe the god's of a.i will allow us

OmniShift

We bow to our near-omnipotent intelligent robot overlords

DanielTerner

This is a very interesting topic of discussion. I think over time this will become a reality and the computer will be able to write its own code. Nowadays there are a lot of applications that can write like a human. But still, people choose proven writing services. I recommend Edu birdie which is one of the best and I advise you to read their review.
I think soon digital technology will get to the point where people will be less needed in different fields.

[deleted]

You could do this in Python 3.8.1:

optimistguy

if it is an AI

FARHEENPALAGIRI

There's this Indian movie called Enthiran that is pretty much this. The first robot built an army of other robots just like it and tried to take over the world.

cv88

Computers can write their own code! Very easily, in fact. Except, the ownership of the code, I think, will only pass to them if the complexity of the possibilities is not appreciated by the original author. My proposed solution to this is to use some kind of randomness function, and then the computer could truly write its own code. Of course, I don't think it would do anything very useful.

mcko7304

You have two computers with more or less the same code. CPU A and CPU B. CPU A is on, and CPU B is off. CPU A writes code to CPU B, and then turns CPU B on. CPU A turns itself off, and CPU B copies the new code to CPU A. CPU B turns CPU A on, they both run diagnostics, and CPU B turns off.

:)