A polyglot is a program which can be run by several different language's interpreters/compilers without failing.

For example, the stackoverflow 404 page contains a polyglot which runs in Python, Perl, Ruby, C, brainfuck and befunge, each time printing 404 to stdout.


Now, my challenge is to create a polyglot which, when run as a certain language, will print:

Just Another #{Name Of Language} Hacker,

So, if you say that your program can be run as both JavaScript and ><>, when run in a JavaScript environment it should print

Just Another JavaScript Hacker,

and when run by a ><> interpreter,

Just Another ><> Hacker,

In your answers, you should list the number of languages which accept it as a valid program and produce correct output, as well as a list of those languages.

The program which runs under the most languages wins!

  • 2
    \$\begingroup\$ @flawr it's an exact duplicate of the second dupe target though. If this was considered sufficiently different (which I don't think it is), I'd say the older challenge should be reopened. \$\endgroup\$ Commented May 24, 2015 at 20:51


Browse other questions tagged or ask your own question.