As stated in the title i have truly came over an amazing piece of art:
Hit view source on that and stare at pretty strange,at the first look,source code. Well that source, my friends, is neither html, c, python or perl it is all of them, plus some more.The above linked source code compiles/interprets and runs under all of these languages: html+js, c/c++, python, perl, ruby, bash, sh, zsh, haskell, makefile, tcl and brainfuck.
I've tested the source on all of them just to make sure that it isn't a joke and it isn't! even if we count haskell which in my case it didn't interpret (i used hugs but it didn't work for some reason and i didn't insist). Here is some proof output for the unbelievers:
shinnok@donkey:/tmp$ wget https://mauke.ath.cx/stuff/poly.html --2009-01-21 18:26:11-- https://mauke.ath.cx/stuff/poly.html Resolving mauke.ath.cx... 126.96.36.199 Connecting to mauke.ath.cx|188.8.131.52|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2376 (2.3K) [text/html] Saving to: `poly.html'
100%[======================================>] 2,376 --.-K/s in 0.001s
2009-01-21 18:26:12 (2.21 MB/s) - `poly.html' saved [2376/2376]
shinnok@donkey:/tmp$ python poly.html I'm a Python program. shinnok@donkey:/tmp$ perl poly.html I'm a Perl program. shinnok@donkey:/tmp$ ruby poly.html I'm a Ruby program. shinnok@donkey:/tmp$ cp poly.html poly.c shinnok@donkey:/tmp$ gcc -o poly poly.c poly.c:37:20: warning: trigraph ??! ignored, use -trigraphs to enable shinnok@donkey:/tmp$ ./poly I'm a C program (C89 with // comments, trigraphs disabled). shinnok@donkey:/tmp$ cp poly.html Makefile shinnok@donkey:/tmp$ make I'm a Makefile. shinnok@donkey:/tmp$ beef poly.html I'm a brainfuck program. shinnok@donkey:/tmp$ tclsh poly.html I'm a tcl script. shinnok@donkey:/tmp$ sh poly.html I'm a bash script. shinnok@donkey:/tmp$ zsh poly.html I'm a zsh script. shinnok@donkey:/tmp$ bash poly.html I'm a bash script.
I find it amazing the way the writer of that piece of poly-code managed to use various syntactic and lexical as well as operators and language specific tricks in order to get that same piece of code to compile/interpret and run on all of those languages.