Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m working on a JavaScript port of a red-black tree implementation in Java fro

ID: 648204 • Letter: I

Question

I'm working on a JavaScript port of a red-black tree implementation in Java from the book Algorithms 4th Edition, by Sedgewick and Wayne. I believe that my JavaScript port qualifies as a derivative work. It's not nearly a line-for-line copy, but the core logic for RBT manipulation is quite similar.

On the book site, it states that the libraries stdlib.jar and algs4.jar are licensed under GPLv3. The red-black tree implementation in Java is part of the algs4.jar library. Ideally I'd like to release the port under a more permissive license, but that doesn't appear to be possible, for understandable reasons.

However I'm unclear about how users of my port will be bound by the license. Does any software making use of my JavaScript red-black tree port, regardless of the overall size of the project, need to make the entire project's source available under the same terms, or just the source for the JavaScript port itself?

In other words, would the authors of some larger project be bound to release their entire project under GPLv3 just because it uses a port of an algorithm implementation released under those terms in some part of the project?

Explanation / Answer

Your code needs to be released under the GPLv3 as you believe it is a derivative work of the algs4.jar implementation.

Other projects utilizing your code will likely need to be released as GPLv3. Most larger applications just incorporate code from smaller projects, and treat the smaller code base as part of the larger. That will trigger the "viral" aspect of GPLv3.

If you provide a way to access your code in one of the accepted "escape mechanisms" then the larger project will not be affected by the viral aspect of GPLv3. This section of the GPL FAQ explains some of the ways that GPL code can be used in proprietary code without triggering the viral aspect of the GPLv3.

However, in many cases you can distribute the GPL-covered software alongside your proprietary system. To do this validly, you must make sure that the free and non-free programs communicate at arms length, that they are not combined in a way that would make them effectively a single program.

You may also be able to license your project as LGPL, which can make it easier for other projects to link to your project without being impacted by the GPL/LGPL license.