Writing quines is hard. Why not have your computer write them for you!
Your program will take as input an interpreter (in a Turing complete language of your choosing) for a language X, and you will output a quine in language X.
- Language X is guaranteed to be Turing complete (you do not need to check this (it would be impossible to do so anyways)).
- Due to some issues that jimmy23013 raised in the comments, I'll also guarantee that the language has a quine.
- A quine for the purposes of this challenge is a program that outputs its own source code when given no input.
- The interpreter might throw errors if the program it is running has errors, so be prepared! (A quine shouldn't throw errors.)
Here is an example algorithm you can use. I am only putting it here so people don't claim this challenge is impossible:
Go through every possible program, running them all in parallel or via Dovetailing. Throw out programs that cause errors. Whenever a program outputs its own source code, you are done. Since every Turing complete language has at least one quine, this is guaranteed to eventually return a result.
This is code golf, so the shortest answer wins!