If a program could program itself?.... (AI)

If a program could program itself?....

eg, you give it an IDE it manipulates it feeds in the data compiles it, if the code does not compile it will try something else except instead of making mistakes it can not only generate code compile it and then execute it to perform new tasks and call new instructions if it could learn to program and learn new ways modifying old code with perfect code, the most efficient way and fastest way of everything down at the very bit limit meaning 255 bytes of memory would be used perfectly never making array mistakes never using too much memory... basically what humans inspire for, imagine a program code a computer program a game or anything better than anything any human can....

would that not put turings ask a question get an answer and believe it? to shame?.... a program like that could rewrite code for aircraft, military, anything with a computer and if it evolved to implant trojans in firmware from...without getting carried away, that's more impressive than anything else to prove AI...

They've been trying for ages. It was being talked about back when I was a trainee COBOL programmer twenty-odd years ago, and it's still being talked about now.

I remember reading the headline article in some issue of Personal Computer World, called 'The Last One', which described Fourth Generation Languages, which would be programmed using entirely natural language, and computer programmers would no longer be needed.

Hi cjdelpi,

to get a grasp of how difficult it is write an Arduino program that writes its own source code to Serial.

don't google for it as it can be done,

hint:

void loop() {}

can be empty.

I suspect that if such a program could be written, it would be done using 'LISP'.

LISP is (or has been) much used for 'Expert Systems'. I had a look at it years ago, but left it feeling that it could push a person to the edge of insanity - with just one more pair of square brackets needed to push them over the edge!

Jim

Here's the real kicker of a question: If the program could write itself, what would it write itself to do? What function would it accomplish?

If the program could write itself, what would it write itself to do?

Could we get it to then post the code?

with just one more pair of square brackets needed to push them over the edge!

LISP uses round parentheses, hence the acronym Lots of Infuriating Silly Parentheses

AWOL:

with just one more pair of square brackets needed to push them over the edge!

LISP uses round parentheses, hence the acronym Lots of Infuriating Silly Parentheses

Yeah I forgot. The memory had been mercifully erased from my brain!

Jim

Hi,
Way back when I was very excited by genetic programming as written about by this guy in his book genetic programming -

http://www.genetic-programming.com/johnkoza.html

I wrote a simple interpreter for a lisp like language that simulated autonomous agents ran in a simulated environment, the langauge descibed the agents behaviour which survival and breeding opportunities depended on. The population should have evolved one or more effective programs for survival within the environment, it was very exciting at the time. The limitation was the relative simplicity of the environments I was able to create before completing my studies and starting work.

Thoroughly enjoyed Koza's book and all the projects I have done in genetic algorithms and genetic programming, it was a really exciting area in 1992.

Duane B

rcarduino.blogspot.com

jimford:
I suspect that if such a program could be written, it would be done using 'LISP'.

LISP is (or has been) much used for 'Expert Systems'. I had a look at it years ago, but left it feeling that it could push a person to the edge of insanity - with just one more pair of square brackets needed to push them over the edge!

Jim

LISP? (No, (I beg (to ((((differ)))))))). It would be written in Prolog, with Natural Language support and full forward and backward chaining statistical inference engines.

I think a program that makes programs based on users' requests makes sense. Of course we already have this, in a way, with the programming IDE and programming languages in general. So, programs do make programs. They make the ones we tell them to make based on how we tell them to make them.

You couldn't really make a "perfect" programming language unless it was programmed to be able to program... well, everything in every possible way, and someone would have to program it to be able to do that in the first place.

A program that programs itself is a "chicken or the egg" (OK, so the egg came first or there was no such thing as a completely definitive first chicken, but ignoring these minor technicalities...). You could make a program that can make changes to its programming, but how it goes about doing that and what changes it makes are determined by what it's programmed to be able to change and how it is programmed to react to changes in its "environment," or status.

How feasible would it be to create the foundations for and evolve a sentient and intelligent program? (And for that matter, how sentient and intelligent are any of us really?)

cjdelphi:
if the code does not compile it will try something else except instead of making mistakes it can not only generate code compile it and then execute it to perform new tasks and call new instructions if it could learn to program and learn new ways ...

Here's the problem...

We have all seen the very bizarre things people do to "get it to compile". Unfortunately, without really understanding the problem, the code that now compiles, usually fails spectacularly at runtime.

Would you really be happy flying in a Jumbo Jet, whose inflight navigation system passed the test: "it compiled without errors" ? Or even, whose captain "passed the test by answering all the questions correctly".

That's the point, you will never have dependability!

Hi,

Did anyone check out the link to genetic programming, it might never fly a jumbo but its a surprisingly effective program generator in some domains.

Duane B

rcarduino.blogspot.com

The one thing about this that I've always wondered I know certain virus's have the ability to morph into completely new version of a virus to trick antivirus scanners so wouldn't this sort of be considered as AI technology by some form because the programmer is giving the virus the ability to compile itself into something new? I mean types of virus's like this apply self modifying code and alter there own instructions after execution. I know that using virus as a topic for discussion isn't the best example but I've always wondered if a virus can modify itself to morph wouldn't it be possible in normal programming if it was programmed to change its instructions on its own causing it to be self sustaining basically to do a task?

I also looked into genetic algorithms / genetic programming back in the late 90's / early 2000s. It's not hard to come up with a language where every statement is syntactically valid (i.e. it does something, which may or not be what you want) and a fitness function (a way to evaluate a program to determine if it's closer or further away from a desired solution than other instances of a program).

LISP is good because a list can also be a program. Create a million lists at random, execute them all with your dataset, pick the best 50% or so, making sure that the fitness function also has a component that selects smaller programs over larger programs. Then cross-breed the programs (exchange parts of successful lists with parts of other successful lists). That's one iteration. Do a few million iterations and eventually you've got a program that does something like what you want.

The problems: it takes a LONG time to evaluate all the programs, and you might have to have some sort of timeout criterion to prevent endless loops. It takes a LONG time to do all the iterations you need to satisfy your fitness function. Once you've satisfied your fitness function enough, you have something that works for your test dataset - that might not handle all the data you throw at it. The more complicated a thing you want, the longer it will take. Not all problems can be solved with GP: you need a problem that lets you know when you're getting closer to a solution.

See it in action here:

http://alphard.ethz.ch/gerber/approx/default.html

(needs Java)

Virtually any (interpreted) script language can reprogram itself in a sense. For example VB with its "Execute" function lets you execute an arbitrary string. So it could generate code and then execute it. Ditto for Lua.

After thinking about this some more... a human could write a routine that over-writes a memory address leading to a crash, in this case the human has a finger and hits the reset button, the computer program running on the computer can't do that, unless it's somehow able to protect itself from any kind of crash, and after reading all these comments, it made me think and, it's the human drive to achieve something that's not been done before (or in some cases, has many many countless times) giving a program a self consciousness would be the difficult part :smiley: - because it could rewrite it's own memory space, it could search and explorer resources on the computer to 'find things to do' oh what's this new binary file? is it executable? what's in it, unless a computer develops the ability of a curiosity as we humans do, I can't quite see AI taking off..

but hypothetically speaking.. if it did? and someone managed to write a program that got hell bent on being better than any human and just to prove who's really the best it develops some kind of virus to teach us all a lesson how far could the thing go?

Would it post here, asking for help?

Would it post its code?

(edit)

Would it use code tags if it did?