2
\$\begingroup\$

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)

\$\endgroup\$
8
  • \$\begingroup\$ I would make this code-bowling, but I don't want it to be too difficult for people. \$\endgroup\$ Mar 10, 2014 at 17:13
  • \$\begingroup\$ 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. \$\endgroup\$
    – Justin
    Mar 10, 2014 at 17:20
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Justin
    Mar 10, 2014 at 17:21
  • 1
    \$\begingroup\$ This is a slightly relaxed version of Golf a mutual quine and its variant Write a third order quine. \$\endgroup\$ Mar 10, 2014 at 17:26
  • \$\begingroup\$ 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). \$\endgroup\$
    – Justin
    Mar 10, 2014 at 17:32

2 Answers 2

2
\$\begingroup\$

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

 Hello

Infinite languages

\$\endgroup\$
4
  • \$\begingroup\$ This is just boring: meta.codegolf.stackexchange.com/a/1063/9498 \$\endgroup\$
    – Justin
    Mar 10, 2014 at 18:44
  • \$\begingroup\$ @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. \$\endgroup\$
    – Mohammad
    Mar 10, 2014 at 18:50
  • \$\begingroup\$ I know it is valid code, but it is still just hardcoding the output, and it is even easier and requires less thought. \$\endgroup\$
    – Justin
    Mar 10, 2014 at 18:59
  • \$\begingroup\$ Sorry for that I will never do it again. \$\endgroup\$
    – Mohammad
    Mar 10, 2014 at 19:01
-2
\$\begingroup\$

HQ9+, HQ9++ (and more)

Q

I'm starting to like this family of languages.

\$\endgroup\$
4
  • 6
    \$\begingroup\$ No longer funny. \$\endgroup\$
    – Howard
    Mar 10, 2014 at 17:35
  • 1
    \$\begingroup\$ @Howard Sorry, I don't see how that's relevant. HQ9+ was certainly not invented by me, and wasn't invented for this task. \$\endgroup\$ Mar 10, 2014 at 17:48
  • \$\begingroup\$ The question clearly said: lang A != lang B \$\endgroup\$
    – Mohammad
    Mar 10, 2014 at 17:54
  • 2
    \$\begingroup\$ @user689 HQ9+ != HQ9++ \$\endgroup\$ Mar 10, 2014 at 17:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.