# What is the license of generated code?

**URL:** <https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077>\
**Category:** Rails\
**Created:** [May 10, 2006, 12:42am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077 "2006-05-10T00:42:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 12:42am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/1 "2006-05-10T00:42:06Z")

</div>

I’m trying to figure out what the software license would be for code  
(scaffolds, etc) generated by Rails.

Basically, if I set up a Rails project, can or should I be able to claim  
copyright (and therefore have the ability to license under e.g. GPL)  
over the files generated by :-

- The “rails” command that creates the initial tree of files
- The output of “generate scaffold”
- The output of the third-party “generate ajax\_scaffold”

In other words, how should I distribute all the files that constitute my  
software?

In practice, just checking everything into svn whether it was  
auto-generated or not seems to be the norm, and while I’m happy to do  
that, it’s not clear to me what licenses apply to such code.

If anyone has really thought about this, please share your experiences!

-jim

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 3:18am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/2 "2006-05-10T03:18:03Z")

</div>

On Tuesday, May 09, 2006, at 11:41 PM, Jim C. wrote:

> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

My guess is that all generated code would have the same license as rails  
itself, which is MIT IIRC.

\_Kevin

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 4:19am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/3 "2006-05-10T04:19:28Z")

</div>

> My guess is that all generated code would have the same license as rails  
> itself, which is MIT IIRC.
> 
> \_Kevin

This may be true it may not be, I wouldn’t make any assumptions about  
this.

The pregenerated code is nothing more than the output of a program based  
on your input. The output of a program is generally considered to be  
owned by user not the application developer.

I’d be very interested in seeing more discussion on this…

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 4:48am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/4 "2006-05-10T04:48:50Z")

</div>

> Basically, if I set up a Rails project, can or should I be able to claim  
> copyright (and therefore have the ability to license under e.g. GPL)  
> over the files generated by :-
> 
> -jim

I usually prefer the GPL but I don’t see any problem with using the MIT  
license for scripted web applications.

The primary thing the GPL brings over the MIT is a guarantee the end  
user will get the source code.

In the case of a rails app it’s a bit hard to not give them the source.

It’s a lot easier to just use the MIT license.

There’s the added benifit that if you actually do write a useful chunk  
of code it’s more likely that the Rails community would be able to  
re-use it.

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 4:46am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/5 "2006-05-10T04:46:55Z")

</div>

Jim C. wrote:

> I’m trying to figure out what the software license would be for code  
> (scaffolds, etc) generated by Rails.
> 
> Basically, if I set up a Rails project, can or should I be able to claim  
> copyright (and therefore have the ability to license under e.g. GPL)  
> over the files generated by :-

I usually prefer the GPL but I don’t see any problem with using the MIT  
license for scripted web applications.

The primary thing the GPL brings over the MIT is a guarantee the end  
user will get the source code.

In the case of a rails app it’s a bit hard to not give them the source.

It’s a lot easier to just use the MIT license.

There’s the added benifit that if you actually do write a useful chunk  
of code it’s more likely that the Rails community would be able to  
re-use it.

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 5:35am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/6 "2006-05-10T05:35:29Z")

</div>

On Tuesday, May 09, 2006, at 8:07 PM, Jeremy K. wrote:

> > > - The “rails” command that creates the initial tree of files
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

So following that links logic, a substantial portion of the generated  
code is ‘copied’ into the scaffold files. For the most part scaffolds  
just substitute variables into text templates within the code. It could  
be construed to suggest that the generated code is subject to the  
original licsense.

\_Kevin

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 5:08am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/7 "2006-05-10T05:08:08Z")

</div>

On May 9, 2006, at 6:14 PM, Kevin O. wrote:

> > - The output of “generate scaffold”  
> > If anyone has really thought about this, please share your  
> > experiences!
> 
> My guess is that all generated code would have the same license as  
> rails  
> itself, which is MIT IIRC.

[http://www.gnu.org/licenses/gpl-faq.html#GPLOutput](http://www.gnu.org/licenses/gpl-faq.html#GPLOutput)

jeremy

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 5:50am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/8 "2006-05-10T05:50:32Z")

</div>

On Wed, May 10, 2006 at 03:34:07AM -0000, Kevin O. wrote:

> be construed to suggest that the generated code is subject to the  
> original licsense.

Yes; that is the sort of situation I see as being possible. In the GPL  
FAQ example, the output of ‘ls’ cannot be controlled by the author of  
‘ls’, but the ouput of ‘bison’ _might_ be.

Closer to Rails, my example would be the AjaxScaffold – the app itself  
is under the MIT license, so I can modify and use the app for my own  
purposes, including commercially. That’s fine, as far as it goes; but I  
don’t intend to modify AjaxScaffold itself, as I don’t actually need  
that freedom. I just want to use it’s output.

If I wanted to GPL my project, could I GPL the files that have been  
generated by AjaxScaffold in my application? Well, if I don’t own the  
copyright on them, I can’t, can I?

(This is more specifically interesting if I don’t want to modify the  
generated code; while the Rails scaffold CRUD is a little ugly,  
AjaxScaffold output is nice, and suitable to leave in as a back-end DB  
manipulation feature)

Ideally, code generators would include a header comment that explicitly  
laid out the usage terms, but that would probably require the original  
author to understand them, and I don’t think that’s true at the moment.

-jim

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 8:35pm UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/9 "2006-05-10T20:35:39Z")

</div>

> GPL brings that advantage, yes, and it also means that modifications  
> are going to come sailing in from all over the place, however it also  
> makes it virtually impossible for 95% of us who make money from Rails  
> development from being able to do so right now. Our money does not  
> come from salaries, we do not have the comfort of sales teams, we  
> fight the dragons of insolvency daily.

You’ve completely lost me? The point of my post was that in this  
application (web applications with scripted lanaguages) there is just  
not that much of a difference. The MIT license does not require you to  
distribute the source code to your customer, so in theory you could  
compile or obfuscate it before releaseing it. The GPL would prevent you  
from doing this.

> Do you think all the web apps out there being developed in RoR would  
> be built using Rails if we all had to give our code, generated code,  
> plugins and other stuff away for free, because of what will now  
> probably be known as the ‘Bison-like output issue’?

Again you’ve lost me? If you are contracted to write applications with  
Rails you basically have to give them your source, it’s a scripted  
language. If you’re hosting a service you’re not required to give out  
the source with either license.

> Also, as the MIT license is much freer (in the ‘liberal’ sense) than  
> the GPL, providing you retain the Copyright, there is absolutely  
> nothing stopping you creating a fork of the Rails code base and your  
> generated code base and releasing it under the GPL license. Doing it  
> the other way around however, is impossible: you can’t convert GPL  
> code into a MIT/BSD license code base, it’s a one-way street.

I think you need to look into this a bit more. Neither license allows  
re-licensing.

> In other words, right now, there are REALLY, REALLY good reasons why  
> MIT is the way to go on Rails, plugins, engines and other assorted  
> bits and bobs. However, if you’re desperate for a GPL licensed Rails,  
> you may feel free to go forth and create that fork.

I’m not sure why you say this, but since I’m the only one you quoted  
I’ll respond. This was my point exactly. The Rails community chose the  
MIT license we as Rails developers should do the same. Even those  
developers who may prefer the GPL because in this case the GPL gets you  
so little.

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 11, 2006, 12:06am UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/10 "2006-05-11T00:06:04Z")

</div>

On Tue, May 09, 2006 at 11:41:09PM +0100, Jim C. wrote:

> I’m trying to figure out what the software license would be for code  
> (scaffolds, etc) generated by Rails.

And because I mentioned the GPL, people have started debating the  
coverage of that particular license, especially as compared to the MIT.

As far as I can see, this is a complete red herring. The GPL FAQ link  
was talking about copyright law, not the GPL itself, and was trying to  
describe the circumstances under which the copyright status _of a  
program_ could extend _to its output_ - which is precisely what I was  
interested in.

I will not be modifying the Rails application. I won’t be modifying the  
AjaxScaffold gem either. Therefore the only (initial) concern that I  
have with their license is my freedom to _use_ the programs, and I have  
that. Whether they’re GPL or MIT at this stage has no relevance. They  
could even be pure Microsoft …

The Bison situation is relevant. Here’s the direct FAQ link  
[http://www.gnu.org/licenses/gpl-faq.html#TOCCanIUseGPLToolsForNF](http://www.gnu.org/licenses/gpl-faq.html#TOCCanIUseGPLToolsForNF)

To paraphrase :-

“Some programs copy parts of themselves into the output for technical  
reasons … the copied text in the output is covered by the same license  
that covers it in the source code. Meanwhile, the part of the output  
which is derived from the program’s input inherits the copyright status  
of the input.”

This seems to fit the description of the output of both the initial  
‘rails’ command, and that of a generator like AjaxScaffold.  
The implication – regardless of the license in use – is that the  
majority of the output of these commands is under the copyright of the  
program author, and not me.

In the case of ‘rails’, my only input was the path name for the  
application, and therefore I can only claim copyright over those lines  
of the files that mention that path name explicitly. Everything else  
belongs to DHH, and the core team.

In the case of the AjaxScaffold generator, my input is my database  
schema, and therefore everything other than the model and column names  
in the view belongs to Richard W…

In the case of Bison, the FAQ indicates that they have explicitly  
disclaimed copyright over the output; however I note that the current  
Bison distribution seems to use only a generic GPL, and I can’t see any  
exceptions.  
[http://cvs.savannah.gnu.org/viewcvs/bison/COPYING?rev=1.2&root=bison&view=markup](http://cvs.savannah.gnu.org/viewcvs/bison/COPYING?rev=1.2&root=bison&view=markup)

This claim of copyright over the output of such programs seems to be an  
unexpected outcome of copyright law. If it is true, I’d like to see some  
explicit comments in the generated files; or an explicit grant in the  
license, similar to the one claimed for Bison.

Otherwise, “All your (unmodified) base belong to us” …

-jim

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [May 10, 2006, 5:18pm UTC](https://www.ruby-forum.com/t/what-is-the-license-of-generated-code/60077/11 "2006-05-10T17:18:32Z")

</div>

On 10 May 2006, at 03:46, Michael G. wrote:

> The primary thing the GPL brings over the MIT is a guarantee the end  
> user will get the source code.

This is the worst place in the World to do a GPL vs. MIT/BSD war,  
however:

GPL brings that advantage, yes, and it also means that modifications  
are going to come sailing in from all over the place, however it also  
makes it virtually impossible for 95% of us who make money from Rails  
development from being able to do so right now. Our money does not  
come from salaries, we do not have the comfort of sales teams, we  
fight the dragons of insolvency daily.

Do you think all the web apps out there being developed in RoR would  
be built using Rails if we all had to give our code, generated code,  
plugins and other stuff away for free, because of what will now  
probably be known as the ‘Bison-like output issue’?

Also, as the MIT license is much freer (in the ‘liberal’ sense) than  
the GPL, providing you retain the Copyright, there is absolutely  
nothing stopping you creating a fork of the Rails code base and your  
generated code base and releasing it under the GPL license. Doing it  
the other way around however, is impossible: you can’t convert GPL  
code into a MIT/BSD license code base, it’s a one-way street.

In other words, right now, there are REALLY, REALLY good reasons why  
MIT is the way to go on Rails, plugins, engines and other assorted  
bits and bobs. However, if you’re desperate for a GPL licensed Rails,  
you may feel free to go forth and create that fork.

Just don’t expect professional developers to have the stomach for it  
right now. ☹

> In the case of a rails app it’s a bit hard to not give them the  
> source.

It’s only a bit hard - not impossible. I’ve not tried creating an exe  
with Rails yet, but in theory, it’s possible (and if it isn’t now, it  
soon will be).

–  
Paul R.
