Generate code in another language

2

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)

Millie Smith

Posted 2014-03-10T17:11:29.220

Reputation: 129

Question was closed 2014-03-10T18:54:38.827

I would make this code-bowling, but I don't want it to be too difficult for people. – Millie Smith – 2014-03-10T17:13:44.087

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 – 2014-03-10T17:20:24.637

1Might 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 – 2014-03-10T17:21:32.243

1

This is a slightly relaxed version of Golf a mutual quine and its variant Write a third order quine.

– Peter Taylor – 2014-03-10T17:26:06.513

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 – 2014-03-10T17:32:03.313

Next time, remember to send your question through the sandbox

– Justin – 2014-03-10T17:32:46.430

This trumps everything – user80551 – 2014-03-10T17:38:57.620

Thanks @Quincunx. I wasn't aware. Yes, yes that does user80551 – Millie Smith – 2014-03-10T17:48:29.993

Answers

2

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

 Hello

Infinite languages

Mhmd

Posted 2014-03-10T17:11:29.220

Reputation: 2 019

This is just boring: http://meta.codegolf.stackexchange.com/a/1063/9498

– Justin – 2014-03-10T18:44:56.617

@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 – 2014-03-10T18:50:32.617

I know it is valid code, but it is still just hardcoding the output, and it is even easier and requires less thought. – Justin – 2014-03-10T18:59:10.077

Sorry for that I will never do it again. – Mhmd – 2014-03-10T19:01:20.890

-2

HQ9+, HQ9++ (and more)

Q

I'm starting to like this family of languages.

Kendall Frey

Posted 2014-03-10T17:11:29.220

Reputation: 2 384

6No longer funny. – Howard – 2014-03-10T17:35:27.843

1@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 – 2014-03-10T17:48:49.963

The question clearly said: lang A != lang B – Mhmd – 2014-03-10T17:54:43.300

2@user689 HQ9+ != HQ9++ – Kendall Frey – 2014-03-10T17:57:30.373