www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Studying the DMD front-end and contributing to similar projects?

reply "Aziz K." <aziz.koeksal gmail.com> writes:
Hi,

The specs are not always helpful when you need to know how to write a  
compiler for D programs.

Is it okay to study the code of the front-end of DMD, and also contribute  
to similar projects under a different license?

What are the restrictions in this regard?

--
Aziz

-- 
Dil: http://code.google.com/p/dil/
May 02 2010
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Aziz K. wrote:
 Hi,
 
 The specs are not always helpful when you need to know how to write a 
 compiler for D programs.
 
 Is it okay to study the code of the front-end of DMD, and also 
 contribute to similar projects under a different license?
 
 What are the restrictions in this regard?

It is under GPL and the Artistic License. If you wish to use it under the GPL, the usual GPL conventions apply. If you wish to use it for commercial non-GPL purposes, ask me and I will do my best to make it work for you. I use the compiler source in my Compiler Construction Seminar (http://www.astoriseminar.com). So yes, you are free to study the code, learn from it, apply the techniques in your own projects, and contribute to other projects under a different license. As far as I know, none of the algorithms used in the compiler are encumbered by any patents, certainly I hold no patents on it, nor do I intend to patent any part of it. Furthermore, the algorithms used in it are pretty conventional compiler algorithms that have been around a long time. All I ask is that you do not copy the actual source code code without a license from Digital Mars or unless the copy is under the GPL. In particular, I am not requiring anyone to do a clean room implementation. My often stated ideas about 'taint' are simply an easy way to protect myself (and Digital Mars) against frivolous lawsuits, I have no intention of applying them in reverse. For an example of what doesn't work for me, many years ago, a company came out with a product suspiciously similar to mine. I contacted them, and they said that while they were familiar with my code, they had rewritten it from scratch. Ok, so I ran an "nm" over their executable and a "strings". Of the hundreds internal function names (not interface related), about 95% were identical matches to my source code, and about 90% of the text strings, such as error messages, were identical. This was as obvious and egregious as it gets. They were full of BS, and they caved.
May 02 2010
parent "Aziz K." <aziz.koeksal gmail.com> writes:
Walter Bright wrote:
 I use the compiler source in my Compiler Construction Seminar  
 (http://www.astoriseminar.com). So yes, you are free to study the code,  
 learn from it, apply the techniques in your own projects, and contribute  
 to other projects under a different license.

Great. Thanks for clarifying this. That puts my mind at ease. :)
 All I ask is that you do not copy the actual source code code without a  
 license from Digital Mars or unless the copy is under the GPL.

Okay. I don't wish to copy any code anyway. Just want to study the front-end to understand the language better.
 In particular, I am not requiring anyone to do a clean room  
 implementation. My often stated ideas about 'taint' are simply an easy  
 way to protect myself (and Digital Mars) against frivolous lawsuits, I  
 have no intention of applying them in reverse.

That sounds reasonable. Thanks again. ;) -- Aziz -- Dil D compiler: http://code.google.com/p/dil/
May 02 2010