If the author of a program that outputs its own source code (quine) makes it open source, can others just distribute it as binaries?
Does it matter which popular open source license he used, say GPL vs MIT?
Open Source Stack Exchange is a question and answer site for people organizing, marketing or licensing open source development projects. It only takes a minute to sign up.Sign up to join this community
This is categorically fine under the MIT license (as long as you follow basic attribution and license-preservation requirements), since the MIT license allows you to distribute the work (and modified forms) in binary-only format if you wish. If the binary happens also to produce source code, that's fine too, but it doesn't have to do so.
For the GPL, this is probably not allowed. The binary does produce the source code when you run it, so at first glance it appears to satisfy the GPL's requirement to accompany the binary with corresponding source code. However, the ability to see the source code is contingent upon the ability to run the binary, which is a requirement that the GPL does not allow you to impose. This is a nontrivial imposition, too, since one prominent benefit of having source code is the ability to port or recompile a program to run on a new platform. In the case of quine-provided source code, users would not be able to do this unless they first had access to the binary's original platform.
Admittedly, the ability to read the source code in any digital media format requires the execution of some executable -- you must run an operating system of some kind to read a USB drive or download source code from a network server -- but specifically requiring execution of the exact binary file whose source code you want to read seems substantially different and less easy to satisfy.
Just for the sake of completeness, the requirements listed @aspillers's answer do not apply to the copyright owner. So if you are the sole author of the work, you can decide to license it to others under GPL while only distributing the source code. Normally this wouldn't make sense because to be able to convey it further, recipients need to distribute the source code as well (which they wouldn't be able to do if you didn't give it to them, in the case of a normal software). For this peculiar example, they should execute the program, get the source, and make sure that they distribute it with the binary (or provide a written offer to get it).
This is bad. If someone wants to read source code, he would have to run the binary on his machine first. Much of the meaning of open source and free software is to being able read the code before you run it. And the reader of the code would also need to compile the code output after first running that program and then comparing the binaries to make sure that its really the source code of the program. But once you have different compiler version or platform, you are not able to prove that it really is the source code... Pretty bad.