# GPL license for libraries (#154)

**URL:** <https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178>\
**Category:** Google Group\
**Created:** [January 27, 2016, 2:30pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178 "2016-01-27T14:30:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [January 27, 2016, 2:30pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/1 "2016-01-27T14:30:59Z")

</div>

I reworded the part on licenses in the README file:

Licenses for ATS2

The Compiler (ATS/Postiats): GPLv3  
The source for Libraries (ATSLIB/{prelude,libc,libats}): GPLv3  
The object code for Libraries (ATSLIB/{prelude,libc,libats}): LGPLv2.1  
There is a separate release under the BSD license for the C header files of  
the Libraries, which one can freely insert into the C code  
generated from ATS source code.On Wed, Jan 27, 2016 at 8:34 AM, Kiwamu Okabe [notifi...@github.com](mailto:notifi...@github.com) wrote:

> Thanks. It should be noted in the main README which has contradictory  
> terms.
> 
> Ah… You are right… But it’s Hongwei’s issue…
> 
> —  
> Reply to this email directly or view it on GitHub  
> [https://github.com/githwxi/ATS-Postiats/issues/154#issuecomment-175630663](https://github.com/githwxi/ATS-Postiats/issues/154#issuecomment-175630663)  
> .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [February 11, 2016, 2:35pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/2 "2016-02-11T14:35:37Z")

</div>

Given that we are talking about licenses here, I want to reiterate  
that ATS can be considered a no-runtime and no-library language.

The no-runtime part is easy to understand. ATS is a no-library language  
in the sense that one can easily write ATS programs that do not need to  
be linked to any ATS library code. I often have a mylib.dats file in a  
project.  
For instance,

[https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/SMALL/Calculator/calculator\_mylib.dats](https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/SMALL/Calculator/calculator_mylib.dats)

The following lines are taken from calculator\_mylib.dats:

local  
//  
#include  
“prelude/DATS/filebas.dats”  
//  
in (\* in of [local] \*)  
//  
// HX: it is intentionally left to be empty  
//  
end // end of [local]

These lines allow the compiler to generate the code for some needed ATS  
library functions.  
We can afford this style because the vast majority of ATS library functions  
are templates, which  
do not get to be compiled into object code directly.On Thursday, February 11, 2016 at 4:37:30 AM UTC-5, anonymous anonymous wrote:

> What do you mean? LGPL let’s you link to LGPLed software however you want,  
> but you can’t change the LGPLed software licence and should provide source  
> for the LGPL software (_It applies to LGPL software only_). Other parts,  
> for example your code, could be covered with any licence you want. You also  
> can release your software under LGPL or compatible licence. So what’s the  
> problem?
> 
> On Thursday, February 11, 2016 at 8:41:10 AM UTC+2, Yannick Duchêne wrote:
> 
> > Le mercredi 27 janvier 2016 15:30:59 UTC+1, gmhwxi a écrit :
> > 
> > > The object code for Libraries (ATSLIB/{prelude,libc,libats}): LGPLv2.1
> > 
> > So statically linking to the standard ATS library is not possible?

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [February 11, 2016, 2:44pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/3 "2016-02-11T14:44:25Z")

</div>

> > LGPL is contaminating through static linking. To allow static linking, it  
> > needs a special exception which must be explicitly stated.

Could you show me how this special exception is usually stated?On Thu, Feb 11, 2016 at 9:30 AM, Yannick Duchêne [yannick...@yahoo.fr](mailto:yannick...@yahoo.fr) wrote:

> Le jeudi 11 février 2016 10:37:30 UTC+1, anonymous anonymous a écrit :
> 
> > What do you mean? LGPL let’s you link to LGPLed software however you  
> > want,
> 
> LGPL is contaminating through static linking. To allow static linking, it  
> needs a special exception which must be explicitly stated.
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/0c681f41-99ce-4918-9690-779964c812dc%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/0c681f41-99ce-4918-9690-779964c812dc%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/0c681f41-99ce-4918-9690-779964c812dc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/0c681f41-99ce-4918-9690-779964c812dc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [February 11, 2016, 8:35pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/4 "2016-02-11T20:35:02Z")

</div>

Thanks for all this!

The following exception is now mentioned explicitly:

- As a special exception for Libraries, if other files instantiate  
templates from  
this unit, or you link this unit with other files to produce an  
executable, this  
unit does not by itself cause the resulting executable to be covered by  
the GPLv3.  
However, this exception does not invalidate any other reasons that may  
result in  
the executable file being covered by the GPLv3.On Thu, Feb 11, 2016 at 2:19 PM, Yannick Duchêne [yannick...@yahoo.fr](mailto:yannick...@yahoo.fr) wrote:

> Le jeudi 11 février 2016 17:58:07 UTC+1, anonymous anonymous a écrit :
> 
> > I greatly apologize for my first naive reply. […]
> 
> Don’t mind, you do not need to. There are at some places,  
> oversimplifications of what the GPL and LGPL are about, which make a lot of  
> people overlook most part of it (and even when one carefully read all of  
> it, that’s still hard).
> 
> Le jeudi 11 février 2016 18:06:38 UTC+1, anonymous anonymous a écrit :
> 
> > Ocaml makes a special exception for its LGPL covered library (  
> > [Welcome to a World of OCaml](http://ocaml.org/docs/license.html)). It’s right before the heading of  
> > The Q Public License, version 1.0. I don’t know if it is something that you  
> > and Yannick Duchêne ask but it seems that way. I am just afraid to  
> > misinform you again.
> > 
> > Best regards,  
> > anonymous
> 
> Indeed, static linking exceptions are not rare with LGPL (less with GPL,  
> except in the Ada world, where its near to systematic, for historical  
> reasons). Another point not directly related to this one, if I may, is that  
> anyway, a contaminating license is not well suited for a dynamically linked  
> library, which by definition, can be replaced by anything fulfilling the  
> same interface. This would in turn require the dynamic loader or the  
> application, to check the license of the concrete library found at run  
> time. That’s in my opinion one of the biggest bug in the GPL which states  
> to apply to DLL too, while technically, this makes no sense (unless the  
> dynamic loader of the application checks for it at runtime and refuse to  
> start if the license does not match). The LGPL does not suffer from this  
> issue and is good for that, as it get ride of this paradox, by allowing  
> dynamically linking to anything (which is what DLL are for), hence in my  
> opinion, DLL can (or should) only be LGPL, not GPL. The only issue  
> remaining with LGPL, is when static linking or embedding is technically  
> mandatory, and that’s the case of ATS prelude and its peers, as an example,  
> as no ATS program can work without it. That’s also the case with all  
> runtimes or anything playing the same role.
> 
> I don’t mind excessively, as I believe to understand Hongwei’s intent, he  
> clearly stated multiple time he don’t wish to prevent ATS to be used for  
> commercial applications, except the compiler it‑self, as he own the  
> compiler. But from a legal point of view, this is still an issue, and  
> authors who invest a lot of themselves in something, generally care a lot  
> about legal issues, where supposed intent not explicitly written weight  
> nothing.
> 
> If I pointed at this, that’s because I believe a lot of the people  
> interested in a language like ATS, are authors of actual of future  
> commercial applications.
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [February 11, 2016, 2:30pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/5 "2016-02-11T14:30:44Z")

</div>

> What do you mean? LGPL let’s you link to LGPLed software however you want,

LGPL is contaminating through static linking. To allow static linking, it  
needs a special exception which must be explicitly stated.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [February 11, 2016, 7:19pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/6 "2016-02-11T19:19:45Z")

</div>

> I greatly apologize for my first naive reply. […]

Don’t mind, you do not need to. There are at some places,  
oversimplifications of what the GPL and LGPL are about, which make a lot of  
people overlook most part of it (and even when one carefully read all of  
it, that’s still hard).Le jeudi 11 février 2016 18:06:38 UTC+1, anonymous anonymous a écrit :

> Ocaml makes a special exception for its LGPL covered library (  
> [Welcome to a World of OCaml](http://ocaml.org/docs/license.html)). It’s right before the heading of The  
> Q Public License, version 1.0. I don’t know if it is something that you and  
> Yannick Duchêne ask but it seems that way. I am just afraid to misinform  
> you again.
> 
> Best regards,  
> anonymous

Indeed, static linking exceptions are not rare with LGPL (less with GPL,  
except in the Ada world, where its near to systematic, for historical  
reasons). Another point not directly related to this one, if I may, is that  
anyway, a contaminating license is not well suited for a dynamically linked  
library, which by definition, can be replaced by anything fulfilling the  
same interface. This would in turn require the dynamic loader or the  
application, to check the license of the concrete library found at run  
time. That’s in my opinion one of the biggest bug in the GPL which states  
to apply to DLL too, while technically, this makes no sense (unless the  
dynamic loader of the application checks for it at runtime and refuse to  
start if the license does not match). The LGPL does not suffer from this  
issue and is good for that, as it get ride of this paradox, by allowing  
dynamically linking to anything (which is what DLL are for), hence in my  
opinion, DLL can (or should) only be LGPL, not GPL. The only issue  
remaining with LGPL, is when static linking or embedding is technically  
mandatory, and that’s the case of ATS prelude and its peers, as an example,  
as no ATS program can work without it. That’s also the case with all  
runtimes or anything playing the same role.

I don’t mind excessively, as I believe to understand Hongwei’s intent, he  
clearly stated multiple time he don’t wish to prevent ATS to be used for  
commercial applications, except the compiler it‑self, as he own the  
compiler. But from a legal point of view, this is still an issue, and  
authors who invest a lot of themselves in something, generally care a lot  
about legal issues, where supposed intent not explicitly written weight  
nothing.

If I pointed at this, that’s because I believe a lot of the people  
interested in a language like ATS, are authors of actual of future  
commercial applications.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [February 11, 2016, 6:41am UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/7 "2016-02-11T06:41:09Z")

</div>

> The object code for Libraries (ATSLIB/{prelude,libc,libats}): LGPLv2.1

So statically linking to the standard ATS library is not possible?

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [February 12, 2016, 2:32am UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/8 "2016-02-12T02:32:25Z")

</div>

I re-read the “special exception” many times.

Following is the current version:

As a special exception, if you link the object code for Libraries with  
other files to create an executable,  
then the linking does not by itself cause the executable to be covered by  
LGPLv2.1. However, this exception  
does not invalidate any other reasons that might result in the executable  
being covered by LGPLv2.1.

Based on my understanding of GPL, it is a logical consequence (rather than  
an exception) that the code  
generated from ATS source fully belongs to the author of the source,  
regardless whether templates in ATSLIB  
are instantiated in the source or not. This is due to the generated code  
containing no ATS source code for the  
involved templates.

After this exercise, I think I have gained much better understanding of GPL  
and LGPL. There are definitely some  
gray areas :)On Thursday, February 11, 2016 at 3:35:03 PM UTC-5, gmhwxi wrote:

> Thanks for all this!
> 
> The following exception is now mentioned explicitly:
> 
> - As a special exception for Libraries, if other files instantiate  
> templates from  
> this unit, or you link this unit with other files to produce an  
> executable, this  
> unit does not by itself cause the resulting executable to be covered by  
> the GPLv3.  
> However, this exception does not invalidate any other reasons that may  
> result in  
> the executable file being covered by the GPLv3.
> 
> On Thu, Feb 11, 2016 at 2:19 PM, Yannick Duchêne \<yannick\_…\> wrote:
> 
> > Le jeudi 11 février 2016 17:58:07 UTC+1, anonymous anonymous a écrit :
> > 
> > > I greatly apologize for my first naive reply. […]
> > 
> > Don’t mind, you do not need to. There are at some places,  
> > oversimplifications of what the GPL and LGPL are about, which make a lot of  
> > people overlook most part of it (and even when one carefully read all of  
> > it, that’s still hard).
> > 
> > Le jeudi 11 février 2016 18:06:38 UTC+1, anonymous anonymous a écrit :
> > 
> > > Ocaml makes a special exception for its LGPL covered library (  
> > > [Welcome to a World of OCaml](http://ocaml.org/docs/license.html)). It’s right before the heading of  
> > > The Q Public License, version 1.0. I don’t know if it is something that you  
> > > and Yannick Duchêne ask but it seems that way. I am just afraid to  
> > > misinform you again.
> > > 
> > > Best regards,  
> > > anonymous
> > 
> > Indeed, static linking exceptions are not rare with LGPL (less with GPL,  
> > except in the Ada world, where its near to systematic, for historical  
> > reasons). Another point not directly related to this one, if I may, is that  
> > anyway, a contaminating license is not well suited for a dynamically linked  
> > library, which by definition, can be replaced by anything fulfilling the  
> > same interface. This would in turn require the dynamic loader or the  
> > application, to check the license of the concrete library found at run  
> > time. That’s in my opinion one of the biggest bug in the GPL which states  
> > to apply to DLL too, while technically, this makes no sense (unless the  
> > dynamic loader of the application checks for it at runtime and refuse to  
> > start if the license does not match). The LGPL does not suffer from this  
> > issue and is good for that, as it get ride of this paradox, by allowing  
> > dynamically linking to anything (which is what DLL are for), hence in my  
> > opinion, DLL can (or should) only be LGPL, not GPL. The only issue  
> > remaining with LGPL, is when static linking or embedding is technically  
> > mandatory, and that’s the case of ATS prelude and its peers, as an example,  
> > as no ATS program can work without it. That’s also the case with all  
> > runtimes or anything playing the same role.
> > 
> > I don’t mind excessively, as I believe to understand Hongwei’s intent, he  
> > clearly stated multiple time he don’t wish to prevent ATS to be used for  
> > commercial applications, except the compiler it‑self, as he own the  
> > compiler. But from a legal point of view, this is still an issue, and  
> > authors who invest a lot of themselves in something, generally care a lot  
> > about legal issues, where supposed intent not explicitly written weight  
> > nothing.
> > 
> > If I pointed at this, that’s because I believe a lot of the people  
> > interested in a language like ATS, are authors of actual of future  
> > commercial applications.
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “ats-lang-users” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/0e0e4450-0d68-4848-b318-f8ae1303275d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [February 11, 2016, 3:02pm UTC](https://discourse.ats-lang.org/t/gpl-license-for-libraries-154/178/9 "2016-02-11T15:02:40Z")

</div>

> Given that we are talking about licenses here, I want to reiterate  
> that ATS can be considered a no-runtime and no-library language.

Well, when I re‑think about it, yes: the ATS source appears nowhere in the  
generated C source. But that’s a bit ambiguous as the source is the ATS  
source, not the generated C source, so more explicit wording allowing this,  
would help to feel assured.Le jeudi 11 février 2016 15:44:27 UTC+1, gmhwxi a écrit :

> > > LGPL is contaminating through static linking. To allow static linking,  
> > > it needs a special exception which must be explicitly stated.
> 
> Could you show me how this special exception is usually stated?

There is the example of wxWidget :

> <https://softwareengineering.stackexchange.com/questions/179084/is-there-a-modified-lgpl-license-that-allows-static-linking>

(in the answer, not in the question). By the way, a special exception may  
as much be applied to raw GPL, as  
here: [Intuitionistic fuzzy sets, logic, numbers, lingustic variables](http://www.dmitry-kazakov.de/ada/fuzzy.htm) .
