Okay, so this is gonna be a bit of a long post, hope nobody minds.
I am 99 percent sure this would have a massive effect on the Zig ecosystem in a negative way. Also, relicensing the Zig project and the Stdlib requires approval from all contributors, particularly if a CLA does not exist, from my understanding. The CLA is what makes it easier to relicense.
What would make this completely infeasible is copyright exemptions. Keep in mind, this is my understanding of the law, so I may be wrong. But… The standard library, by definition, does not receive copyright protection and is thus in the public domain, at least within the United States, for two reasons:
- 17 U.S.C. 102(b) provides that “[I]n no case does copyright protection for an original work of authorship extend to any idea, procedure, process, system, method of operation, concept, principle, or discovery, regardless of the form in which it is described, explained, illustrated, or embodied in such work.” The standard library, being necessary to even use or write programs in Zig, would fall under this clause, as you cannot write Zig programs without it. One could, I suppose, make the argument that you could write your own standard library, but this would, I am very sure, be an undue burden on anybody. This exemption is known as the idea/expression dichotomy: because the standard library (and, by extension, the run-time library) is, by definition, a concrete implementation of a language specification – even if no such specification is formally defined – the ways of implementing that standard library are not actually variable by any means, so the ways one can express an implementation are minimal at best. This is especially relevant when you factor in compatibility when another implementation wants to come along: it must be compatible with the main implementation of Zig, which may also include bug-for-bug compatibility. So, the ways that that implementation can express it’s standard library implementation are even further reduced. That isn’t so much of a problem here, but if Zig ever gets big enough that someone wants to make a competing implementation, this will become a problem.
- The merger doctrine also comes into play. When there are only a few ways of implementing something, the expression merges with the idea. So, even if there is some creative choice involved, the limited number of alternatives for the implementation will limit any copyright protection that could possibly be received.
I think that fair use may also come into play, as well, but obviously I don’t know for certain, and fair use is something that is more-or-less evaluated on a case-by-case basis even if it does have baseline guidelines.
Mind you, I’m not a lawyer, so all of this could be completely wrong. But this is my understanding from my research on this particular subject. This is before we consider the Oracle V. Google ruling as well. So all of this combined means that the Zig standard and run-time libraries, legally at least, do not receive copyright protection. Zig on the other hand (that is, the Zig compiler) is different and receives full protection unless otherwise waved. (As an aside, I question whether the GPL/AGPL/LGPL would even be enforceable when it comes to programs written with Zig, even if my above two points are completely wrong, because Zig is, when you get down to the nuts and bolts of things, a code generator, and I very much doubt any court would ever enforce the GPL in a manner so as to require that anything generated with the tool via automated processes would also need to be GPL licensed. Because if a court did that, that would practically destroy the entire computing industry.)
As for the license choice? Yeah, no, let’s not, please? If we’re going to do any kind of copyleft license – which I am very strongly opposed to because the language someone writes code in should NOT dictate how they license their software, regardless of the feelings of the developers/makers of the language – we should go for the MPL, at most, primarily because that license would at least be limited to those files to which it is applied, and wouldn’t have a viral affect that could radiate outward beyond Zig if a court did rule in the wrong direction (assuming the enforceability of the license ever gets challenged).