Im not sure if there is a "Generalized" area where this would go, but regardless:

Im curious to know, how would you build a program that writes itself?
Any examples, pictures, screen shots, videos, tutorials, code, anything that anyone has and knows how to make such thing, that would be greatly appreciated.

Im not going to try it myself because I know it would just be way to advanced for me right now, but I would like to know how it might be done.

I was in my car today, and it got me thinking about the mechanics that make it work, then the automated stuff and digital things like the clock, tempture, speed, friction, etc. Then it got me thinking of the code, and how it might of been written.
Then I thought of how the car is manufactured, they pump like lets says 10,000 models a DAY, productivity would be slow if they had a guy sitting there pressing 3 buttons, inserting, loading, running, then ejecting a CD 10,000 times a day. So they must have some sort of machine that does this.
But... The machine does all the pumping/re-writing of the same code...
Which means, that someone had to have programmed this machine to write code...

Again, im just curious as to how you might make a program (in any language, any software doesnt matter) write code.

Something like I donno... You push a button or when the program loads, it writes the HTML version for making a image, using the img tag or something.