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

Re: More questions about the QPL for a compiler



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.

It's that equivalent in the OCaml compiler to which I refer.



-- 
Brian Sniffen                                       bts@alum.mit.edu



Reply to: