Also a term for an extremely unique form of Programming hack. A polyglot program is one which is simultaneously valid in multiple programming languages-- and, preferably, does the same thing in each of them.

If you don't quite get what i mean by that, go look at some polyglot programs and you'll understand-- see http://www.nyx.net/~gthompso/poly/polyglot.htm, or the very impressive Multilingual "Hello World" program here on e2.

Polyglots are pure, hardcore Programming as Art; there is absolutely no concievable way that a Polyglot could be useful.

While as of this writing the techniques are not very mature-- only a handful of Polyglots have ever been written-- almost all Polyglots are based completely off of finding operators which have real significance in one language, but are used for source comment indicators in the other. The most popular Polyglot trick is to write a program in a scripting language such as sh or perl, then (taking advantage of the fact almost all scripting languages use # as a comment indicator) #define all of the scripting language's keywords into expressions valid in C. There are some slightly more elegant tricks available, though; for example, exploiting the duality of the ; operator as end-of-statement operator in C and comment indicator in LISP.

My favorite Polyglot i have seen thus far is the polyglot quine (!) at the above url written in LISP and C.

Pol"y*glot (?), a. [Gr. manytongued; many + , , tongue, language: cf. F. polyglotte.]

1.

Containing, or made up, of, several languages; as, a polyglot lexicon, Bible.

2.

Versed in, or speaking, many languages.

 

© Webster 1913.


Pol"y*glot, n.

1.

One who speaks several languages.

[R.] "A polyglot, or good linguist."

Howell.

2.

A book containing several versions of the same text, or containing the same subject matter in several languages; esp., the Scriptures in several languages.

Enriched by the publication of polyglots. Abp. Newcome.

 

© Webster 1913.

Log in or registerto write something here or to contact authors.