ShapeScript + CJam + GolfScript, 96 95 62 bytes
'"%r"@%"0?!"'0?!
This is the standard ShapeScript quine. Try it online!
CJam, 46 bytes
];{"'\"%r\"@%\"0?!\"'0?!];"SS#~(>
\"0$~"N}0$~
The last byte is a linefeed. Try it online!
GolfScript, 62 bytes
'"%r"@%"0?!"'0?!];{"'\"%r\"@%\"0?!\"'0?!];"SS#~(>
\"0$~"N}0$~
The last byte is a linefeed. Try it online on Web GolfScript.
Verification
$ wc -c P Q
16 P
46 Q
62 total
$ cat P Q > P+Q
$
$ shapescript P 2>&- | diff -qs - P
Files - and P are identical
$ cjam P 2>&- | diff -qs - P
Files - and P differ
$ golfscript P 2>&- | diff -qs - P
Files - and P differ
$
$ cjam Q 2>&- | diff -qs - Q
Files - and Q are identical
$ golfscript Q 2>&- | diff -qs - Q
Files - and Q differ
$ shapescript Q 2>&- | diff -qs - Q
Files - and Q differ
$
$ golfscript P+Q 2>&- | diff -qs - P+Q
Files - and P+Q are identical
$ shapescript P+Q 2>&- | diff -qs - P+Q
Files - and P+Q differ
$ cjam P+Q 2>&- | diff -qs - P+Q
Files - and P+Q differ
How it works
ShapeScript
' Push a string that, when evaluated, does the following.
"%r" Push this formatting string. %r gets replaced by a string
representation of the corresponding argument.
@ Swap the string that is being evaluated on top of the stack.
% Apply formatting to the string on top of the stack.
"0?!" Push that string.
'
0?! Push a copy of the previous string and evaluate it.
CJam
]; e# Clear the stack. Stack is already clear. Does nothing.
{ e# Push the following code block:
"'\"%r\"@%\"0?!\"'0?!];"
SS# e# Find the index of " " in " ". Pushes 0.
~( e# Apply logical NOT and decrement. Pushes -2.
> e# Discard all but the two rightmost characters from the string,
e# i.e., reduce it to "];".
\ e# Swap the string "];" with the code block in execution.
"0$~" e# Push that string.
N e# Push a linefeed.
} e#
0$~ e# Push a copy of the code block and execute it.
GolfScript
'"%r"@%"0?!"'
0?! # Find the index of the number 0 in the string and apply logical NOT.
]; # Clear the stack.
{ # Push the following code block:
"'\"%r\"@%\"0?!\"'0?!];"
SS # Undefined token. Does nothing.
#~(> # Comment.
\ # Swap the string with the code block in execution.
"0$~" # Push that string.
N # Undefined token. Does nothing.
} #
0$~ # Push a copy of the code block and execute it.
2Rules on comments? – Addison Crump – 2015-11-07T18:25:47.083
That's something that I didn't think of before. I'm inclined to let them slide because then you have to worry about printing that out AND having to make sure language C has the same comment syntax or something but I'm flexible. – Faraz Masroor – 2015-11-07T18:26:55.727
Does "not a quine" mean "do anything" or "at least run"? – LegionMammal978 – 2015-11-07T18:58:09.900
1When put into a compiler it doesn't output its source code. It can run or throw an error or not compile or output something else or nothing, but as long as it doesn't output its source code. – Faraz Masroor – 2015-11-07T19:02:40.930
Quine challenge inspiration, for anyone interested: "Print all those programs in <language>, and those only, which do not print themselves."
– ETHproductions – 2015-11-07T19:23:07.340@ETHproductions what if we used "Print all those programs in <language>, and those only, which do not exclusively print themselves." That would avoid Russell's paradox. Though I suppose it would still run into problems with the Halting Problem, depending on your choice of language. – SuperJedi224 – 2015-11-07T21:19:38.543
The program's don't have to even be valid in the other languages, as long as they're quines in the correct labguage! – Faraz Masroor – 2015-11-07T21:27:58.287
Even after reading the meta discussion you linked to, I am unsure what exactly is acceptable as quine. For example, would using SMBF (which starts with its source code in the data array) be acceptable?
– Dennis – 2015-11-08T04:34:09.327@Dennis let's let the community decide with votes. – Faraz Masroor – 2015-11-08T04:56:24.803
I'd rather have a final decision before I post my answer. There's no point in writing it up if it'll just get downvoted. (I am sitting on a 29-byte solution using SMBF.) – Dennis – 2015-11-08T05:01:07.423
@Dennis well I'm not really the guy to make a decision like this but I would love to see what you have. – Faraz Masroor – 2015-11-08T05:06:37.630