Search This Blog

Friday, April 06, 2007

Why CDDL?

So, for those of you who aren't on the modding community sites I used to frequent (and now visit every so often), I've decided to open-source the legendary MPQDraft (yes, it was an April Fools' prank - that nobody would believe it when they saw the announcement). This will require that I get the whole thing cleaned up and commented, so that I can get it uploaded to SourceForge. After that I really should finish the rather large changes I'm in the middle of making to LibQ, and put it up on SourceForge, as well. Both of these are/will be licensed under the Sun Common Development and Distribution License, so I thought I should explain why I chose this license, as opposed to the more common ones.

There are really only two rules motivating my selection of license. First, as I'm making my code available for public use and reuse, I want to make it available and useful to as many people as possible. Obviously, this means placing as few restrictions on use as possible. I didn't want to limit it to eyes only or noncommercial use only projects. I want people to be able to use the code in open source, closed source, and commercial programs alike.

However, it also implies something else. By open-sourcing my code I can ensure that other people have access to that code. But what if somebody takes my code and improves it? Of course, I'd want others to be able to make use of those improvements as well, or perhaps even merge it back into my original project. This means that, regardless of what programs people use my code in, they have to play by the rules of the code itself. I want a guarantee that any improvements or modifications people make to my open source code are also released as open source. This covers just my code and any additions/modifications that are a functional part of the code I wrote; it doesn't have anything to do with any code developed entirely separately, which just happens to be compiled along with my code in the same program.

Second, I want credit to be given for the use of my code. If not to me, then at least to the project itself. Besides the obvious reason of attribution, this serves to promote the project and increase exposure to it, bringing more potential users. This connects back to wanting as many people as possible to be able to benefit from my code. And, importantly, this is an entirely unrestrictive requirement (can you imagine somebody who would rather not use something that would be useful to them than to put one line in the credits?)

So, those are the basic principles. Next, let me point out why I didn't choose some of the more common licenses. First up is the Do What the Fuck You Want To Public License. It should be obvious why this one fails: it meets neither of my two objectives. There is no guarantee that credit will be given for the use of the code, or that changes will be made available to the public. I actually had never heard of this license (which might as well not be a license at all) before today; I'm just mentioning it because it illustrates why I wanted a license :P

Next is the overly popular General Public License. In my opinion, this is a rather obnoxious license, for the reason that it's as much about politics as it is about legality. While it guarantees that the code will remain free for use, it also guarantees that any programs using the code be free, and publicly available under the GPL itself. This is obnoxious because it means that only free/open source software (FOSS) may make use of GPL code. However, for a rather intimidating majority of the market, FOSS is not a feasible business model, and as such a majority of potential users are promptly excluded. This makes the GPL an extremely restrictive license, and completely at odds with my goals.

Next up is the Lesser General Public License (LGPL). This one came pretty close to meeting my requirements, but not quite close enough. The LGPL lacks the more draconian of restrictions in the GPL, allowing you to link it to code not licensed under the LGPL. While this might leave hope for it being useful to commercial software writers, there were two specific clauses that prompted me to reject it. First, some restrictions on linking to LGPL code make it impractical for closed source programs (and commercial programs even more so) to use LGPL code, if the LGPL code is not completely self-contained (e.g. a DLL that the program links to). This means that the LGPL only could satisfy my requirements if I were releasing a stand-alone library, and not an executable, as I am with MPQDraft.

Second, the LGPL allows modifications to the code to be released not under the LGPL, but under the GPL itself, which would further restrict the use of the code. This means that someone modifying my code would be able prevent people who can use my code from using their modifications to my code. This directly contradicts my ideal of maximum collective benefit from my code.

Finally, there's the BSD license. While this license guarantees attribution (if perhaps to a controversially strong degree) and allows anyone to use my code, it offers no guarantee that modifications or improvements to my code will also be made publicly available. As such, it violates my principle of maximum collective benefit in exactly the opposite way the GPL does; just the same, the BSD license is out.

Lastly, let me give a brief summary of the CDDL, as I intend it:
- You may use the licensed code in whole (the entire program) or in part (individual source files, functions, or methods) in any program you desire, regardless of the license of the program as a whole (or rather, as excluding the code you are borrowing). The program itself may be open or closed source, free or commercial.
- However, in all cases, any modifications, improvements, or additions to the CDDL code (any code that is referenced in direct modifications to the CDDL code is considered an addition to the CDDL code, and so is bound by this requirement; e.g. a modification of a math function to use a fast lookup table makes that table itself an addition to the CDDL code, regardless of whether it's in a source code file of its own) must be made publicly and freely available in source, under the CDDL license itself.
- In any program (source or binary) that uses CDDL code, recognition must be given to the source (either project or author) of the CDDL code. As well, modifications to the CDDL code (which must be distributed as source) may not remove notices indicating the ancestry of the code.

Man that turned out to be a long post.

4 comments:

Anonymous said...

I think you get it wrong regarding CDDL and necesity of publications of all modifications to your code.

It applies only and only if a party taking code (using your code) is also _distributing_ it.

In other words:
ANy corporate with ASP model (google :) can take, use, and extend your code and does not have to give society back their changes as long as they're not distributing it (they're not due to the ASP model).

Anonymous said...

Lol, you have no clue.
CDDL allows anyone to take your code/program, modify them and release as their own "product". They are NOT obligated to give you anything back in form of opensource under original license.

This is the ONLY difference between GPL and CDDL. GPL: you are required to publish changes in original license if you distribute it. CDDL: you are NOT required to publish changes in original license if you distribute it.

Also by mentioning GPL is political you also showed you have no idea of politics. Politics = Influence. Since ANY corporate entity seeks influence to make money, ALL licenses are political.

Justin Olbrantz (Quantam) said...

1.3. “Covered Software” means (a) the Original Software, or (b) Modifications, or (c) the combination
of files containing Original Software with files containing Modifications, in each case including portions thereof.

3.1. Availability of Source Code.
Any Covered Software that You distribute or otherwise make available in Executable form must also be made available
in Source Code form and that Source Code form must be distributed only under the terms of this License
. You must
include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or
otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they
can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used
for software exchange.

Feel free to demonstrate how I'm misunderstanding the terms of the CDDL, Anonymous #2.

Justin Olbrantz (Quantam) said...

Though it's really moot at this point because LibQ is dead.