Econometrics and Free Software by Bruno Rodrigues.
RSS feed for blog post updates.
Follow me on Mastodon, twitter, or check out my Github.
Check out my package that adds logging to R functions, {chronicler}.
Or read my free ebooks, to learn some R and build reproducible analytical pipelines..
You can also watch my youtube channel or find the slides to the talks I've given here.
Buy me a coffee, my kids don't let me sleep.

R, its license and my take on it


Foreword: This is not a tutorial nor anything like that. I’m going to talk about free software, open source, and their licenses. I’m going to give my (non-)expert opinion on it. You may find, after having finished reading this post, that I wasted your time. So only read if by some miracle the first sentence of the foreword excited you. If not, close this tab and go back now. It’s not too late.

Foreword 2: I’ve updated the post on October 24th with an additional meme, clarifications and a link to an interesting stackexchange discussion.

Free software ain’t free

Let me first re-iterate that free software and open source are not the same thing. Free software is open source, but not every piece of open source software is free. Open source means that the source code of a piece of software is available and can be consulted without much hurdles. It also means, usually, that you can take these pieces of software, modify them, and redistribute them without much hurdles either.

Free software is like open source software, but it’s much more restrictive. That may seem surprising, because there’s the word free in there, so how could it be more restrictive than open source software? Consider the following: I can take a piece of open source software (typically licensed under something like the MIT licenses or the BSD licenses) and re-release it with a proprietary license and sell it. I don’t actually even need to change anything substantial to the source code. I take that piece of software (which I may or may not modify), repackage it under a new name and sell it. Free software allows all of this as well (I literally could sell the Linux kernel on this website if I found people willing to pay me for it), but what it does not allow is only this: I cannot distribute (by selling or for free) the program without its source code. So if I sold the Linux kernel on here, I would need to also give out a copy of the source code with it, and this obviously would also still be necessary if I actually changed something to the source code of the Linux kernel.

R is licensed under a Free Software license, the GPL v2, which means that it’s illegal for anyone to rebrand it, package it and sell it without providing the source code of their (modified) version of R. Thanks to something like the GPL, it is impossible for companies to employ what is called Embrace, Extend and Extinguish, which is a strategy that Microsoft used in the past. It consists in embracing a piece of software, extending it with proprietary bits of code and technology, use their dominant position on the desktop to impose their new version that relies on proprietary bits (or which is 100% proprietary) and then extinguish the open source version (in the sense that no one will use it anymore because it virtually became incompatible with the newly imposed Microsoft version).

Now some of you may now be thinking that I’m stuck in the 90’s, after all, Microsoft have been the good guys for a decade now. They contribute to open source software (not free software), have bought Github and have not ruined it (yet) and they even included the possibility to run Linux inside Windows using WSL. So what am I afraid of? Why don’t I trust them?

All licenses have their place, but…

The thing is, I shouldn’t have to trust anyone not to fuck up a piece of free software. Maybe the current management of Microsoft is not hostile to free software, but maybe that’ll change in the future. That’s not really the point. The point is that I don’t need to have to trust them, and I’m happy that a fundamental, crucial piece of software like R uses something like the GPL. But that doesn’t mean that everything should be licensed under the GPL. For example, as far as I know, every package of the {tidyverse} uses an MIT license. So just because R is licensed under the GPL doesn’t mean that its packages all have to be GPL. But I must also admit that while I see why a company like Posit releases their packages under a permissive license, I don’t see why an independent developer would do that. I absolutely do not see what independent developers gain from releasing the code of their packages under anything else than the GPL. (As an aside, go read this… code under a permissive license taken from an independent developer? check. Nothing was given back to the community? check. The code in question was used for nefarious purposes? check. Original developer on massive amounts of copium? check). But, to be fair, I have a grand total of two (2) packages on CRAN that likely get less than 10 downloads a year, so what do I know. One of the arguments I’ve heard is that the GPL is not really free, because it restricts users from taking the code and releasing it under a proprietary license, so akshually the MIT/BSD licenses are really the free ones, and if I like freedom so much I should be using FreeBSD instead of a Linux distro and release my packages under a MIT/BSD license. I want to ask people that make this argument if they would allow the Nazi party to make a come back in their countries legislature, then.

That being said, I do release stuff with permissive licenses. For example the content of this blog or for the courses I teach are under the WTFPL, which is, I would say, the only acceptable permissive license for independent developers. If the name of the license was not explicit enough, the comic below illustrates what the WPTFL is all about:

Can R be used to write proprietary code

Yes, you can write proprietary code using R. Microsoft has done so, for example their {RevoUtilsMath} package is, as far as I know, proprietary, and I’m sure that it includes some R code. I’m pretty sure it would also be possible to even build a proprietary program that would require the R interpreter to be bundled to run. As long as the developers of this tool would:

  • Release their modified version of R with it (if they modified it);
  • Tell their users that their program runs with R, and thus also distribute R and its license;

R could likely be downloaded at install time in cases like this, again, as long as the users get notified that it’s needed. I doubt that the rest of the program would need to be licensed under the GPL, since no code of R itself has been modified.

But I’m not that certain on this last point, so any comments welcome (on here).

EDIT: There’s this interesting discussion on stackexchange here and it would seem that the answer is not clearcut, but, it depends. Hence why companies prefer working using permissive licenses, to avoid these types of discussions.

That’s it, that’s the blog post. Thank GNU for the GPL.

Hope you enjoyed! If you found this blog post useful, you might want to follow me on twitter for blog post updates and buy me an espresso or, or buy my ebook on Leanpub. You can also watch my videos on youtube. So much content for you to consoom!

Buy me an EspressoBuy me an Espresso