Poly.html - check the source
mauke.ath.cx
mauke.ath.cx
#!/bin/sh
SRC_FN=poly.c
LHS_FN=poly.lhs
BIN_FN=`basename -s .c ${SRC_FN}`
curl -s -o ${SRC_FN} http://mauke.ath.cx/stuff/poly.html
cp ${SRC_FN} ${LHS_FN}
runghc ${LHS_FN}
bash ${SRC_FN}
zsh ${SRC_FN}
ksh ${SRC_FN}
tclsh ${SRC_FN}
perl ${SRC_FN}
python ${SRC_FN}
ruby ${SRC_FN}
make -f ${SRC_FN}
gcc -w -o ${BIN_FN} ${SRC_FN} && ./${BIN_FN}
gcc -o ${BIN_FN} ${SRC_FN} -trigraphs && ./${BIN_FN}
g++ -w -o ${BIN_FN} ${SRC_FN} && ./${BIN_FN}
g++ -o ${BIN_FN} ${SRC_FN} -trigraphs && ./${BIN_FN}
rm ${SRC_FN} ${LHS_FN} ${BIN_FN}http://en.wikipedia.org/wiki/C_trigraph
I think I'll stay away from them.
Because almost all encodings that are not somehow compatible with ASCII are obsolete now, trigraphs are obsolete too. But it is certainly interesting thing to know about. And by the way "incompatible with ASCII" means that the characters are there, but look different (¤ vs. $, ¥ vs \, and so on...)
Conveniently, it has a source viewer which will highlight relevant parts of the program's structure for a given language. For instance, the C compiler sees this: http://ideology.com.au/polyglot/c/
http://shinh.skr.jp/dat_dir/fizzbuzz7.gif
It is a valid GIF image file, but also a valid Fizz Buzz program in Ruby, Perl, Befunge, Z80 machine code, and x86 machine code.