Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Programs that write programs

by moritz (Cardinal)
on Oct 28, 2011 at 10:20 UTC ( [id://934361]=note: print w/replies, xml ) Need Help??


in reply to Programs that write programs

Sure. For example a "quine" is a program that produces its own source code as output. Running that output again as a Perl program of course yields the same output again.

There are also nice multi-language quines, for example Perl code that output shell code, which then again produces the original Perl code etc. See for example http://www.nyx.net/~gthompso/quine.htm and http://johannesloetzsch.de/software/quines/.

A less obscure example is a compiler: A compiler produces working code, and if it is written in the language it compiles, then it can compile itself, and the result can again compile itself etc. This is called "bootstrapping".

Another example would be Acme::EyeDrops, which you can probably use on itself.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://934361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found