39

This answer on Chess Stack Exchange comes from the lead developer of a webapp for learning chess that integrates a version of Stockfish (a popular chess-playing program released under GPLv3) transpiled into Javascript and minified.

The developer makes some claims about the GPLv3 terms that conflict in part with my understanding:

There are no license issues here. GPU [presumably a typo for GPL] requires only the release of the source code if you receive the software. In [app name]'s case, the server is hosted internally. All you get are web pages.

Technically you do have the code because the whole UI in JavaScript is being sent to your web browser. Check your Google Chrome network tab, you will find all the JS source code there! We are doing client side JS Stockfish integration, so we can't stop you from copying the minified but working JS code. However, we are not going to give you the code like in GitHub format.

JavaScript files are script files they are not a binary program. GPL doesn’t work here. Unless there is a statically linked binary here GPL doesn’t have any influence

So the developer claims that:

  1. Distributing their (presumably modified, at least because of the transpilation?) version of Stockfish in minified form only is sufficient to comply with GPLv3.
  2. They do not need to distribute the (non-minified) source of the rest of their webapp, even if it is Javascript that calls Stockfish directly and integrates with the engine.
  3. The GPL only "kicks in" when one distributes binaries, not Javascript code, because Javascript code is already source code (even if minified).

Are these claims correct?

3
  • @user3840170 (in case you see this) thanks for your corrections; I have adopted most of them, but I prefer to stick with the standard capitalization for the word "Javascript". Mar 29, 2021 at 15:09
  • Good question. But maybe you accepted the answer too early? The answer by user3840170 has the canonical link to official position, mentioning that minified Javascript is NOT considered a valid source code for GPL. Mar 29, 2021 at 21:46
  • @PeterM Both answers contain good points; I wish I could accept both. Mar 29, 2021 at 21:48

2 Answers 2

43

Argument #2 has credibility, depending on many factors. The other two arguments you present in your question are not correct.

Dealing with arguments #1 and #3 first:

In the poster's own words, the GPL

requires only the release of the source code if you receive the software

and indeed you have received it! If a minified form of GPL-licensed code resides on the user's computer memory, they have unambiguously received that code and they are entitled to receive the source code, i.e., whatever is the "preferred form for making modifications to it".

The minified code is certainly not the source code. The first sentence of section 1 of the GPLv3 says

The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.

The case they describe is unambiguously distribution, and material being distributed is not source code as the GPL defines it, so it must come with corresponding source.

And with less certainty, argument #2:

What is less clear is how much code needs to be shared under the GPL. Certainly the app's author is responsible for making sure the user can get the source code for Stockfish itself. The author is also responsible for sharing under the GPL the source form of any code that forms a derivative work with the GPL engine. Any material that is a separate work under copyright law does not need to be under the GPL nor have corresponding source. The conditions under which some code forms a new derivative with a library can be unclear, and can vary by jurisdiction and specific technical process.

If the code is all minified together in a single file, I'd say there's a strong argument to be made that it's a derivative work. However, running Stockfish on a separate process (as a Web Worker, perhaps) helps the argument that it's a separate program.

In particular, chess programs can use the Universal Chess Interface (UCI) to communicate moves, which allows logical components to be strongly decoupled from UI components. The use of UCI is probably not inherently sufficient to prove the separation of works -- i.e., if I consider the question, "Can two pieces of code which communicate through UCI ever possibly be arranged to force them to be a single work under copyright?" from an adversarial perspective, I must admit my answer is, "Yes, such configurations exist" -- but the use of a standard interface surely strengthens the argument for separation considerably.

So, in general, there is an open question, for me, of how much needs to be provided because it forms a combined work that resides in the user's memory. The amount of distributed GPL material is clearly nonzero, but it may (or may not) extend beyond Stockfish itself.

30

It’s certainly not correct to claim minified JavaScript is source code.

The GPL (both version 2 and 3) defines ‘source code’ as

the preferred form of the work for making modifications to it.

It doesn’t matter if the program is a binary executed by the CPU or text interpreted by a JavaScript runtime; what matters is that the structure of the program be legible to someone who might want to modify it. Minified JavaScript is clearly not a form that conveys this structure clearly, and so it cannot be considered ‘source code’ according to the GPL.

It is also an explicit position of the FSF (who authored the license) that minified JavaScript does not constitute ‘source code’. Richard Stallman writes in ‘The JavaScript Trap’:

The source code of a program means the preferred form for programmers to modify—including helpful spacing, explanatory remarks, and meaningful names. Compacted code is a bogus, useless substitute for source code; the real source code of these programs is not available to the users, so users cannot understand it; therefore the programs are nonfree.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.