[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: More questions about the QPL for a compiler



On Wed, Jul 21, 2004 at 10:06:58AM -0400, Brian Thomas Sniffen wrote:
> Matthew Palmer <mpalmer@debian.org> writes:
> 
> > On Tue, Jul 20, 2004 at 04:07:34PM -0400, Brian Thomas Sniffen wrote:
> >> Yes, I understand that the runtime library and such are LGPL'd.  But
> >> the compiler, when it compiles a loop, for example, does it in a
> >> particular way.  The patterns of assembly code output by the compiler
> >> -- not the parts in the library linked in, but the part actually
> >> written out by the compiler -- are part of the compiler.  And they end
> >> up linked with my code.
> >
> > Unless there is far more to an OCaml compiler, I don't see a big difference
> > between this issue and gcc.  They both perform mechanical translations of
> > data from one format to another.  It's a fairly tricky and involved
> > transformation, but giving the same code to the same compiler at two
> > different times will result in an identical output -- which I have a vague
> > recollection is one of the tests of "creative work".
> 
> That's right.  But if I give my code to GCC-x86 and to the Intel C
> compiler, they will produce different output.  The Intel C compiler
> will, in many ways, produce better output.  It does this for two
> reasons.  First, it has better algorithmic optimizations than GCC.
> Its authors understood the Intel chips better.
> 
> But second, it uses better template code -- its idea of how to compile
> a for loop over short integers is beautiful.  The structures into
> which it compiles a break-free switch statement are elegant.  There is
> much creativity there.

But the creativity and elegance exist in the compiler itself.  The output is
nothing more than the result of mechanical transformation.

I'm think of an analogy with a certain children's toy called a spirograph. 
You may have heard of it, or maybe not.  It basically consists of a large
ring, with cog teeth on the inside, and several smaller cogged circles, each
with lots of holes in it.  You placed the circle in the ring and a pen in
one of the holes, and turned it around and around.  It created beautiful
patterns.

But it's simply the result of a mechanical process.  The only copyright that
could exist in a spirograph artwork would be the selection of circle, pen
hole, and pen colour -- equivalent to source code.

I think I'm rambling...

- Matt



Reply to: