Re: Compilation Was: Is DEFCONSTANT broken?



Duane Rettig <duane@xxxxxxxxx> writes:

On Jun 25, 1:27 pm, p...@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
wrote:
Duane Rettig <du...@xxxxxxxxx> writes:
On Jun 25, 1:28 am, p...@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
wrote:
Duane Rettig <du...@xxxxxxxxx> writes:
The problem here is that the whole reason for
compilation is to reduce code complexity, and having these hooks to
break these simplifications goes against the goal of compilation.  

[...]

We fight complexity with abstractions.  Which is mostly inventing new
levels of source code generating the existing lower level of lisp, VOP
or binary.  If adding an abstraction didn't reduce the complexity we
wouldn't do it, we'd keep programming in assembler.

Yes, you're thinking about this backwards. Abstractions are in the
upward (i.e. on the scale of low-level to high-level) direction, which
reduces complexity for the user, but which also _increases_ complexity
for the tools that are performing the abstraction for you.

Consider a simple example at the hardware level: If you were wanting
to write a cos() function in assembler from scratch, on a RISC machine
it would be a very complex set of assembler instructions, which would
likely be fairly large in code space (at least several thousand
instructions (in fact, on an Alpha it seems to be about 3600 bytes).
In a CISC machine (where, interestingly, the first C stands for
Complex), where the machine has increased its complexity so that the
user doesn't have to deal with it, the disassembled cos function is
more like 38 bytes, most of which is taken up in handling edge cases
that the fcos instruction (on x87 hardware) doesn't handle. Again,
from the user's point of view, less complex. From the compiler's
point of view, more complex.

So, in going the other direction, from source code to assembler/
machine code (or, in the case of cos, from the single complex
instruction to the thousands of instructions that would have been
required to implement it if it weren't there), the direction from high-
level to low level is one of increasing simplicity. More
instructions, yes. But also more simplicity. The 3600 bytes worth of
instructions to implement cos on the alpha are all much simpler than
the single fcos instruction on the x87.

Ok, I understand what you mean.
A C compiler is less complex than a Lisp compiler.
An interpreter for a bytecode VM is simplier than an interpreter for CL.
And interpreting byte codes is simplier than interpreting Lisp s-exps.


I don't buy a correlation between compressibility and simplicity any
more than I buy a forced correlation between LOC generated and
paycheck. Numbers can be generated and show whatever you please, but
there are too many factors involved to draw such a simplistic
conclusion.

Yes, I showed only one example, statistics on a more significant
population would be needed to be able to perhaps conclude something.

--
__Pascal Bourguignon__
.



Relevant Pages

  • Re: Why do we make everything so difficult?
    ... I'm a philosopher and theologian as well as a jazz guitarist. ... But I believe that I can get to simplicity easier than I can get to ... While the road to complexity is paved by arpeggios, intervals, scales, ...
    (rec.music.makers.guitar.jazz)
  • Re: Compilation Was: Is DEFCONSTANT broken?
    ... compilation is to reduce code complexity, ... break these simplifications goes against the goal of compilation. ... And, by the way, assembler code is not compiled code; ... they are just instructions which happen to be the target of the jump). ...
    (comp.lang.lisp)
  • Re: Compilation Was: Is DEFCONSTANT broken?
    ... compilation is to reduce code complexity, ... break these simplifications goes against the goal of compilation. ... And, by the way, assembler code is not compiled code; ... they are just instructions which happen to be the target of the jump). ...
    (comp.lang.lisp)
  • Re: determinism, freewill, chaos, and circular causality
    ... But simplicity of the components does not mean ... because it is systemic complexity. ... Although Curt is right in so far that we should not attempt to look at our creativity as a result of a chaotic system. ... To predit the motion of just one body, you would need to take into account ALL the feedbacks between ALL the bodies. ...
    (comp.ai.philosophy)
  • Top Ten Articles
    ... Fundamentalists tend to inhabit simplicity this side of complexity; ... If we asked Jesus the hard questions about homosexuality, ... What does it mean to be a fully 'committed' Christian? ...
    (soc.religion.christian)