Closed Bug 1620332 Opened 6 years ago Closed 6 years ago

Licensing query re 500 lines of public-domain AVL-tree C code

Categories

(mozilla.org :: Licensing, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jseward, Assigned: mhoye)

Details

I'm on the WebAssembly sub-team of the JS team. I am looking at the possibility of
taking about 500 lines of ANSI C which forms the core of an AVL-tree library (insert
and delete functions only), and translating it into Rust, which I think will majorly
modify the original. The point is to add it to one of the register allocators that
we are developing for Cranelift, which has an Apache 2 license.

I tried hard to find a suitable AVL tree library with an Apache 2 license
(in whatever language), that I can start from. The closest I came was

https://commons.apache.org/proper/commons-math/javadocs/api-3.2/src-html/org/apache/commons/math3/geometry/partitioning/utilities/AVLTree.html#line.37

which is actually from the Apache Foundation itself, but for technical reasons I don't
want to start with their code. However I did chase the reference there to "Georg Kraml",
and it is his implementation I want to start from.

Unfortunately Kraml's site is long since gone, and I had to dig it up on the Wayback
Machine. That gives complications of its own. The basic reference is:

https://web.archive.org/web/20010419134337/http://www.kraml.at/georg/avltree/index.html

which contains the text
The implementation is in the Public Domain.

and the actual source is the first 500 or so lines of

https://web.archive.org/web/20030926063347/http://www.kraml.at/georg/avltree/avlmonolithic.c

An older snapshot of "kraml.at" contains a more convincing statement about licensing:

https://web.archive.org/web/20030401124003/http://www.kraml.at/src/howto/

I grant all C code on this server to the Public Domain; feel free 
to use, modify, or redistribute it in whatever way you see fit.
I politely ask, however, that you let me know if you incorporate 
some of my code into any project of significance, so as to boost
my delicate ego. I also politely ask that you report any bugs you
find. Thank you.

but unfortunately there are no sources there (!). Something of a bummer, that
there's no one snapshot that offers both the sources and the better statement
about licensing.

Please advise. Thank you!

Rust is different enough from C that I would not be able to call a re-implementation of a particular algorithm a translation.

I believe that because the original implementation of the algorithm is in the public domain, and that our re-implementation is going to be in an entirely different language, and the functionality trivial enough, that it is reasonable to cover this new work under an different libre license. There's certainly no harm being done.

Our runbook suggest "best-fit" license selection for this, based on an evaluation of the ecosystem in which this code is participating; if this is going to be part of Cranelift's code generation utility, I believe the right licensing choice here is the same as Cranelift, Apache2 with the LLVM Exception.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.