GPL and Javascript

We at Javeline have released Javeline Platform under the GPL license. However GPL isn’t an easy license and therefor there is much confusion around it. To make matters worse, GPL isn’t written with script languages in mind as it talks about source code and object code. Than there is always the difficult question; Is this a single application or are these different programs talking through each other? I was at ApacheCon here in Amsterdam and got to talk with some OSI members about this subject.

How GPL works

To my opinion GPL is a great license, however it is also a complicated one. The biggest misconceptions about GPL is that is a ‘not for commercial use’ license. This is absolutely untrue. If that true no server running GNU/Linux could be used in a commercial environment, however lots of hosting providers run linux servers and make money.
If fact there is no restriction at all about using GPL licensed software. If you look at the license you’ll see that it really unlike commercial license, that’s because the license isn’t about restricting, but empowering the user. The license breaks down to the following: you can use the software, edit the software and distribute the software freely. When you choose to distribute the software the receiving party will automatically receive the same rights.

Read the previous line carefully. You might notice that I haven’t said anything about how to distribute. If you want to sell the software you can. The only thing you need to remember that the person you’re selling the software to, also has the right to sell it or even give it away for free. But if you add value to it, for instance in the form of an SLA, it could be a good business model.

Another important thing to notice is that you are in no way obligated to distribute any software. So as long as you keep the project within the company when you add propriety code to GPL licensed software, you do not need to disclose anything. If I use a GPL licensed library in my PHP web application, which I run on my own server, I am not distributing the GPLed code.

Client side scripts

The whole story becomes a bit more complicated when GPL is applied to a javascript library. When users are using the library, they will download HTML, CSS images and the javascript library. The first thing to realize is that you are distributing the code. It was on your server and now it on the computer of the user. This gives any user the right to look at the javascript code and reuse it for another project. This means that you can’t obfuscate the javascript code and people can copy/paste it for there own use. This probably how you currently look at javascript anyway. But how about the HTML, CSS and images, can that be publicly used? No it can’t. Those items aren’t code as defined in the GPL license, it should be considered data. Therefor GPL doesn’t ally to that part of the application.

A web application will probably not only have client side code, it will also have a part on the server in the form as PHP (or JSP, or Ruby, or ..) scripts. The big question is, do we need to release that part as well (under GPL license). Although we as developers think of the client and server part being 2 parts of the same application, GPL does not. When using AJAX, the client code is interacting with the server. However you can compare it to any other client/server application. This may be interpreted as 2 applications between which data is transfered, therefor both may have different license. This is called the ‘ASP loophole’ and is as an error by some. When GPLv3 was drawn up, a clear decision was made to not close this loophole.


GPL often strikes fear in the hearts of developers, while this isn’t necessary. The question remains though, if your target group dislikes something should you still go ahead and use it. For now we’ll just stick with GPL and hope it won’t scare away to many potential users.