Polyglot (computing) Polyglot (computing) 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. Polyglot markup is similar, but about markup language context. Polyglot persistence is similar, but about databases. The two most commonly used techniques for constructing a polyglot program are to make liberal use of languages
Polyglot markup For example, in order for an HTML5 document to meet these criteria, the two requirements are that it must have an HTML5 doctype, and be written in well-formed XHTML. The same document can then be served as either HTML or XHTML, depending on browser support and MIME type. As expressed by the "html-polyglot recommendation", to write a polyglot HTML5 document, the following key points should be observed: The most basic possible polyglot markup document would therefore look like this: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> </html> In a polyglot markup document non-void elements (such as codice_1, codice_2, codice_3) cannot be