As the title says, you are to create a pristine program in as many languages as possible. A pristine program, taken from here, is:
Let's define a pristine program as a program that does not have any errors itself but will error if you modify it by removing any contiguous substring of \$N\$ characters, where \$1 \le N < \text{program length}\$.
For example, the three character Python 2 program
`8`
is a pristine program (thanks, Sp) because all the programs resulting from removing substrings of length 1 cause errors (syntax errors in fact, but any type of error will do):
8` `` `8
and also all the programs resulting from removing substrings of length 2 cause errors:
` `
If, for example,
`8
had been a non-erroring program then`8`
would not be pristine because all the results of substring removal must error.
You are to write, in as many languages as possible, a pristine program.
Your program must produce a non-empty output when unaltered.
This output can be anything you like, can vary depending on different inputs, or anything else, so long as, when run, unaltered and with no/empty input, it produces a non-empty output (note that
0
, or your language's null value is non-empty).The output may not be to STDERR (or your language's equivalent), as this would fall under the definition of an "erroring program" below.
The output does not have to consistent across languages, or when executed twice in the same language.
Your code must work in a minimum of two distinct languages and must be at least 2 bytes long
Different versions of a language do not count as different languages. Therefore, Python 2 and Python 3 are considered the same language.
Your program must be pristine in all languages used
An error is defined as anything that causes the program to either entirely fail to run or to terminate with a nonzero exit code after a finite amount of time.
This is rosetta-stone, so the answer with the most languages wins
- In case of a tie breaker, the longest solution, in bytes, wins
I would also be interested in proofs of impossibility for certain pairs/groups of languages. If you find a particularly interesting proof, please leave it in the comments (or, preferably, a link to the full write up), and I'll invite you to post as an answer so I can award it a bounty if I agree that its especially interesting. Please do not post these proofs unless I have said I will award it a bounty, I don't want all the answers to be filled by such proofs and actual answers be buried. Proofs posted without me asking you to will not be considered valid