Jump to content
  • Advertisement
Sign in to follow this  
flashinpan

Software writing software?

This topic is 4571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Yes to both.

As for "software that writes software", it depends on what you consider to be a specification for the end-product. For example, a C compiler is "software that writes software", as it takes a high level human readable specification and generates code executable by a CPU.

Going even higher level than that, there are things like spreadsheet compilers that can generate a piece of software without any "code" at all.

As for software that changes itself, read up on self modifying code here.

http://en.wikipedia.org/wiki/Self-modifying_code

Share this post


Link to post
Share on other sites
Quote:
Original post by johnhattan
Yes to both.

As for "software that writes software", it depends on what you consider to be a specification for the end-product. For example, a C compiler is "software that writes software", as it takes a high level human readable specification and generates code executable by a CPU.

Going even higher level than that, there are things like spreadsheet compilers that can generate a piece of software without any "code" at all.

As for software that changes itself, read up on self modifying code here.

http://en.wikipedia.org/wiki/Self-modifying_code




Now that I have had a few replies....I now know that it was "self-modifying code" that I was asking about.

Share this post


Link to post
Share on other sites
That Wikipedia article focuses on languages where it might be considered a hack to write self-modifying code (I'm not sure about ASM, I'm not an ASM programmer). You should know that Prolog programmers, for instance, readily write software that alters itself.

Share this post


Link to post
Share on other sites
There are various levels of self-modifying code...

A program might directly overlay specific functions based on the users hardware configuration when performance or memory footprint is critical, often from a predefined library of hand-optimised routines (but run-time generation is also a possibility.) Usualy the process that injects the overlays is also the process that executes them.

An executable virus on the other hand might employ a simple code rearangement strategy, where instructions arent modified, but simply rearranged. Usualy the process that rearranges the instructions is not the process that eventualy executes them. This type of self-modifying codes only purpose is to make it harder to identify and beyond that has absolutely no practical value.

If neither of these two types fits with what you are trying to accomplish, then its quite likely that you are barking up the wrong tree.

Share this post


Link to post
Share on other sites
Quote:
Original post by MDI
That Wikipedia article focuses on languages where it might be considered a hack to write self-modifying code (I'm not sure about ASM, I'm not an ASM programmer). You should know that Prolog programmers, for instance, readily write software that alters itself.


Its considered a hack anywhere that it isn't formalized, including ASM. The majority of self-modifying ASM code out there is only used to measure the size of the processors instruction prefetch queue. Extremely unreliable since the introduction of the Pentium but very reliable on 80486 and lower.

It is no longer possible to modify code about to be executed as a modern processors has very long instruction lookahead queues to facilitate out of order executions. They also scan ahead through both conditional and unconditional branches, making it extremely hard to ever know the exact state of the processor.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I once wrote a screen fill routine in 6502 assembler on an Apple 2 that modified itself.

Share this post


Link to post
Share on other sites
Can someone talk about what place does "self-modifying code" have in AI reearch?

I read somewhere, perhaps it was it the Wiki on SMC, that genetic algorithms "sort of" do this. Is that accurate?

Share this post


Link to post
Share on other sites
Well, in Prolog, the program is able to modify itself by writing new rules and facts to the knowledgebase as time goes on. This allows the program to "learn" from its experiences.

Genetic algorithms are not self modifying, however, in this sense.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!