The Polyglot List


Polyglot. \Poly*glotí\ a. [Gr. manytongued; many + tongue, language: cf. F.polyglotte.]
     1. Containing, or made up, of, several languages; as, a polyglot.

Well, I think it was inevitable. From the compiler of the Quine Page, here is a collection of polyglots (programs which can be compiled in more than one language). Okay, so there aren't many, but have you ever tried to write one?


The Programs


Author: Micah Cochran
Languages: C, Perl
What it does: prints "Hello World"

micah.txt
 

Author: Maarten Litmaath (maart@cs.nu.vl)
Languages: C, Pascal, Fortran, sh
What it does: prints "Hello World"

maarten.txt
 

Author: Maarten Litmaath (maart@cs.nu.vl)
Languages: C, Fortran, sh
What it does: prints "Hello World"

maarten2.txt
 

Author: Tom Dawes-Gamble
Languages: C, Cobol
What it does: prints "Hello World"

tdg2.txt
 

Author: Jack Applin
Languages: C, Fortran, sh
Note: IOCCC 1986 winner.
What it does: prints "Hello World"

applin.txt

Authors: Kevin Bungard, Peter Lisle and Chris Tham
Languages: COBOL, Pascal, Fortran, C, Postscript, sh, 8086 asm,
Note: Do not remove leading blank lines
What it does: prints "Hello Polyglot"

polyglot.txt
 

Authors: Tom Dawes-Gamble
Languages: C, Cobol
What it does: tells you if it was compiled in C by finding an "error"

tdg.txt
 

Author: Ishai Ben-Aroya <ishai@techunix.technion.ac.il>
Languages: ANSI C and Turbo Pascal.
Notes: Pascal code has not been verified
What it does: It's a quine

ishai.txt
 

Author: Joe Miller
Languages: C and tcl
What it does: quine

miller.txt
 

Author: Joe Miller
Languages: C and Lisp
Notes: (from the author) The Lisp sucks. It consists almost entirely of destructive variable assignments and sequences of statements. Oh well. For reasons I do not want to discuss, the first line is blank.
What it does: another quine

miller2.txt
 

Author: Bertram Felgenhauer
Languages: C and dc
What it does: quine

 bertram1.txt
 

Author: Bertram Felgenhauer
Languages: C, dc, and BrainF***
What it does: quine

bertram2.txt

Author: njharve@waterloo.ca
Languages: C and vi (VIM 4.0)
What it does: yet another quine
Note: You need to set the following:

set noai
set wm=0
set nosi
set tw=0
set nogdefault
 

self_c_vi.txt
 

Author: Philippe "BooK" Bruhat
Langage: Perl and C
Notes: Depending on your hardware (little or big endian), you might
   need to change an integer value in the code (see SOLUTION file)
What it does : it's a clone of the well-known wc program, except
   that its performances are several orders of magnitude worse
   (mainly because the files are read one byte at a time...)

BRUHAT.4.1.tar.gz
 
 



Links

All my links are on The Quine Page
 
 



Gary P. Thompson II gthompso@nyx.net