104

I translated a GPLv2 C program to Python, but found it was hard to extend as designed and rewrote significant portions of it. The program is now structurally completely different, but there are several verbatim translated functions in use.

The Ship of Theseus Paradox (as stated from Wikipedia) "raises the question of whether an object which has had all its components replaced remains fundamentally the same object."

If I did manage to write replacements for the verbatim functions, would I be able to relicense to a license I prefer?

Related, would I be able to pull the evolved architecture out and reuse it with a different license? I think it would be very useful on its own, but do not like the idea that it is now "tainted" with the GPL license.

Followup: I decided to contact the copyright holder and received permission to relicense. Sometimes the best way is to interact socially rather than programmatically!

codenheim
  • 2,963
  • 16
  • 18
Landon
  • 1,013
  • 1
  • 7
  • 12
  • I wonder if you can argue that you never accepted the GPL. Remember, we say the license is a property of the code, but actually it is a kind of contract between licensor and licensee. If you accepted the contract, then yes, you must put the new version under the GPL even if it contains no old code. But if you never accepted (just stole the code), you can do what you want with the new code. BUT you would have violated the authors copyright by using his code without license. The question is which is the lesser crime. Note I'm just playing devils advocate and IANAL, and not recommending anything. – jdm Oct 19 '14 at 11:21
  • 6
    Compare the [ReactOS audit](http://www.reactos.org/wiki/Audit): there was the allegation that ReactOS (a Free Windows replacement) was tainted by using leaked and reverse engineered MS Windows code (for which they never took a license). They solved it by systematically replacing all code of unclear origin with legal "clean-room reverse engineered" code - basically new code written from a clean spec. – jdm Oct 19 '14 at 11:24
  • 3
    @jdm Chinese Wall/clean room code must also be written by people who were not involved in the reverse engineering and have limited (legally reviewed) communication with them. WRT to ignoring the license and just "violating copyright instead" -- it would amount to the same thing, since you would still not be entitled to redistribute material on which you have violated copyright. – goldilocks Oct 19 '14 at 13:33
  • In my jurisdiction (UK) this has never been tested in court so it is not clear what the legal position is here and, I suspect, in quite a few others. Things may have been worked out more clearly in the US. The leading case here on creating compatible software (SAS v World Programming) did not involve access to the source code. The Red Bus case suggests you might be in difficulty if you were here, but it isn't at all clear. – Francis Davey Oct 19 '14 at 15:13
  • 9
    @jdm The GPL is not a contract and does not need to be accepted by anyone. The GPL is a license and you must abide by it if you take advantage of the license. It is not a two way street or a negotiation or setting of multual obligations the way a contract is. What it does is state the only rules under which you are allowed to use the code. IANAL but I have had this explained to me by several licensing lawyers. – Elin Oct 19 '14 at 21:34
  • To extend/clarify what Elin said, the GPL does not try to remove any rights that you already have (the way that say many EULAs do). Instead it restricts those conditions under which you are allowed to use the code. The code itself is copyright, and unless other licenses are provided, the GPL is the only reason you have any rights to the code at all. Imagine if the code were not released under GPL, just released as code that was copyright. If the questioner went through the same steps, the question would be fundamentally the same, is the resulting code a derivative work or not. – CrazyCasta Oct 20 '14 at 00:46
  • 3
    @CrazyCasta: You're mistaken about the scope of the GPL. You state it's the only reason to have any rights. This is explicitly incorrect and outright denied by the GPL itself. GPL covers only distribution rights. You have an unlimited right to use and study the code even without accepting the GPL. – MSalters Oct 20 '14 at 07:07
  • 2
    @Elin: Right, you must abide by the GPL if you want to take advantage of the license. What I was saying is that you could in principle say "I never accepted your license" and fall back to the *unlicensed state with no rights, but no GPL obligations*. So instead of violating the GPL, you would be violating copyright (which might not be better). Whether that's possible depends on your jurisdiction. I know that in many parts of Europe, licenses are not automatic. You can't *make* someone accept a license (that's why EULAs are possibly unenforceable here). – jdm Oct 20 '14 at 09:23
  • I dont understand well enough to answer, but from my understanding, if the code base at any point becomes entirely your work with no external code at all you need not follow the GPL as the code is solely your IP to release as you like, however you would have to remove every line of the original code and make sure it it 100% your code and IP. – Vality Oct 20 '14 at 10:48
  • The thing is, there is no such thing as not accepting the license. What you would fall back to is never having been able to run, modify or share the code. He has clearly run, modified and possibly shared the code. You could still study if it was released on a public site. Yes, you would be violating the copyright, which would mean you cannot copy or create derivative works. Unless you are going to label your code parody even changing everything may or may not be enough hhttp://en.wikipedia.org/wiki/Suntrust_v._Houghton_Mifflin. It would be much much worse to end up in court about that. – Elin Oct 20 '14 at 11:15
  • 1
    @MSalters: GPL grants distribution _and modification_ rights. Without a license you only have the right to use the software as-is. – RemcoGerlich Oct 20 '14 at 13:53
  • 1
    @MSalters Actually, if you come across arbitrary code on the internet that is not marked with a license or marked as being in the public domain you have no rights at all. Depending on the context you might have some limited rights to view and/or use the code based on implied rights from the situation. For instance if the code is on a public website you likely have the implied right to view the code. IANAL, but from what I understand this is a particular problem for code lying around on the internet w/o a stated license: by default everything is copyright and you have no rights to it. – CrazyCasta Oct 20 '14 at 14:08
  • @RemcoGerlich: They may grant it, but under law you had them anyway. However, they're not protected rights so you may lose them in a commercial software contract. – MSalters Oct 20 '14 at 15:17
  • @CrazyCasta: You don't have any _special_ rights but you do have all default legal rights. – MSalters Oct 20 '14 at 15:20
  • Landon you should add a note at the bottom of your original post with the update you sent me (about the original author's reply). It would be very useful and interesting to future readers. – codenheim Oct 21 '14 at 15:01

7 Answers7

98

First, the answer is no (for a translation), you cannot legally relicense it or do anything outside of the original license legalities. You may very well have done 10 times the work of the original author, but it doesn't matter, it is viral. Not just because it is GPL, but because it isn't clean design or rewrite.

I struggled briefly with this in 1992 when I had done massive rewrite of an old MUD codebase. We had a successful game, but wanted to do our own thing, and people were willing to pay for it, yet the DikuMUD license strictly forbid us to make money. A competitor, at the time, also had based theirs on the same codebase, and they opted to blatantly ignore the copyright, rip out all traces of it, and basically lie to everyone including themselves. Their logic was "none of the original code exists" and "we have done massive rewrites and improvement" and generally ignoring the fact that they started with 20,000 lines of code. They were charging for items in the game, and making too much money to stop.

I was admittedly envious. But I researched copyright law, and consulted my conscience, and decided I could not even use the code I had written because I honestly did not architect the game server from scratch.

So I decided to put my money where my mouth was and write from scratch, with a copy of W. Richard Steven's UNIX Network Programming with me at all times, I started. Writing from scratch, my way, taught me so much more than when I had rewritten DikuMUD, and it also taught me that I didn't really understand what it meant to stand on someone else's shoulders. Within six months I had 50,000 lines of operational code that I could call mine. I named it MUD++ and released it under BSD. Badly written in early style C++, it was still the first free, open source C++ MUD that I am aware of. To this day nobody can take it away from me. I had the best TCP server at the time, nobody else could do a "hot reboot" without dropping players, and soon everyone was stealing the feature (and I've noted many GPL MUDs have snippets of my BSD code -- always interesting how GPL can hijack BSD-ware but not vice-versa). Eventually, I moved on, so it wasn't like the decision was a make or break for my fortune, but while the other guys made a lot of money for a while, last I looked they had dwindled, in a world of graphical games there isn't much mass demand for text anymore.

The story doesn't end... a few years later, I was working for IBM and Disney hired us to write a realtime 3D multiplayer game for Epcot center, and I was able to use the TCP core from MUD++ as a base for that game server! Had I not owned my own code, I wouldn't have been allowed to use it, and it honestly saved me weeks of coding time. In the end, I am proud of the choices I made and I have a story to tell my kids.

People understate and underestimate the benefit of starting with someone else's framework to build on.

If you think you "own" it, test yourself. Start over, with a Python book beside you. See how it feels. Don't cheat and don't look at the old codebase. Look at the output. Force yourself to think through every aspect on your own, doing the honest research. You'll be better for it, and likely have a better product.

Before you do that, though, try to contact the original author. Ask them if they would be willing to relicense. If you plan to sell binaries, offer royalties. Many authors who released things GPL in the 90s and 2000s, are now in their 30s, 40s and 50s and understand what it means to make a living at software. I've seen more than one relicense their stuff from GPL to MIT, Apache, Boost or BSD.

Lastly, a license doesn't override prior rights to code you may have. Or if you wrote a clean add-on independently, for example, if you wrote a TCP engine as an add-on to a single player Tetris game, and it can cleanly stand alone (especially if you previously released under another license) then you can reuse your code in other projects. You have authorship rights too.

My belief is free is FREE. If you gotta attach strings, don't call it free. Someone mailed me years later and said that they had used my game in a commercial engine, mainly the TCP and possibly the bytecode interpreter. They were making money. I didn't mind one bit. I was happy as I still am now, as a proud father.

codenheim
  • 2,963
  • 16
  • 18
  • Thank you, this is a great answer. I think there is one more option to relicense other than a clear and complete rewrite from scratch. Given that the original program has a single copyright holder, I am going to pursue getting permission to relicense from the original author. – Landon Oct 19 '14 at 01:10
  • 4
    Actually I was going to suggest that and I got lost in my story. Yes, by all means, consult the original author, pay him homage, so to speak, and you will probably be surprised at how often the author is just happy you took the trouble to ask. And many young college guys that were big on GPL in the 90s and 2000s are now realizing that programmers have to make a living. – codenheim Oct 19 '14 at 01:17
  • 18
    I like this answer, and would like to upvote, but I can't, because of all the anti-GPL spin in the last paragraph. The string the GPL attaches is that strings may not be attached in the future. – Michael Shaw Oct 19 '14 at 02:52
  • 9
    Good answer, and esp. for recommending working out a deal with the original author. Self-sufficiency is often a road to poverty, and while rewriting a whole library/platform/app *can* be a worthwhile endeavour, it isn't always so. – Dan1701 Oct 19 '14 at 03:48
  • 16
    @MichaelShaw: Actually I thought that was the most brilliant part of this answer. Your claim on the other side is **factually wrong**. If the author of the GPLd code decides to release new versions of his code under a different licence, they are well in their rights. They attach the strings not to themselves, but only to those who they "share" their code with. The nicest way I can describe this is as a fundamental lack of faith in humanity. – back2dos Oct 19 '14 at 10:06
  • 11
    The way I see it is that BSD-style licenses make this code, right here, free, which is simple. GPL-style licenses aim to set up a free software community/ecosystem/whatever in competition with closed and otherwise un-free software. In order to do that they make a number of strategic moves, and the length, and variety of GPL and GPL-like licenses (and their development over time) shows that this is a complex business involving many value judgments. If those who prefer one perceive the other to be non-free, or those advocating the other to be spinning against them, both lose. – Steve Jessop Oct 19 '14 at 13:02
  • 3
    I think the meaning of the word "free" as used by proponents of the GPL is *not* that you are free to decide the future context -- it means the context must remain free as defined by the GPL. For better or worse, you don't get to "enslave" it to suit your own purposes and vision. I like do-as-thou-wants OSS licences such as BSD and MIT, but it is a bit twisted to say they are "more free" because they entitle people to "unfree" the software. Their purpose is to offer the choice between free and non-free. That's not *additional* freedom. – goldilocks Oct 19 '14 at 13:42
  • 1
    @back2dos: My claim is only "wrong" if you ignore that licenses are things that only affect people who aren't the author. Of course they can release it under new licenses if they want. If you want to nitpick details that don't matter, don't forget that technically, the BSD attaches strings too, and the strings it attaches only affect other people too. – Michael Shaw Oct 19 '14 at 18:47
  • @back2dos If the author of BSDd code decides to release new versions under a different license, they are also within their rights. The GPL is no different in this respect, save that if you have a project with many copyright holders (eg Linux), it will be impossible in practice for anyone to release a non-free version, since it would require the unanimous consent of every copyright holder. In contrast, anyone can create a non-free version of a BSDd project, regardless of the other copyright holders. – Lily Chung Oct 19 '14 at 19:56
  • 1
    @MichaelShaw: This not nitpicking. If somebody releases code under the WTFPL then *anybody* can use it and re-license it any way they see fit. Also you make it sound as though the GPL made any guarantees to users about the future. It doesn't. Upon carefully rereading my comment, you may notice I have never claimed the BSD to be better or whatever. – back2dos Oct 19 '14 at 21:09
  • @back2dos: You're reading way too much into one sentence -- I said nothing about guarantees. Upon rereading your comment, I see you state users of the GPL have a "lack of faith in humanity", and state that the part of the answer that compared the GPL to a "jealous ex-girlfriend" and the BSD to a "proud parent" was "brilliant". – Michael Shaw Oct 20 '14 at 00:00
  • 3
    Once upon a time, the software world had a void. Then that void was filled by open source, free software. GNU was the poster child because of gcc and Linux, but not unique. But nowadays, much less innovation is happening around GPL. Companies tend to stay away from it, preferring licenses that give them options. ALso, GPL isn't required to make people give back to the community. A perfect example is Clang. The upside to BSD is if my motivation happens to be making a living, then I can improve the software while still preserving some of my intellectual property and competitive advantage. – codenheim Oct 20 '14 at 04:28
  • 3
    Now I fully understand the point of GPL, and that I don't have to use the software if I don't like the license. But then nobody wins. The best thing for all is innovation and healthy organisms. Much and I mean MUCH GNU software has been developed on company time. I was at IBM while they were condoning our contributions to Linux, we were even encouraged. I saw firsthand during the Linux craze of the mid to late 90s how much business helped free software. Without corporate support, and the 20% time (for some people it became fulltime), Linux would still be great, but nowhere near where it is. – codenheim Oct 20 '14 at 04:32
  • 1
    @codenheim - Your anecdote is really confusing. How did the GPL stop you from making money? People get around the GPL all the time by only making the _service_ available through a web server and never distributing the actual binaries. (That's the whole reason the [AGPL](http://en.wikipedia.org/wiki/Affero_General_Public_License) was introduced.) Even if you were actually trying to sell your MUD server code to other people so that they could have their own servers, [GNU encourages people to sell GPL software](https://www.gnu.org/philosophy/selling.html). – DaoWen Oct 20 '14 at 16:49
  • 2
    @DaoWen - You misread it. I did not say GPL stopped me from making money, nor that I was working around a GPL license. I was actually working around a non-GPL license. In my specific case, the original license prohibited us from charging to play. – codenheim Oct 20 '14 at 16:51
  • 1
    Great, and inspiring answer. Thank you for your post. – Brad Oct 20 '14 at 17:38
  • I think that this answer is correct for the particular situation described in the question. However, in general, the answer would be a judgement call made by comparing the original and final code. If we accept the answer that _any_ editing is virally tainted, then we would conclude that any project based on the [GNU Hello](http://www.gnu.org/software/hello/) template would have to be GPL, even if you swapped out all of the functionality. – 200_success Oct 20 '14 at 21:42
  • 4
    Following up on this, the copyright holder did review my code and give me permission to relicense. Sometimes the best way is to interact socially rather than programmatically! – Landon Oct 21 '14 at 13:48
  • 1
    That is awesome; even more inspiring! Humanity trumps copyright. – codenheim Oct 21 '14 at 14:18
  • Thought experiment: load a GPL program in your editor. Now select the whole buffer and delete it, leaving no original lines of code in the editor buffer. Write a new, completely unrelated program in the same editor window. Is that a derivative work? – Larry Gritz Oct 21 '14 at 23:58
  • `Many authors who released things GPL in the 90s and 2000s, are now in their 30s, 40s and 50s and understand what it means to make a living at software.` You seem to be under the (wrong) impression that GPL forbids selling or something. – GnP Oct 24 '14 at 21:02
  • @gnp - Err, no. I think I know what GPL permits by now. – codenheim Oct 25 '14 at 03:03
  • "The story doesn't end... a few years later, I was working for IBM and Disney hired us to write a realtime 3D multiplayer game for Epcot center, and I was able to use the TCP core from MUD++ as a base for that game server!" I'm guessing this was the Aladdin Magic Carpet Ride game (now installed at DisneyQuest)? – Stuart P. Bentley Oct 25 '14 at 21:02
  • "People understate and underestimate the benefit of starting with someone else's framework to build on." I don't see how this goes with the rest of the post since in the rest you are talking about the benefit of _making you own wholly anew_, something totally _different_ from that concept. – The_Sympathizer Feb 24 '17 at 10:10
  • @The_Sympathizer - What I was getting at is I've seen people rationalize the reuse of someone else's foundation as a starting point while throwing away the license, because they don't want to "bother" to do a clean honest rewrite. In the one instance I mentioned, "all the original code has been replaced". My point was, it doesn't matter. They are just code pirates without ethics but the key is they lack appreciation for level of effort. The people were real people that I knew, but this isn't an isolated case. There are many closed codebases out there that don't stand up to a license audit. – codenheim Apr 12 '18 at 22:34
  • @codenheim : If you have to rewrite it entirely from scratch with no connection, such that even making it "to the point all original code has been replaced so none is left" is _still_ having "NO" ethics (in those absolutist terms), "just" a code pirate, and "NO effort", then there is _NO_ benefit that cannot be honestly gained from others' codebases. I agree with you that code should not be pirated without permission; but the _logical_ consequence of that ethic is that if you don't have permission then there is _NO_ _ethically obtainable_ benefit to "start with someone else's framework to buil – The_Sympathizer May 06 '18 at 12:04
  • d on" since there is no way to do that that is ethical (unless you get the code author's permission to do so.). Thus it seems totally incongruous to put that point in there with everything else which otherwise seems legit. – The_Sympathizer May 06 '18 at 12:04
  • If you have to rewrite totally from scratch, then you gain _NO_ benefit from the others' codebase _by definition_. Thus it's silly to talk about such a benefit in the context of a case where it is unobtainable (at least ethically). Because you _CAN'T_ just "build on it" ethically. It's like talking about the benefits of unicorn horn rubbing. Yeah it might be great but unicorn horns don't exist. – The_Sympathizer May 06 '18 at 12:06
  • @The_Sympathizer - I think you've confused my story with my description of the other person's software that I mentioned. I did a clean room rewrite. The codebase I was referring to when I said "to the point all original code has been replaced" was not about _me_. It was my point (that it seems you agree with) that you can't do that and call it a new codebase. Its like renovating an old house, board by board by replacing rotting boards until they are all new. still not an original creation. – codenheim May 10 '18 at 14:04
  • @The_Sympathizer - The other point that I think is missed by a few people in my story is that I am challenging people to go do it. There are so many that trivialize the level of effort of building something from ground zero. And they also lack TRUE pride of ownership that comes with original creation through considerable blood, sweat and tears. – codenheim May 10 '18 at 14:05
  • @codenheim : However that's not how I interpreted the situation. I imagined rebuilding the "house" as you say, board by board until it no longer in any way, shape, or form resembles the original house at all, not merely an identical-looking version with all boards replaced, which preserves the _information_ in the house's structure but changes the _physical realization_. Nonetheless, if regardless of copyright/ethics original creation is better, it's contradictory or at least pointless to say that starting with someone else's codebase is an advantage when there is no way to avail oneself of – The_Sympathizer May 15 '18 at 06:36
  • said advantage ethically. So what I was scratching (actually, popping) my head at was the idea that as you mentioned in your post there is some kind of advantage. It's like how you can "advantage" yourself (at least if you don't and until you do get caught) by robbing a bank, but since it's not right to rob banks, it's utterly useless to mention it for an ethics-respecting person. Unless you were trotting that out to explain a _motive_ for _why_ some ethically looser people might do it, but then that should have been made more clear, I believe. – The_Sympathizer May 15 '18 at 06:38
  • @codenheim : More specifically, the troublesome passages are "People understate and underestimate the benefit of starting with someone else's framework to build on." taken together with "Don't cheat and don't look at the old codebase." - if you do the latter, there is zero benefit from the former, so it makes no sense to talk of the former if the latter is the "right" thing to do. – The_Sympathizer May 15 '18 at 06:40
  • @The_Sympathizer - Yes, what I mean by ""People understate and underestimate the benefit of starting with someone else's framework to build on" is they either intentionally minimize / marginalize the benefit of the original author's work, or willingly lie to themselves for the sake of their conscience). We can't start with someone else's code (ie. stand on their shoulders) and replace it from the bottom up to then remove the license and strings that were attached. When they do that, they also utterly disrespect the original author for sake of greed or laziness. – codenheim May 25 '18 at 14:17
  • If my post seems contradictory, I am saying people (I had specific persons in mind that were well know in that community at the time) lie to themselves and don't respect the author's work. But despite that, I still propose: if someone feels strongly enough about using the author's work that they are considering cheating the author of his rights (which OP was _not_, to be clear) then simply build it yourself and reap other rewards besides being free of copyright. But if not so inclined, contact the author to see if they will grant you license (which OP did and behold, he was granted license). – codenheim May 25 '18 at 14:24
  • @codenheim : I guess the problem I was having was that for me the statement sounded like it was trying to say that this benefit was something reasonable - whereas it sounds like you're really saying it's "benefit" in the same sense of the "benefit" of getting easy money through a bank robbery is a "benefit". Thus in this case, you _cannot_ stand on others' shoulders unless you a) get a license or b) can respect the original license incl. compromising on your original ideas and ceding them some of the control over your work as they stipulated with their original license. – The_Sympathizer May 25 '18 at 19:23
  • @codenheim : And this is then why I find the idea "don't reinvent the Wheel" to be rather problematic and headpoppy contradictory when I hear it. I keep thinking "IP laws. IP. Ethics! Conscience! 'Annoyingly pesky moral stuff!'" Yup - I'm right. And indeed all the times I have 'reinvented a Wheel' are mostly precisely because I'm concerned about wanting to retain control over my work so I can use it in the ways I seek and not do anything unethical and/or illegal. – The_Sympathizer May 25 '18 at 19:24
  • @back2dos No copyright law can force someone to attach strings to themself. That's not a GPL-specific failure. Note that as soon as you have more than one programmer, each one's copyright is a string for the other one. – user253751 Nov 06 '20 at 14:10
32

This scenario is covered in the GPL FAQ:

What does the GPL say about translating some code to a different programming language?

Under copyright law, translation of a work is considered a kind of modification. Therefore, what the GPL says about modified versions applies also to translated versions.

Philipp
  • 23,166
  • 6
  • 61
  • 67
  • This particular part is clear, but it gets fuzzy when I expand to the rest of the program (at least, in my mind.) The original program was a small curses game, but my work on it beyond translating includes adding networking so players can compete head to head as well as rearchitecting it to be more modular/extensible. In essence, the game engine shares little similarity to the original, but the game itself derives heavily. This goes back to my related question, is the engine now GPL or would I be able to pull it out and reuse it for an MIT or BSD license project. – Landon Oct 19 '14 at 07:12
  • 7
    @Landon Your work is still a derivate from a GPL work, and so it's bound to the terms of the GPL. – Philipp Oct 19 '14 at 07:16
  • 1
    @Landon: what determines whether the GPL applies isn't really anything to do with the GPL, it's whether your final result is a "derivative work" or not. Adding more stuff doesn't turn a derivative work into a non-derivative work because in law it's not about the proportion of the work that's derivative, it's the raw amount. A routine conversion to another language is also derivative, and that's what the FAQ is informing/reminding you of. The question you have to ask your lawyer is, "given my procedures, would a court find this to be a derivative work?". – Steve Jessop Oct 20 '14 at 12:09
  • ... however, this answer focusses on the "verbatim translated functions" which presumably are derivative, but which you say you're planning to remove. As such, I don't think it really covers your intended scenario. It covers your current one, and it covers the scenario you'd be in if you make a mistake and don't manage to excise everything you need to. – Steve Jessop Oct 20 '14 at 12:19
8

It is doubtful, even if you rewrote the entire library from scratch, that it would pass legal scrutiny. The code would be considered "tainted" because you have seen the code in the GPL licensed library.

The standard approach to this problem is called "clean room implementation". You write a requirements document and have someone else implement it (who hasn't seen the GPL code).

Also see this question: Rewriting GPL code to change license

As someone aptly put it there, a Chinese translation of Harry Potter is still a derivative work, even though all the information has been replaced.

Of course, the probability of you getting sued over rewriting a GPL licensed library (and the morality of relying on that low probability) are entirely different discussions.

As far as adding functionality to the original code, this is (part of) the very definition of derivative works: adding to the original work. It doesn't matter how much you added, or how small the initial work was - it's still derivative.

Sir Athos
  • 217
  • 1
  • 3
  • 3
    I'm not sure I like the choice of the analogy: the original question sounds more like they think they were originally bundling their stuff with Harry Potter, but now want to bundle it with their own fantasy epic novel with magic and villains that takes place primarily in a school in a castle. –  Oct 19 '14 at 10:09
  • 1
    @Hurkyl So 50 Shades of Gray? – Yamikuronue Oct 19 '14 at 16:57
  • 9
    Having seen the code doesn't mean you copied it. A cleanroom implementation is useful if you expect that the owner of the original code doesn't like what you do and will sue you, so you can say in court "we didn't copy the code; even if we had wanted to, we couldn't" which is a strong defence. Having seen the code you can still say "we didn't copy the code" as long as it is the truth. – gnasher729 Oct 20 '14 at 10:03
  • 2
    Agree with @gnasher729. GPL specifically states that you are allowed to study the code. The premise is that the author released it to teach you (among other things). For this reason, I've never applied the clean room argument to GPL code. One can't publish a cookbook and then sue people who create their own recipes, unless, of course, the code is patented, then patent protection covers the techniques and inventions, but not the implementation (AFAIK). Copyright and Patent are different issues. – codenheim Oct 20 '14 at 17:04
  • 1
    I would say there is a very low probability of ending up in a courtroom if you violate GPL because with just one or two exceptions every time there has been an issue, one the lawyers of the people violating the GPL understand the GPL they tell them to either stop or make a deal. This was certainly my experience any time I've had to write a letter about a violation. And there are pro bono lawyers who will defend the GPL for the original developer. Really, the best advice is to talk to the original coder. I've asked people to dual/relicense code and they have almost always said okay. – Elin Oct 20 '14 at 23:25
7

Observation: The GPL is only relevant if you release your work. Have you released it yet?

Observation: This is not a legal-counsel website, so throw out all that legal FUD, and apply common sense.

Opinion: The GPL, or any license, does not copyright ideas, it claims the sourcecode, not matter how small its part. So, if, and only if your "derivative" work cannot be identified as being derived from the original, because you changed the structure of the code and reimplemented all functionality, it is for all practical purposes no longer derivative, because, well it would be indistiguishable from a clean room implementation.

This is very hard (impossible?) to acheive though when you have an existing codebase you modify, instead of starting from scratch.

Martin Ba
  • 7,578
  • 7
  • 34
  • 56
  • 10
    "Observation: This is not a legal-counsel website, so throw out all that legal FUD, and apply common sense." Er, since this is clearly a legal question, the solution is not to pretend the legal issues don't exist but to ask a lawyer. My understanding is that a derivative work cannot stop being a derivative work just because you do more deriving. – David Richerby Oct 20 '14 at 12:08
  • 1
    @DavidRicherby : If it is a legal question then the answer is specific to the jurisdiction and the q should be closed as too localized. :-) – Martin Ba Oct 20 '14 at 12:24
  • 2
    @MartinBa - international law is [pretty much in agreement](http://en.wikipedia.org/wiki/International_copyright_treaties) about copyright. Local variations exist, but I don't think the question/answers are necessarily too localised to be useful. – cloudfeet Oct 20 '14 at 16:00
5

You own the copyright for any code you write. What the GPL mandates is: any code you contribute or release alongside GPL code, you must also release under a similar license. However, the copyright is still yours.

So, if you release your software part-way through the re-write (so there's a mixture of your code and old code), then you have to release that part of your code as GPL, and this cannot be revoked. However, the copyright holder is the one who decides on licensing terms, so you still have the right to essentially "dual-license" that part of the code, including combining it with other code you alone wrote and selling/relicensing, etc.

Caveats:

  • although the copyright on code you write is yours by default, it can be changed by another contract/agreement, e.g. a CLA that specifies copyright transfer, or a contract with an employer who owns all the work you do on "their time".
  • whether your re-write constitutes enough of a "derivative work" that you end up sharing the copyright with the original author is a matter of degree. If you translate the code line-by-line into another language (as your question mentioned), then those parts might well count as derivative. If you implement an API-compatible replacement without looking at the details, then that probably wouldn't.

(source: a "copyright and open-source" session organised by my company a few weeks ago)

cloudfeet
  • 151
  • 3
  • You may want to replace "document" with either "contract" or "agreement." It's not enough to just write on a paper "DougM owns cloudfeet's code". We'd have to have a legal exchange that would pass court review. – DougM Oct 20 '14 at 13:46
  • Depends on the jurisdiction - at least where I am, even verbal contracts are binding, merely hard to prove. A post-it with appropriate handwriting on would hold up pretty well *in theory*. :p – cloudfeet Oct 20 '14 at 14:24
  • However, your point is good, and contract/agreement is a better description - thanks :) – cloudfeet Oct 20 '14 at 14:25
3

Yes.

The other answers use far too much text explaining opinions on whether you should or not, but those opinions are not that relevant to the question.

The fact is that you will have a new work once you replaced the last parts, which admittedly was constructed by looking at a GPL'ed work. That's not a major concern in copyright law (patents would be another issue). Everything you distribute will be your creation.

There is plenty of material backing the theory that the copyright in a software program is the sum of partial copyrights. For instance, the MPL explicitly acknowledges this model. The Google/Oracle lawsuit got down to line-level copyrights.

MSalters
  • 8,692
  • 1
  • 20
  • 32
  • 4
    A work constructed "by looking" at another work is a derivative work, and would be stained by the same copyright as the work you "looked at." – DougM Oct 20 '14 at 13:44
  • 1
    @DougM: Sorry, but that's a very conservative assumption which I've never seen used successfully in court. Don't forget, if that theory had any legal relevance, it would also apply to books - computer code doesn't have special laws to determine what is a derivative work. Nobody is going to argue that your book is a derivative of Shakespeare merely because you read one of his plays in school. Thus that precedent establishes that the bar of "derivative work" is a lot higher than "have read a similar work". – MSalters Oct 20 '14 at 15:25
  • 1
    GPL specifically states that you are allowed to study the code. This isn't proprietary IP, it is free, open source. I've seen no legal support, in the lifetime of GPL, for the claim that looking at a published recipe to make my own recipe implies a derivative. – codenheim Oct 20 '14 at 17:08
  • @codenheim: Looking at code doesn't make code that you write derived. However, that is independent from GPL. An evil copyright owner could allow you to study their code with the _intent_ to claim that anything you write is a copy of their code. – gnasher729 Oct 20 '14 at 18:08
  • @MSalters : if you just looked, maybe... but not if you copied word for word. The question here is about trying to replace part of a program to avoid its license, and the line between derivative or not is too fuzzy for "just write a replacement" too be sufficient advice. – DougM Oct 20 '14 at 18:20
  • 1
    One might wonder how far Linux could have gone if replacing Unix code with original code wasn't sufficient. – user2338816 Oct 20 '14 at 20:15
  • 3
    @user2338816 Linux did not start with Unix code, it started with MINIX. And technically, it is possible that MINIX could have had a case against Linux. This would depend on how Linux rewrote their code and the license under which the MINIX code was shared with Universities. However, it also comes down to politics and money, does MINIX really want to go after Linux, and does Linux have the money (through corporations like Red Hat) to fight them off. – CrazyCasta Oct 21 '14 at 00:48
  • 1
    @CrazyCasta Yes, and MINIX at the time was a Unix-like OS that was system-call compatible with V7 Unix. One derivative after another. Base code modules are replaced with original. When you're at the system-call level of compatibility, it's hard to think in terms other than derivative. – user2338816 Oct 21 '14 at 02:43
1

The short answer is that you cannot know.

When you talk with Richard, you find he is "crazy like a fox" in many of his implementations. The GPL is written specifically to have ambiguities and unclear phrasings. These are generally expressed against the benefit of the license writer but also give your IP lawyer concerns. Cleverly, it gives your IP lawyer increasing concerns as the company gets bigger. A small commercial enterprise doing the "reasonable interpretation" of the GPL might be an acceptable risk, but a large software company might find it more prudent to burn an entire team that managed to get a taint of GPL.

There is no answer. There will not be an answer. That is the answer.

Charles Merriam
  • 419
  • 3
  • 5