Re: Compilation Was: Is DEFCONSTANT broken?
- From: pjb@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
- Date: Fri, 26 Jun 2009 01:04:39 +0200
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__
.
- References:
- Is DEFCONSTANT broken?
- From: Ron Garret
- Re: Is DEFCONSTANT broken?
- From: Kaz Kylheku
- Re: Is DEFCONSTANT broken?
- From: Kaz Kylheku
- Re: Is DEFCONSTANT broken?
- From: Ron Garret
- Re: Is DEFCONSTANT broken?
- From: Scott Burson
- Re: Is DEFCONSTANT broken?
- From: Duane Rettig
- Re: Is DEFCONSTANT broken?
- From: Scott Burson
- Re: Is DEFCONSTANT broken?
- From: Duane Rettig
- Re: Is DEFCONSTANT broken?
- From: Scott Burson
- Re: Is DEFCONSTANT broken?
- From: Duane Rettig
- Re: Is DEFCONSTANT broken?
- From: Scott Burson
- Re: Is DEFCONSTANT broken?
- From: Duane Rettig
- Compilation Was: Is DEFCONSTANT broken?
- From: Pascal J. Bourguignon
- Re: Compilation Was: Is DEFCONSTANT broken?
- From: Duane Rettig
- Re: Compilation Was: Is DEFCONSTANT broken?
- From: Pascal J. Bourguignon
- Re: Compilation Was: Is DEFCONSTANT broken?
- From: Duane Rettig
- Is DEFCONSTANT broken?
- Prev by Date: Re: rip erik naggum
- Next by Date: Re: Compilation Was: Is DEFCONSTANT broken?
- Previous by thread: Re: Compilation Was: Is DEFCONSTANT broken?
- Next by thread: Re: Compilation Was: Is DEFCONSTANT broken?
- Index(es):
Relevant Pages
|