# Generate code in another language [duplicate]

Write a program in language A which outputs a program in language B where:

1. Language A != Language B
2. The output is itself a solution to this question.

This is a popularity contest. If you want to define your own BNFs/grammars for this, feel free, but try not to make it too boring by doing so.

EDIT: The more languages it ends up generating code in, the better (in my opinion).

EDIT2: Try to use languages that are not similar (I.e. generate the code in a different family of languages). (E.g. C to Scheme)

## marked as duplicate by Peter Taylor, Howard, Kendall Frey, John Dvorak, ProgramFOXMar 10 '14 at 18:54

• I would make this code-bowling, but I don't want it to be too difficult for people. – Millie Smith Mar 10 '14 at 17:13
• Code-bowling is not a good idea. Many solutions here would just print out larger versions on each iteration, so the arguably longest version is infinitely long. – Justin Mar 10 '14 at 17:20
• Might want to restrict what languages. Otherwise, languages that are very similar (almost identical, such as the two Befunges) could cheat, and for some reason, such answers tend to get a lot of upvotes. – Justin Mar 10 '14 at 17:21
• This is a slightly relaxed version of Golf a mutual quine and its variant Write a third order quine. – Peter Taylor Mar 10 '14 at 17:26
• The relaxation is that it does not need to be a "quine", that is, it can expand indefinitely. I think this is different enough to not mark it as a duplicate, but only if this is changed to make it so that it needs to be expandable (ie, never will come back to the same program, only a bigger one for each language). – Justin Mar 10 '14 at 17:32

# php --> asp --> html --> xhtml .......

 Hello


Infinite languages

• This is just boring: meta.codegolf.stackexchange.com/a/1063/9498 – Justin Mar 10 '14 at 18:44
• @Quincunx I don't think the post you linked is about this. For example it would be boring if somebody just added the code into a variable and printed it. But in Html this is considered a code. – Mhmd Mar 10 '14 at 18:50
• I know it is valid code, but it is still just hardcoding the output, and it is even easier and requires less thought. – Justin Mar 10 '14 at 18:59
• Sorry for that I will never do it again. – Mhmd Mar 10 '14 at 19:01

## HQ9+, HQ9++ (and more)

Q


I'm starting to like this family of languages.

• – Howard Mar 10 '14 at 17:35
• @Howard Sorry, I don't see how that's relevant. HQ9+ was certainly not invented by me, and wasn't invented for this task. – Kendall Frey Mar 10 '14 at 17:48
• The question clearly said: lang A != lang B – Mhmd Mar 10 '14 at 17:54
• @user689 HQ9+ != HQ9++ – Kendall Frey Mar 10 '14 at 17:57