7
Write a polyglot (code that works in two or more languages) that has a "mid-section" that can be modified to do any computational task. This question is similar to https://stackoverflow.com/questions/1053931/code-golf-shortest-turing-complete-interpreter.
Rules:
The program must be able to preform a computation and print the results. Pseudorandom number capability is a plus but not necessary. The results must be the same in all languages, minor string-formatting differences are OK.
There is a section in the program that can be modified (in a straight-forward way) to do any computation (Turing complete). This is like the "comments section" in http://ideology.com.au/polyglot/polyglot.txt for which any comment can be inserted.
You must use at least 2 languages (this rule is here so you don't sue me).
Edit: Ideally you only need to write the "computation" part once. It is less interesting to use comment blocks, etc to knock out A so you have a block from B and then knockout B to write code from A. However, the one block solution is very difficult unless the languages have enough "overlap".
Also, using very similar languages (like C# and Java) isn't as interesting. It is still allowed but will probably earn less votes.
Grading
The winning is a popularity contest (Mar 1st).
2What's your winning criterion? – TheDoctor – 2014-02-24T01:02:34.960
1Just made it a popularity contest, easy to do. – Kevin Kostlan – 2014-02-24T01:05:43.740
3Why the 2 languages rule and how different do they have to be? Can we use C, C++, C# (and possibly Java)? (Would that be 4 languages?) ..... Ok as it's a popularity contest I guess the mob could decide that one, but I will make the point anyway. – Level River St – 2014-02-24T05:46:13.947
1Do python 2 and python 3 count as different languages? – TheDoctor – 2014-02-24T16:32:55.970