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!
Ship of Theseus applied to GPL - Can I relicense my program if I replace all of the derivative parts?
licensing;gpl
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.