Poliglot code
Name:
Anonymous
2010-03-13 10:22
This is exactly how any good HelloWorld should look, folks:
*BUFFER : A.A ; .( Hello, world !) @ To Including?
Macro SkipThis; OUTPUT = Char(10) "Hello, World !"
;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char
End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3
EndMacro: OpenConsole() : PrintN("Hello, world !")
Repeat : Until Inkey() : Macro SomeDummyMacroHere
REBOL [ Title: "'Hello, World !' in 4 languages"
CopyLeft: "Developed in 2010 by Society" ] Print
"Hello, world !" EndMacro: func [][] set-modes
system/ports/input [binary: true] Input set-modes
system/ports/input [binary: false] NOP:: EndMacro
; Wishing to refine it with new language ? Go on !
...4 languages simultaneously, who want to compete ?
Name:
Anonymous
2010-03-13 10:23
VALID C++ ENTERPRISE CODE
Name:
Anonymous
2010-03-13 10:54
bf $(bf-create --optimise 4 --output 'Hello, world!')
Name:
Anonymous
2010-03-13 11:01
This is exactly how any good Hello World should look, folks:
#include <stdio.h>
// C + C++ = <3
int main(int argc,char **argv){
printf("'Hello, World !' in 2 languages");
}
... 2 languages simultaneously, who want to compete?
Name:
Anonymous
2010-03-13 11:05
2 languages simultaneously, who want to compete?
No D support ? Epic phail.
Name:
Anonymous
2010-03-13 11:39
>>5
Epic phail.
Back to
fuck I've been doing this for too long.
Name:
Anonymous
2010-03-13 11:56
print "Hello, world!"
Name:
Anonymous
2010-03-13 12:03
Name:
Anonymous
2010-03-13 12:06
>>7
print "Hello, world !"
^^^^^^^
Error(-13): "HELLO, is undefined
:(
Name:
Anonymous
2010-03-13 12:27
(__)_) <--- Ass
m-'.'-m <--- Moses
Name:
Anonymous
2010-03-13 12:59
...4 languages simultaneously, who want to compete ?
15 langs:
# /* [ <!-- */ include <stdio.h> /* \
#{\
`""""true \\#{"\n#"}; \
\
if [ -n "$ZSH_VERSION" ]; then \
\
echo exec echo I\'m a zsh script.; \
\
elif [ -n "$BASH_VERSION" ]; then \
\
echo exec echo I\'m a bash script.; \
else \
echo exec echo I\'m a sh script.; \
fi`; #\
BEGIN{print"I'm a ", 0 ? "Ruby" :"Perl", " program.\n"; exit; }
#\
%q~
set dummy =0; puts [list "I'm" "a" "tcl" "script."]; exit
all: ; @echo "I'm a Makefile." \
#*/
/*: */ enum {a, b}; \
\
static int c99(void) {
#ifndef __cplusplus /* bah */
unused1: if ((enum {b, a})0) \
(void)0;
#endif
unused2: return a; \
} \
static int trigraphs(void) { \
\
return sizeof "??!" == 2; \
} \
char X; \
\
int main(void) { \
\
struct X { \
\
char a[2]; \
};\
if (sizeof(X) != 1) { \
\
printf("I'm a C++ program (trigraphs %sabled).\n", \
\
trigraphs() ? "en" : "dis");\
\
}else if (1//**/2
)unused3 : { ; \
printf("I'm a C program (C%s, trigraphs %sabled).\n", \
c99() ? "89 with // comments" : "99", \
trigraphs() ? "en" : "dis"); \
} else { \
printf("I'm a C program (C89, trigraphs %sabled).\n", \
trigraphs() ? "en" : "dis"); \
} \
return 0; \
} /*
# \
main :: IO () -- -- \
main = putStr "I'm a Literate Haskell program.\n"
# \
]>++++++++[<+++++++++>-]<+.>>++++[<++++++++++>-]<-.[-]>++++++++++ \
[<+++++++++++>-]<-.>>++++[<++++++++>-]<.>>++++++++++[<++++++++++> \
-]<- - -.<.>+.->>++++++++++[<+++++++++++>-]<++++.<.>>>++++++++++[ \
<++++++++++>-]<+++++.<<<<+.->>>>- - -.<+++.- - -<++.- ->>>>>+++++ \
+++++[<+++++++++++>-]<- - -.<<<<<.<+++.>>>.<<<-.- ->>>>+.<.<.<<.> \
++++++++++++++.[-]++++++++++"""`
# \
print "I'm a Python program."; """[-][--><html><head>
<!--:--><title>I'm a HTML page</title></head><body>
<!--:--><h1>I'm a <marquee><blink>horrible HTML</blink></marquee> page</h1>
<!--:--><script language="JavaScript">
<!--: # \
setTimeout( // \
function () { // \
document.body.innerHTML = "<h1>I'm a javascript-generated HTML page</h1>"; // \
}, 10000); // \
//-->
</script><!--: \
</body></html><!-- } # \
say "I'm a Perl6 program", try { " ($?PUGS_VERSION)" } // "", "."; # """ # */
#define FOO ]-->~
Name:
Anonymous
2010-03-13 13:01
>>11
Oh hi mauke. I didn't know it was you.
You're my favorite Haskell programmer.
Name:
Anonymous
2010-03-13 13:02
>>1
adding some bf in your code is possble too, btw. and whitespace.
Name:
Anonymous
2010-03-13 16:20
Yawn. I'll be impressed when I start seeing polyglot quines.
Name:
Anonymous
2010-03-13 18:18
Name:
Anonymous
2010-03-13 18:27
>>15
In which languages is that a quine?
Name:
Anonymous
2010-03-13 18:53
Name:
Anonymous
2010-03-13 18:55
Name:
Anonymous
2010-03-13 19:16
>>17
I only count one "language" there.
>>18
That is admittedly pretty friggin' neat.
Newer Posts