GPL, MIT, Apache… This article explains the differences between open source protocols

Directory

  • 1. GPL, MIT, Apache… This article explains the differences between open source protocols
    • 1.1. GPL-mandatory open source-linux
    • 1.2. LGPL-allowing companies to sell GPL for money-Qt
    • 1.3. MIT-a loose protocol popular with companies-vue
    • 1.4. BSD-Don’t use my reputation for publicity!
    • 1.5. Apache-Strengthening Legal Propaganda-PaddlePaddle
    • 1.6. WTFPL-a weird protocol that I don’t even dare to write the full name of

1. GPL, MIT, Apache… This article explains the differences between open source protocols

Should individual developers choose the GPL license or the MIT license?
Why can Xiaomi avoid open source agreements?
Android is open source, why does Huawei still build its own Hongmeng?
Do you know the weirdest open source agreement in history?

These questions will be answered in this article.
Open source is the path chosen by many individual developers.

Open source can not only help the entire ecosystem make progress together, but also help individual developers improve their technology and reputation. This can be seen from vue.

However, open source does not mean that there are no rules. Everything is provided for free and unconditionally to others, and certain rules must be followed. This rule is the Open Source License.

There are probably hundreds of open source protocols in the world, but only 5 or 6 are commonly used. Many articles on the Internet only give a general introduction, and do not clearly explain the key differences between these protocols, as well as the benefits and benefits of each protocol to developers. limit.

In order to help developers distinguish between these protocols, this article introduces several common protocols, including the principles that need to be followed and the code bases that currently use these protocols.

1.1. GPL-mandatory open source-linux

GPL (GNU General Public License): GNU General Public License.

The purpose of the GPL agreement is to force code to be open source and free to use.

Its biggest feature is the “infectiousness of open source”. In other words, assuming that a company uses a code base with a GPL license, it theoretically must also open source its own code base.

Note, this is theoretical.

In fact, there are many ways for large companies to circumvent this restriction.

For example, in 2015, Xiaomi was accused of violating the GPL agreement. The MIUI system was developed based on Android, and the kernel Linux followed the GPL agreement, so Xiaomi must also open source its MIUI system.

But the answer given by Xiaomi is that “it will be open source soon.” This is very fast and will be delayed slowly. Anyway, I don’t deny that it will be open source in the future.

In addition, large companies may choose to maintain a set of closed source commercial code for themselves.

For example, the most famous AOSP (Android Open-Source Project) and Android.

AOSP is an open source Android system, and the word Android has become a trademark of Google, as well as a large system with some software such as GMS attached.

What do you mean? The system that we think is open source is actually like a rough house, while Android, which actually has Google Family Bucket and other software attached, is a hardcover house, and the hardcover part is not open source.

This is why Huawei insists on developing its own operating system based on AOSP. If you don’t do this, you will die immediately as long as Google bans you from using Android.

Just to tell a joke, the GPL agreement does not restrict you from selling money.

In other words, in theory, you can sell the original open source Linux system to others. Of course, whether there are buyers is another matter.

1.2. LGPL-allowing companies to sell GPL for money-Qt

Due to the “open source contagion” of the GPL agreement, some companies will definitely not be able to accept open source their own code. How can they make money?

So LGPL (GNU Lesser GPL) appeared, which is a GPL with fewer restrictions (for companies that want to sell closed source for money).

If a company just wants to use a certain LGPL-licensed code base without modifying it, it can use this agreement.

Specifically, if you use a dynamically linked LGPL code base, you don’t need to be open source.

If you use static linking, you can avoid open source by encapsulating a layer. It can be simply understood that you only need to open source the part of the code that directly calls the LGPL library.

Is it a bit difficult to understand? It doesn’t matter. Let’s give an example.

Suppose there is an LGPL library named LibA, and now you use this library in the source file main.cpp, as follows:

int main() {<!-- -->
    LibA.init();
    LibA.DoSomething();
}

According to the LGPL agreement, your source file must be open source, because it directly calls the LibA code.

How to avoid it? Encapsulation!

You write another wrapper file wrapper.cpp, as follows:

void my_libA_init() {<!-- -->
    LibA.init();
}
void my_libA_DoSomething() {<!-- -->
    LibA.DoSomething();
}

Next, use this in your main.cpp:

int main() {<!-- -->
    my_libA_init();
    my_libA_DoSomething();
}

Then, you only need to open source wrapper.cpp, but not main.cpp. This avoids open source the upper-level logic you want to hide, and can be sold as commercial software.

The famous GUI development framework Qt uses the LGPL license.

1.3. MIT-a loose protocol popular with companies-vue

MIT (The Massachusetts Institute of TechnologyLicense, MIT License Agreement) is one of the many agreement terms that is widely used. Compared with other common software license agreements, MIT is a relatively loose software license agreement.

The MIT license allows you to use, copy, and modify the original MIT code base at will. You can sell it for money or make it open source. The only principle you need to follow is to state in your software that you are also using the MIT license.

Many companies prefer the MIT protocol when choosing open source products, because they can fully control these third-party codes and can modify or re-develop them when necessary.

The UI framework VUE and scripting language Lua use the MIT protocol.

1.4. BSD-Don’t use my reputation for publicity!

The protocol has gone through several variations, and is no longer much different from the MIT protocol. The only small difference is that BSD requires developers not to use the name of their predecessors for publicity. For example, I cannot promote my software in the name of such-and-such upgraded version or so-and-so enhanced version.

1.5. Apache-Strengthening Legal Propaganda-PaddlePaddle

The MIT and BSD protocols have one characteristic: simplicity.

This feature has two sides. On the one hand, as an individual developer, you can safely use the MIT or BSD license without worrying about the legal risks behind it. On the other hand, large companies will worry about being “overly loose” when they open source their own software. This resulted in some legal disputes.

Hence, the Apache protocol emerged.

On the basis of maintaining a relatively loose open source, some restrictions are added to avoid legal conflicts.

For example, it is required that in each license file, any original copyrights, patents, trademarks, etc. in the redistributed code must be retained.

Therefore, large companies often prefer to use the Apache protocol rather than the slightly obscure MIT protocol.

Baidu’s deep learning framework PaddlePaddle uses the Apache protocol.

1.6. WTFPL-a weird protocol that I don’t even dare to write its full name

If you feel that none of the above protocols are free and you advocate absolute freedom and open source, then this protocol is perfect for you.

The WTFPL protocol is currently the weirdest agreement, and it’s weird for two reasons.

The first point is that there is actually nothing in this agreement, here is what the agreement is.

Since there are too many sensitive words here, I won’t translate them word for word.

From https://codedocs.org/what-is/wtfpl

 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                   Version 2, December 2004
 
Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and verbatim or modified distribute
copies of this license document, and changing it is allowed as long
as the name is changed.
 
           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.

The general meaning is: you can do whatever you want, you can change the code at will, and you can also change the protocol content at will.

The second weird point is.

This protocol is a certified protocol. …

Now, do you understand the differences between different open source protocols?