This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||
|
The contents of the Gifar page were merged into Polyglot (computing) on 6 March 2023. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
This polyglot doesn't run for me using PHP 5.2.5. Is this a problem with me, or is this polyglot not valid for PHP? PeEll ( talk) 15:36, 8 February 2008 (UTC)
#define a /* #<?php echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ; // (ADDED SEMICOLON AFTER 'world!\n"') // 2> /dev/null; x=a; $x=5; // 2> /dev/null \ ; // (ADDED SEMICOLON AFTER $x=5) if (($x)) // 2> /dev/null; then return 0; // 2> /dev/null; fi #define e ?> #define b */ #include <stdio.h> #define main() int main() #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 #*/
However, this has the misfortunate side-effect of producing this extraneous output in Bash:
\010Hello, world!\n polyglot.sh.php.c: line 5: a=5: command not found —Preceding unsigned comment added by Klassica ( talk • contribs) 07:52, 20 January 2009 (UTC)
The concept of a program which runs in multiple languages is perhaps an academic curiosity.
In the last 5-7 years, the concept of polyglot programming (developing a system using multiple languages) has become increasingly important for professional programmers. Many web-based enterprise systems will have some .Net, Java, or PHP code, some SQL, some Javascript, and some CSS. Some will use F#, Groovy, Scala in conjunction with the more traditional OO languages. I couldn't find a wikipedia article on this concept, but I think one is needed.
References
John Y ( talk) 00:19, 30 March 2012 (UTC)
The current explanation of the polyglot example only highlights some of the elements; what I'd really find useful is an explanation that says "In order to interpret this program in C, the following happens [explanation goes here]. Then, to interpret this program in PHP, the following happens [explanation goes here]." that kind of thing would allow the example to be "viewed" from the perspective of the given language. 2001:420:2840:1250:5955:EF7D:51DA:F509 ( talk) 12:30, 3 November 2016 (UTC)
@ N1amr1: Sorry, I had to revert your edit. There are already too many code samples in this article, see WP:NOTREPOSITORY and WP:CODE. Adding more content to this article would be welcome. -- intgr [talk] 07:51, 26 May 2017 (UTC)
The article references a paper titled "Polyglot Programming". But if you read the paper it is about using multiple programming languages when building a system - "Polyglot programming is the activity of using several programming languages in a software system". It talks about using C# and Javascript together for example.
This is a different definition to the one used in this article. I don't think the reference is appropriate here. I can find lots of examples of polyglot programs on the web, but not anything that actually first defines the term as used here.
Anyone any ideas?
SimonWiseman ( talk) 12:11, 30 March 2018 (UTC)
I propose merging Polyglot markup into this article (but *not* Polyglot persistence, which is a distinct concept that shares a name only by analogy). This article should then be expanded to cover polyglot files generally, with polyglot programs and polyglot markup documents being subtypes. It also needs a section on the security implications of polyglots, which in my view is a much stronger claim to notability than anything currently in the article ( a useful source; and another; and another; and another; possibly this one too). I would also suggest merging Gifar too, which has many issues and would work better as an example in this article rather than an article of its own. Barnards.tar.gz ( talk) 21:37, 21 August 2022 (UTC)
My apologies if im not to clear with this, but I believe having a visual example of a polyglot in computing would help this article quite a bit. I'll have to do some digging for the one in particular, but if anyone is kind enough to make one in an image format that would be simply lovely. thank you. - MountainKemono ( talk) 12:02, 5 December 2022 (UTC)
This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||
|
The contents of the Gifar page were merged into Polyglot (computing) on 6 March 2023. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
This polyglot doesn't run for me using PHP 5.2.5. Is this a problem with me, or is this polyglot not valid for PHP? PeEll ( talk) 15:36, 8 February 2008 (UTC)
#define a /* #<?php echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ; // (ADDED SEMICOLON AFTER 'world!\n"') // 2> /dev/null; x=a; $x=5; // 2> /dev/null \ ; // (ADDED SEMICOLON AFTER $x=5) if (($x)) // 2> /dev/null; then return 0; // 2> /dev/null; fi #define e ?> #define b */ #include <stdio.h> #define main() int main() #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 #*/
However, this has the misfortunate side-effect of producing this extraneous output in Bash:
\010Hello, world!\n polyglot.sh.php.c: line 5: a=5: command not found —Preceding unsigned comment added by Klassica ( talk • contribs) 07:52, 20 January 2009 (UTC)
The concept of a program which runs in multiple languages is perhaps an academic curiosity.
In the last 5-7 years, the concept of polyglot programming (developing a system using multiple languages) has become increasingly important for professional programmers. Many web-based enterprise systems will have some .Net, Java, or PHP code, some SQL, some Javascript, and some CSS. Some will use F#, Groovy, Scala in conjunction with the more traditional OO languages. I couldn't find a wikipedia article on this concept, but I think one is needed.
References
John Y ( talk) 00:19, 30 March 2012 (UTC)
The current explanation of the polyglot example only highlights some of the elements; what I'd really find useful is an explanation that says "In order to interpret this program in C, the following happens [explanation goes here]. Then, to interpret this program in PHP, the following happens [explanation goes here]." that kind of thing would allow the example to be "viewed" from the perspective of the given language. 2001:420:2840:1250:5955:EF7D:51DA:F509 ( talk) 12:30, 3 November 2016 (UTC)
@ N1amr1: Sorry, I had to revert your edit. There are already too many code samples in this article, see WP:NOTREPOSITORY and WP:CODE. Adding more content to this article would be welcome. -- intgr [talk] 07:51, 26 May 2017 (UTC)
The article references a paper titled "Polyglot Programming". But if you read the paper it is about using multiple programming languages when building a system - "Polyglot programming is the activity of using several programming languages in a software system". It talks about using C# and Javascript together for example.
This is a different definition to the one used in this article. I don't think the reference is appropriate here. I can find lots of examples of polyglot programs on the web, but not anything that actually first defines the term as used here.
Anyone any ideas?
SimonWiseman ( talk) 12:11, 30 March 2018 (UTC)
I propose merging Polyglot markup into this article (but *not* Polyglot persistence, which is a distinct concept that shares a name only by analogy). This article should then be expanded to cover polyglot files generally, with polyglot programs and polyglot markup documents being subtypes. It also needs a section on the security implications of polyglots, which in my view is a much stronger claim to notability than anything currently in the article ( a useful source; and another; and another; and another; possibly this one too). I would also suggest merging Gifar too, which has many issues and would work better as an example in this article rather than an article of its own. Barnards.tar.gz ( talk) 21:37, 21 August 2022 (UTC)
My apologies if im not to clear with this, but I believe having a visual example of a polyglot in computing would help this article quite a bit. I'll have to do some digging for the one in particular, but if anyone is kind enough to make one in an image format that would be simply lovely. thank you. - MountainKemono ( talk) 12:02, 5 December 2022 (UTC)