Zig under AGPL?

It’s not so simple unfortunately, modern game code bases have dozens of commercial thirdparty middleware libraries in them, all closed source and under restricitive license (e.g. half the code for the game might be owned by somebody else). Game console APIs are also under NDA.

Isolating and removing those parts from a source distribution is often not a realistic option.

8 Likes

I once went to an RMS talk on GPL and software freedom (I was young, it was a phase). In the Q&A I asked “What about publishers of console games like from Sony and Nintendo, surely they cannot work with copyleft code?”.

He said, “GNU/Linux has many console games, next question!”

I was not convinced the issues were being well understood :grinning:

13 Likes

I think that would have been a good answer if there had been any kind of serious GPL gamedev push. Then you get to be boastful about it. My main problem with the free software movement is that it seems that at some point it forgot how to actually gain ground for real and never realized that at some point they couldn’t really afford to talk about stuff like they maybe could before.

I still remember that “state of the free stoftware” talk that RMS was supposed to give as a livestream, which then had to be turned into an audio only thing because they couldn’t make the foss livestream thing to work. Getting your message out is more important than not using Zoom or whatever.

5 Likes

So don’t give either the object or source code to anyone until you confirm all the buyers, and only after that, give the both kinds of code to everyone in one go! :slight_smile: Basically selling not to individuals but to the community as a whole.

That’s sort of what the Blender Foundation did when it bought the code for Blender from NaN - they had a public fundraiser to buy it from NaN and share it as open source.

Seems like a GPL-like license makes sense when you plan to make your money off of support/maintenance.

1 Like

I apologize upfront, but when I love something, I take it personally. I am from Poland, and I will answer in a Polish way, meaning I will simply say what I think without covering my real intentions in 20 layers of wool and pudding.

To me, any copy-left license ideas are simply a crime against humanity. The very idea comes from a deep misunderstanding of life and human nature. Even considering restricting an entire language to such stupid and harmful ideas should be seen as ridiculous and unthinkable. One thing is opening something you create to the public for anyone to enjoy, like Public Domain or similar concepts, which is noble, generous, and something I admire. But forcing everyone into a narrow, high-school-level, communist version of “freedom” is something entirely different. People like Richard Stallman are simply sad, angry trolls who have polluted open source forever. I am sure that if Linux had started as Public Domain, we would have at least three competitive Windows-like desktop OSes for $20 a license. Instead, we have 2000 distros endlessly reinventing the wheel, pointless infighting, and a mess where every module and bash command behaves differently.

I love Zig and intend to use it commercially while also supporting the Zig Foundation and giving back to the community. But excluding commercial forces is simply suicide.

And one more slightly off-topic thought: what I love about Zig is that Andrew is in charge, BDFL-style (Benevolent Dictator for Life). I am sure many don’t realize how important this is. This is exactly why Linux failed on the desktop while Windows and macOS succeeded. They have a clear goal: to make software good enough that people actually want to use it. In Linux, with its hundreds of components, everyone has their own twist on how things should work, and in the end, nothing really works properly without extra effort. I tried being a Linux-only artist for seven years, but when configuring a Wacom tablet required 1000 lines of config adjustments, I finally gave up. Rust will ultimately fail for the same reason, too many people in charge, too many agendas.

There should be one vision, concentrated effort, and the freedom to express our love for Zig. And from that abundance, we can and should share and support the community beyond our own projects. But never by force.

13 Likes

While the BSD license isn’t Public Domain, but following your logic, the flavours of the BSD operating system should have become such competitive Windows-like desktop OSes you talk about. They even were in a better shape than GNU/Linux in the very beginning. Yet, the latter winned over *BSD. Why? Do you think it was because of some technical reasons like wrong codebase architecture or something like that? I don’t think so. Linux won because people preferred to share their code in the place they would get a bigger share-back code return later. Did the times change forever and people become more interested in receiving money than in receiving back the code? ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯. Whatever.

5 Likes

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:

  1. 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.
  2. 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).

2 Likes

Not true: The MIT license allows for re-licensing the project, without needing to get any sort of approval from contributors. In fact, the MIT license is usually chosen explicitly because of this reason: it allows companies to include your software within proprietary software, and effectively “re-license it” under their proprietary licenses. This same reasoning means that the Zig compiler & stdlib could be easily re-licensed to LGPL.

Usually, CLAs are needed if the project’s license would normally restrict re-licensing in some way, such as how the GPL license family require that the code remain GPL, or at least preserves the Freedoms is promises.

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:

Not quite true. The Standard Library itself does have copyright protection. It’s the interface, the API, that does not have copyright protection. Not the implementation.

as you cannot write Zig programs without it.

You definitely can write Zig programs without the standard library.

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

It’s at this point that I’m starting to wonder if this post was generated by an AI confidently spewing blatantly incorrect facts.

1 Like

No, none of that was AI generated. This is just my understanding of things. As I said, I’m not a lawyer, so I very well could be wrong on all of that, and I do appreciate corrections.
Edits to add:
I would appreciate it if you could provide sources or further explain yourself with respect to the final quotation you made, or even to the rest of your remarks. As I said, I am no OSS lawyer, I’m just stating how I understand the way of things (and, admittedly, from the view of US law).

Not sure about the value of this argument tbh. BDFL didn’t change the license when the zen-lang fork drama happened, and he probably will not change it now.

Besides if Zig does go AGPL, I predict at least half of the serious users of the language to drop it.

It probably has the best license for actual business use.

2 Likes

Yeah, you are probably right about it. I guess my strong bias agains copy-left pushed me a bit too far into fantasy land :wink: Perhaps copy-left do reflect some segment of society and can propel people towards creativity.

Even for strong GPL supporters, there are some considerations about choosing a license. Even FSF provides a guide, which does NOT brainless suggest you to use AGPL on everything. See here: https://www.gnu.org/licenses/license-recommendations.html

So after reading the article above, you will probably have an idea about why most programming languages and their compilers/implementations do not use GPL or AGPL. Even if they are under GPL, they need an exemption, such as GCC.

A programming language is a tool to create all kinds of computer programs including which are mentioned in the article above.

Can zig write a small program? Yes. Then FSF recommends permissive license, such as Apache.

Can zig write a decoder which decodes a free format such as webm, and the decoder can be included in a player device? Yes. Then FSF recommends permissive license, such as Apache.

Can zig write a library that already have non-free or permissive competitors, such as JS implementations (like bun), game engines? Yes. Then FSF recommends permissive license, such as LGPL.

You see? a programming language is used to write all kinds of software. Some kinds of those software are better under a permissive license. Even FSF recommends about that. So a programming language itself usually cannot be under a strong copyleft license. Many programming languages are published in ISO, so everyone can implement it correctly. For programming language implementations or compilers, they can be under GPL, but they have to have an exemption, such as GCC. If an implementation is under pure GPL with no exemption, people will use the a non-free implementation with permission, and some of them are even free of charge. This will only harm free (as in freedom) software.

1 Like

Bad luck. The BSD code was subject to some fairly intense lawsuits right around when Linux became popular, and never caught up. So it has approximately nothing to do with the licenses involved.

Or, if you prefer: what are you talking about?! BSD has a 10% share of the desktop worldwide, in the form of macOS. That’s more than Linux will ever see, however popular it is on the server.

That second one is slightly trolling, but only slightly. Jobs took permissively-licensed code, like the Mach kernel and BSD, and used it to launch the most successful Unix workstation of all time, bar none. I’m using one right now, like I have since 2003, it’s great.

Linux is great too, my homeserver is Linux. You should see what Linus has to say about GPL 3.0 though. AGPL? Forget it, it’s poison.

I write code under permissive licenses out of conviction, because it’s a contradiction in terms to grant freedom to others with strings attached. All I want is attribution, although I’ve released under MIT 0 as well, which doesn’t even ask for that.

GPL has its place too, I think it’s best for end-user focused GUI software. The constellation of 3D printer slicers based on Slic3r (PrusaSlicer, BambuSlicer, and OrcaSlicer) is a demonstrable success story there. It’s obvious from Bambu Labs’ behavior that they would have hoarded a proprietary fork if the license permitted it. Instead, the community was able to re-fork their slicer and make Orca, the best of them all.

But GPL is completely inappropriate for the basic tools of this profession, for developer-oriented libraries, and so on. The arrogance of deciding what someone else can do with your “gift” absolutely galls me, and I’ll have nothing to do with a library which goes that route.

2 Likes

This is completely wrong.

Only a copyright holder can license copyrighted material. Proprietary software can incorporate MIT licensed code because the license allows that, but they cannot make that code proprietary. They can write proprietary modifications, yes, and they hold the copyright to that, so they can license it accordingly.

But not the original code. Same with GPL: it can incorporate MIT, because the license permits it, but that does not change the license of the original code.

You can try this if you’d like! Change a word in the Zig repo’s README and release the combined work under AGPL. Watch as those of us who want nothing to do with this nonsense ignore your fork and continue to write free-as-in-freedom software. Your AGPL license would apply to that one word you changed, it cannot affect the material you based the fork on. That is simply not how this works.

That’s all that would happen if the Zig Foundation were insane enough to go along with this bizarre thought experiment. That would be very painful and probably kill the language, but I, for one, would have nothing to do with the AGPL fork of the language, ever, and would only continue to use the immediately-forked free version.

Which is why this is never going to happen.

2 Likes

Not if the Copyright holder licensed the copyrighted material under terms that allow re-licensing, which, oh look, the MIT license does.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

(Emphasis mine)

When a company takes a piece of MIT-licensed code, and includes it into their own software, they are effectively “sublicensing” the code under a proprietary license.

but that does not change the license of the original code.

Nobody said anything about the original code. You can’t retroactively re-licensing something you’ve already distributed, (unless the license said you could do that beforehand, and even that is on shakey legal grounds) so even if the ZFS for some bizarre reason decided to switch the license of the Zig project, stdlib included, to the AGPL (or more reasonably the LGPL), you would still be able to use Zig code written before this change under the MIT license, but if you were to retrieve any official distributions after that point, it would be covered under the GPL-based license.

Because, as noted, the MIT license allows this. It was designed to allow this.

You’re completely wrong, I went over this already. A sublicense is categorically different from a license. That’s why they’re different words.

The only difference is that a sublicense is a license granted by someone that is not the original copyright holder. That’s it. This secondary license grant could still be the MIT license, or it could be the AGPL.

No, there is a significant difference between relicensing and sublicensing. If you take something licensed under MIT and sublicense it under AGPL, the combined license of the work as a whole becomes (in the form of an SPDX license expression) MIT AND AGPL-3.0-or-later, and it must be distributed in accordance with both the terms of the MIT license and the terms of AGPL, which importantly means distributing the unaltered MIT license text together with associated copyright notices. You can’t just ignore the MIT license terms even if they are more permissive than AGPL.

Also importantly, you can not prevent people from taking and using the MIT-licensed parts however they wish (so long as it is in accordance with MIT), because AGPL does not apply to those parts. This is one of the reasons why it is important to be very clear about which parts of a project are licensed under which terms when there are multiple licenses involved, by for example using // SPDX-License-Identifier: MIT comments and/or by using frameworks like REUSE.

If you relicense the MIT work under AGPL, the license expression becomes AGPL-3.0-or-later and only the terms of AGPL apply. However, to be able to do this you need the express consent of any copyright holders of the MIT-licensed parts.

4 Likes

We’re getting deep into legal hypotheticals here, and straying from the point.

To really settle this however, there would likely have to be a court case to establish precedent, whether or not a licensee with sublicense permission can choose to sublicence with a much more restrictive license than the original. Something tells me the courts would agree with me, given how common this likely is in other industries. (As in, Company A grants license to Company B, and then Company B sublicenses to Company C, but with additional restrictions & obligations on what they can do with the copyrighted material)

My original point stands regardless: it’s more straightforward to switch a codebase from MIT to a GPL license, than it is the other way around, whether you want to believe that the new license applies to the entire redistribution, or only the changes you make afterwards, because any code based on said changes would neccesarily inherit GPL code, even if that GPL code is a small change compared to the overall repo.