21

I'm exploring in the idea of porting an existing software package to another language. It's released under the Apache License 2.0, and is distributed for free; but there's a big different between using a library versus creating a copy of it. I would of course give full credit and be honest about where it came from, and I certainly don't plan to make any money from the port, just use it in other projects.

I've read the license of course, which says:

  1. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.

[...]

  1. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:

    a. You must give any other recipients of the Work or Derivative Works a copy of this License; and

    b.You must cause any modified files to carry prominent notices stating that You changed the files; and

    c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and

    d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file [...]

    You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.

Which sounds very much like a port (as a "Derivative Work") is entirely permitted with or without the author's permission provided I diligently retain copies of the license, existing copyright notices, attribution etc.

But that doesn't mean I understand all the implications of it. For example, would the port necessarily have to share the same license as the original?

I haven't started any of the work, nor have I contacted the authors of the package yet (though I will). I want to establish whether there's any risk of a lot of work being wasted. I also need to know whether I'd need to make a clean room implementation based only on the API, or whether I could base my work on the existing source code (which I haven't looked at yet).

Marcus Downing
  • 313
  • 2
  • 6
  • In case it was under any doubt, the code I want to port is non-trivial and achieves things I would find very difficult to achieve on my own. – Marcus Downing Apr 02 '15 at 17:07

2 Answers2

12

Translations (both to a different natural language and to a different programming language) are considered to be Derived Works.

When creating a derived work that is so radically different from the original as a translation to a different (not closely related) programming language results in, it is actually quite hard to understand how the requirements from the Apache license should be applied. I would very strongly advise you to discuss with the maintainers of the original package how they would like to see the copyrights handled and you might want to discuss it with a lawyer as well.

The troublesome part is clause 4c:

c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and

The problem here is that with such a radical change, it is next to impossible to tell which (copyright and attribution) notices from the original work legally also pertain to the translated version and thus which notices must be kept and which must be removed.

Bart van Ingen Schenau
  • 71,712
  • 20
  • 110
  • 179
  • 14
    "talk to a lawyer" is actually a pretty steep barrier for somebody planning to do some work and give it away for free. – Marcus Downing Apr 02 '15 at 20:25
  • 2
    @MarcusDowning: Yes it is, but sometimes it is the best advise we can give. – Bart van Ingen Schenau Apr 02 '15 at 20:37
  • @BartvanIngenSchenau I have not found anything indicating that a rewrite in another language constitutes a derivative work. I am assuming an auto-translation is not possible. Please provide some links to support your statement. I found this: http://www.rosenlaw.com/lj19.htm . This whole issue is important to me for other reasons. – Frank Hileman Apr 02 '15 at 20:39
  • Another interesting link: http://www.law.washington.edu/lta/swp/Law/derivative.html – Frank Hileman Apr 02 '15 at 20:42
  • 1
    @FrankHileman: How about "Common derivative works include translations, [...] of preexisting works" (http://copyright.gov/circs/circ14.pdf). A translation to a different programming language is still a translation. – Bart van Ingen Schenau Apr 02 '15 at 20:50
  • @FrankHileman: Note that those links mostly question whether *linking* to another software work (without modifying that work) creates a derived work, like the FSF claims. – Bart van Ingen Schenau Apr 02 '15 at 20:55
  • @BartvanIngenSchenau Yes, I could not find anything about source code. A translation of source code, of course is completely different from a translation of an human language. It is common for algorithms to be reused; how can we tell when source code has been "translated"? Or rewritten? I cannot find any information on this. – Frank Hileman Apr 02 '15 at 20:58
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/22533/discussion-between-bart-van-ingen-schenau-and-frank-hileman). – Bart van Ingen Schenau Apr 02 '15 at 21:01
-2

A copyright applies to the original source code only. I cannot provide legal advice (legally :) ) in my country, but when you use a different language, it is a different body of source code. Ethical considerations are a different matter. I would attempt to use a license that is agreeable to the original authors, to preserve the spirit of the original open source contribution to the community. Additionally, the original authors should be credited.

Frank Hileman
  • 3,922
  • 16
  • 18
  • I was under the impression that a non-cleanroom port to another language constituted a derivative work since the new code would be taking specific implementations from the original, not just inspiration or API similarity. Otherwise evading licenses by porting with a small change would be easy and happen all the time. (I'm not sure who downvoted you, it wasn't me) – Marcus Downing Apr 02 '15 at 16:30
  • 1
    We have to remember that a copyright applies to the text of the source code; it is not like a patent. – Frank Hileman Apr 02 '15 at 16:33
  • Also generally when you code in another language, you cannot reuse any of the original code. That was the assumption in my response. – Frank Hileman Apr 02 '15 at 16:33
  • 1
    @FrankHileman Copyright certainly applies to creative notional content as well; cf. (to pick one example) [*Anderson v. Stallone*](http://en.wikipedia.org/wiki/Anderson_v._Stallone) in which the defendant wrote a *Rocky* sequel and was found guilty of infringement, even though he used nothing verbatim from the text of any other *Rocky* script or recording. Surely the "how similar are the works?" test as part of determining infringement does not merely include verbatim text comparisons. – apsillers Apr 02 '15 at 16:57
  • @FrankHileman: For literary works, translations (to another natural language) are considered derived works for copyright, even if the two languages use completely different writing systems (e.g. English vs Japanese). As copyright laws are the same for literary works and software, your argument doesn't hold. – Bart van Ingen Schenau Apr 02 '15 at 17:02
  • @BartvanIngenSchenau Perhaps you can teach me something new. I am going by what I have learned from my legal books. Please point a link to how we can distinguish between copyrighted and non-copyrighted source code. – Frank Hileman Apr 02 '15 at 20:35
  • @FrankHileman: Where did I talk about non-copyrighted source code? The closest to non-copyrighted that you can get would be when the code is in the public domain. – Bart van Ingen Schenau Apr 02 '15 at 20:46
  • @BartvanIngenSchenau Sorry, the question is, how can we distinguish which part is a derivative work, and which part is not? It seems impossible, since programming languages (and source code) are quite different from a human language. If I copy a routine and change variable names within, how can anyone prove one way or another, that copyright is infringed? I cannot find any definition. – Frank Hileman Apr 02 '15 at 20:51
  • It is rather simple for you to know when you create a derived work: If you take the work from someone else and modify it or build upon it, then you have created a derived work. It can be a lot harder for the original copyright holder to prove that you started with taking their code. That is what fattens the paychecks of lawyers. – Bart van Ingen Schenau Apr 02 '15 at 21:01
  • @BartvanIngenSchenau Augh!!! – Frank Hileman Apr 02 '15 at 21:13
  • @FrankHileman Determining whether something is a derived work depends on a judge's understanding of the facts. There isn't a machine test. If the judge concludes that you took someone else's code and changed variable names, then you would lose. – btilly Apr 06 '15 at 18:22
  • @btilly Yes that was the conclusion I got from the external chat. In fact, I think one would be unlikely to lose if one changed symbol names. I came across a case where there were two expert witnesses, each producing the exact opposite opinion. Without a clear cut copying of text or symbols, apparently it is difficult to prove any copying occurred. – Frank Hileman Apr 07 '15 at 21:18