On 25-Nov-1999, Eduardo Costa <[EMAIL PROTECTED]> wrote:
> Fergus Henderson
> Why a compiler should be small, and produce small code, etc?
I completely understand the desire for the compiler to produce
small code. I was asking about your desire for the compiler
itself to be small.
> A small compiler proves that its libraries can produce small code.
Surely a small "hello world" or small application programs
are more important for demonstrating this than a small compiler?
The Mercury compiler is not small; at nearly 5M (statically linked)
for the Linux executable, it's more than double your suggested figure
of 2M. But the Mercury compiler has 190,000 lines of source, not
counting the 40,000 lines of standard library, so it's not surprising
that the generated code is that size. The Mercury "hello world" on
Linux is only 6.2k (dynamically linked; it's 174k if you link the
Mercury library statically but the C library dynamically, or 330k if
you link everything statically).
In any case, if what you want is a compiler that can produce
small code, ask for that, not for a small compiler. Remember,
this is your dream compiler! You can wish for whatever you like!
Just be careful to wish for what you really want.
Because if you wish for a small compiler, when what you really
want is a compiler than produces small code, then you might get
a small compiler (perhaps written in assembler ;-)
that produces large code.
> Besides, it becomes easier to install, and uninstall.
Well, size is only a small factor in ease of installation.
Packaging is more important. If ease of installation is
what you really want, then ask for that, not for a small compiler.
> For instance,
> Dr. Alcimar (that you know quite well) is finishing his prosthetic arm
> for amputees. Clean was able to produce code that was small enough,
> uses heap sparingly, and was fast enough to do the pattern recognition
> of electric myographic signals using a novel algorithm created by Dr.
> Pascoarelli. The program must be small because it runs on a laptop computer,
> with little memory (one can not ask an amputee fetching a large computer).
Does the development environment need to be on the laptop?
Surely you could, and indeed probably would, do most of your
development work on a desktop computer and then take the few
seconds to copy the program onto the laptop for field work.
> Conclusion: I think that we should look for groups interested
> in producing a Haskell compiler. A friend of mine also suggested trying to
> lure Clean team to eliminate the small incompatibilities that their system
> have with Haskell. If a Clean feature is important and significative, it would
> be let alone (for instance, unique types are fine). If it only makes the code
> hard to read for Haskell programmers, it would be changed. An example is
> the notation for list patterns (Clean could change [x:y} to (x:y)). Other
> examples: Module handling, type declarations, etc.
That is a very good idea, IMHO. Developing a Haskell front-end for the
Clean compiler should not be _that_ much work, I would expect.
And the two languages are similar enough that it seems to make little
sense to have two different syntaxes.
Cheers,
Fergus.
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.