Theoretical Question

Could you, theoretically, create a program that writes another program and compiles and executes that other program, which subsequently does the same?

If there's an online resource about this (I feel like this question has a name for the phenomenon I'm describing), feel free to just link me. I couldn't find anything in Google cause I was probably not using the right keywords for the concept I'm thinking of.
Yes you could, but what would be the point? Wouldn't it make more sense to just create the final program directly? It'd certainly be much easier.
It looks like modified Quine. It is certainly possible.

Wouldn't it make more sense to just create the final program directly? It'd certainly be much easier.
Not if final program should be written in Malbolge.

And actually metaprogramming (writing programs which creates programms) is a valid area of CS. It is just not used for exactly that.
Last edited on
You are on the border between 'virus' and 'AI'.
METAPROGRAMMING! Thank you.
Topic archived. No new replies allowed.