Sunday, February 8, 2009

FUD Over JavaScript and GPL

Far Side comics about CAT FUD Recently I published a tiny JavaScript library jintervals for doing formatting of time intervals. At first I published it under GPL license, thinking this is the rightest thing to do. After all, the Free Software Foundation itself suggests that you do.

But then some said, that using GPL for my library is far too restrictive, and by doing so I would ban all the potential commercial uses of my library.

This can’t be true, I thought. But then I did some research and decided to change my license to LGPL. Not because I was wrong, but because too many other people were wrong.

The Misinterpretation of GPL

GPL v3 logo Everybody knows that GPL is viral. But what most people doesn’t know, is how infective it exactly is.

It's the same with real world viruses. Most people are afraid of coming to contact with person who has HIV, although you won’t get infected by just touching. But the fear, uncertainty and doubt are all there, saying, that you better stay away.

Similarly many people are afraid of using GPL-ed components when building their website. They think that then they have to release all the code of their website also under GPL.

They are totally wrong, because all free software licenses allow you to use and modify the program how ever you may please. These are the freedoms 0 and 1:

The freedom to run the program, for any purpose (freedom 0).

The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.

GPL will only concern you, when you want to distribute your software. And running a website powered by GPL-licensed software is not distributing. There is even a FAQ about this on GNU homepage:

A company is running a modified version of a GPL'ed program on a web site. Does the GPL say they must release their modified sources?

The GPL permits anyone to make a modified version and use it without ever distributing it to others. What this company is doing is a special case of that. Therefore, the company does not have to release the modified sources.

And contrary to what most people think, GPL is not the most restrictive free software license. If you want a really restrictive license, then you should choose GNU Affero GPL – running a website powered by AGPL-ed software, does require that you publish all your sources. The same GNU FAQ goes on to suggest using AGPL:

It is essential for people to have the freedom to make modifications and use them privately, without ever publishing those modifications. However, putting the program on a server machine for the public to talk to is hardly “private” use, so it would be legitimate to require release of the source code in that special case. Developers who wish to address this might want to use the GNU Affero GPL for programs designed for network server use.

Most people haven’t even heard of AGPL, they only know about GPL. And because GPL is the only viral license they know about, they think, that it must be the most infectious thing on the planet.

Ext JS GPL Controversy

Ext JS logo Some time ago the licensing of Ext JS framework was changed to GPL and a whole hell broke loose. Hundreds of users wrote to a fairly long Ext forum thread, seeking answers to their questions about the new licensing model.

Ext JS licensing has been a mess. Previously Ext JS was seemingly licensed under LGPL, but with several extra restrictions:

Ext is also licensed under the terms of the Open Source LGPL 3.0 license. You may use our open source license if you:

  • Want to use Ext in an open source project that precludes using non-open source software

  • Plan to use Ext in a personal, educational or non-profit manner

  • Are using Ext in a commercial application that is not a software development library or toolkit, you will meet LGPL requirements and you do not wish to support the project

Many users were unhappy about it, claiming either, that Ext JS is not free software at all, or that because of some clauses in LGPL, users are allowed to freely remove the extra clauses added to LGPL.

Anyway, most people were quite happy, because they knew that LGPL is a light version of GPL and therefore harmless.

Then came the license change, people saw the terrible viral GPL and went completely nuts. They were wondering, do they have to publish all the source code of the web site they were using GPL-ed Ext JS on, or do they have to buy a commercial license for that?

Given that most people aren’t experts in GPL, this was completely normal. But it wasn’t normal that the authors of Ext JS didn't gave any clear answer to these questions. They pointed people to the Licensing FAQ, which for some reason doesn't provide answer to the real most frequently asked question: Can I use the GPL licensed Ext JS on my website without publishing all the source code of my site?

This kind of attitude received huge amounts of criticism from the community. Authors of Ext JS were blamed to be stupid and greedy.

The license change from false-LGPL to true GPL was certainly step in the right direction, but it was presented to the community with a great dose of FUD. Not a nice thing to spread Jack, not a nice thing to spread...

Is GPL Worth the Trouble?

Ext JS isn’t the only JavaScript library licensed under GPL, there are more, and none of those seems to suffer under similar issues that Ext JS is. The reason? Honesty. Just look at how GPL-licensed jQZoom Evolution describes itself (emphasis added):

jQZoom Evolution is a new release of jQZoom with full featured. It is a javascript image magnifier built at the top of the popular jQuery javascript framework. jQzoom Evolution is a great and a really easy to use script to magnify what you want. It is easy to customize and it works on all modern browsers. This software is licensed under GPL. You can have your jQZoom in your website, eCommerce sites or whatever you want.

However most JavaScript libraries prefer more permissive LGPL, MIT and BSD licenses. And for a very good reason – no damn confusion whatsoever.

And this is the reason, why my jintervals library is also licensed under LGPL – to avoid needless confusion.


  1. The confusion over GPL is not by FUD, but by the users that apply the license. It's up to the license holder to enforce the terms. Just because jQZoom says "You can have your jQZoom in your website, eCommerce sites or whatever you want." does not mean you don't have to abide by the terms of the GPL. Any IP attorney is going to say this is too vague, you cannot use this software unless they have an alternative license (ie Commercial, or more permissive license).

    More importantly, the fundamental issue is not whether you need to GPL your code, but that you might have to PAY to keep your code private.

    Its seems pretty hypocritical to talk about freedoms, when the freedom they (the ones that dislike the GPL) wish to have, is not about the code, but rather the ability to commercialize someones work for free.

    This is not a "free"dom that is granted by the GPL. The GPL could care less about the user's intentions. It's the CODE that must be free (as in freedom).

    Ext JS is a great piece of software, and those looking to implement it in a non opensource fashion, have the ability to purchase a license to support Jack and Co. This is "fairdom" amd "freedom" - for commercial ventures and for the code.

  2. Are you saying, that you cannot use GPL software on a commercial website?

  3. "GPL will only concern you, when you want to distribute your software. And running a website powered by GPL-licensed software is not distributing."

    No not a website software that runs on your server. But your javascript needs to be downloaded to the users browser, aka distributed. You are misinformed and comparing apples to eggs.

  4. I agree. It IS distributing. However I wonder: the spirit of the GPL is (used to be??) to allow the user to modify the source code, so that she isn't "locked" with the vendor's (here: website's). I note that 1) even obfuscated, the received JS is still source code, so she could modify it; 2) the website doesn't link the scripts together, the user's browser does. So, technically speaking, she isn't locked with the website code, she has the means to replace it with her own even if non-GPL JS code uses GPL JS code -I believe-. I think that compares to using dynamic linking libs that are GPL, within a non-GPL app, but IANAL. Well I hope I'm correct because I found "Apache" or "BSD"/"MIT" licensed open source projects that make use of GPL (not LGPL) JS in an non-obvious way (perhaps developed by license-illiterate developers), thus if I'm wrong every organization using those would potentially be at risk!

  5. It‘s actually a nice and useful piece of information. I am glad that you shared this useful info with us. Please keep us up to date like this. Thanks for sharing.
    Windows Helpline Number US +1-844-442-0111