
[French polyglotte, from Greek poluglōttos : polu-, poly- + glōtta, tongue, language.]
polyglotism pol'y·glot'ism or pol'y·glot'tism n.
The ambassador was a polyglot and an expert on foreign affairs.
LearnThatWord.com is a free vocabulary and spelling program where you only pay for results!

|
|
This article has multiple issues. Please help improve it or discuss these issues on the talk page.
|
In 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 independent 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 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 with syntax quirks. These are demonstrated in this public domain polyglot written in ANSI C, PHP and bash:
#define a /*
#<?php
echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ;
// 2> /dev/null; x=a;
$x=5; // 2> /dev/null \ ;
if (($x))
// 2> /dev/null; then
return 0;
// 2> /dev/null; fi
#define e ?>
#define b */
#include <stdio.h>
#define main() int main(void)
#define printf printf(
#define true )
#define function
function main()
{
printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/;
return 0;
}
#define c /*
main
#*/
Note the following:
Some less-common languages also offer possibilities to create Polyglot code. Here is a small sample, written simultaneously in SNOBOL4, Win32Forth, PureBasicv4.x, and REBOL:
*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 !
The term is sometimes applied to programs that are valid in more than one language, but do not strictly perform the same function in each. One use for this form is a file that runs as a DOS batch file, then re-runs itself in Perl:
@rem = ' --PERL-- @echo off perl "%~dpnx0" %* goto endofperl @rem '; #!perl print "Hello, world!\n"; __END__ :endofperl
This allows creating Perl scripts that can be run on DOS systems with minimal effort.
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
Dansk (Danish)
adj. - mangesproget
n. - mangesproget person
Nederlands (Dutch)
meertalig, polyglottisch, iemand die veel talen spreekt, polyglot
Français (French)
adj. - polyglotte
n. - polyglotte
Deutsch (German)
n. - Polyglotte
adj. - mehrsprachig, polyglott
Ελληνική (Greek)
n., -
adj. - πολύγλωσσος
Português (Portuguese)
n., -
adj. - poliglota
Русский (Russian)
полиглот, многоязычие
Español (Spanish)
adj. - polígloto, políglota
n. - polígloto
Svenska (Swedish)
n. - polyglot, flerspråkig person
adj. - mångspråkig, skriven på (sammansatt av) flera språk
中文(简体)(Chinese (Simplified))
通晓数种语言的, 数种语言书写的, 精通数国语言的人, 数种文字的对照本
中文(繁體)(Chinese (Traditional))
adj. - 通曉數種語言的, 數種語言書寫的
n. - 精通數國語言的人, 數種文字的對照本
한국어 (Korean)
adj. - 수개 국어에 통하는, 수개 국어의
n. - 수개 국어에 통하는 사람, 수개 국어로 쓴 책
日本語 (Japanese)
adj. - 数か国語で書いた, 数か国語対訳の
n. - 数か国語に通じた人, 数か国語対訳書, 数か国語の混合
العربيه (Arabic)
(الاسم) من يتقن عدة لغات (صفه) كثير اللغات, متكلم او كاتب بعدة لغات
עברית (Hebrew)
adj. - רב-לשוני, כתוב בהרבה שפות, של (אדם) השולט בשפות רבות
n. - ספר הכתוב בשפות רבות, אדם הבקי בשפות רבות
If you are unable to view some languages clearly, click here.