Polyglot (computing)

Polyglot (computing)

In the context of computing, a polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independently of the programming language used to compile or interpret it.

Generally polyglots are written in a combination of C (which allows redefinition of tokens with a preprocessor) and a scripting programming language such as Lisp, Perl or sh.

The two most commonly used techniques for constructing a polyglot program are to make liberal use of languages which use different characters for comments and to redefine various tokens as others in different languages. Often good use is made of quirks of syntax. These are demonstrated in this public domain polyglot written in ANSI C, PHP and bash:

#define a /* #

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Polyglot — may refer to:*Multilingualism, a single speaker who uses two or more languages, or a community of speakers where two or more languages are used *Hyperpolyglot, one who can speak six or more languages fluently *Polyglot (book), a book that… …   Wikipedia

  • Quine (computing) — A quine s output is exactly the same as its source code A quine is a computer program which takes no input and produces a copy of its own source code as its only output. The standard terms for these programs in the computability theory and… …   Wikipedia

  • Multilingualism — Bilingual redirects here. For the journal, see Bilingualism (journal). For other uses, see Bilingual (disambiguation). For multilingualism in Wikipedia, see Wikipedia:Multilingual coordination Multilingualism is the act of using, or promoting the …   Wikipedia

  • Kilmarnock — For other uses, see Kilmarnock (disambiguation). Coordinates: 55°36′40″N 4°29′45″W / 55.61106°N 4.49571°W / 55.61106; 4.495 …   Wikipedia

  • Adrian Mole — Adrian Albert Mole (born April 2, 1967) is the fictional protagonist in a series of books by English author Sue Townsend. The character first appeared (as Nigel Mole) in a BBC Radio 4 play in 1982. The books are written in the form of a diary,… …   Wikipedia

  • List of child prodigies — This is a list of people who in childhood (at or before 13) showed exceptional abilities in a specific field comparable to those of a highly skilled adult; hence the term child prodigy. Names added should fit this criterion and be properly… …   Wikipedia

  • Robert College — Infobox Private School name = Robert College motto = Post Tenebras Lux (Light After Darkness) Dominus Illuminatio Mea (The Lord is my Light) established = 1863 type = Independent, Boarding head name = Headmaster head = John R. Chandler city =… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”