gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Re: GM2 ISO


From: Gaius Mulley
Subject: Re: [Gm2] Re: GM2 ISO
Date: 10 May 2003 11:58:53 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Iztok <address@hidden> writes:

> Gaius Mulley wrote:
> 
> >Iztok <address@hidden> writes:
> >
> LENGTH = Strings.Length = strlen
> 
> I think that this was the point of LENGTH discussions - LENGTH has its
> function only when pervasive. If imported, there was no difference
> between LENGTH and Strings.Length. And the reason for implementing
> LENGTH is only for not importing Strings module at all. Which, again,
> is more important for compilers which can not optimize for unaccessed
> code at link time. Which, I hope (and unfortunately do not know) gcc
> and gm2 do.

currently the -O option to gm2 will remove redundant code on a per module
basis. But it doesn't remove exported procedures and all modules which in
the IMPORT tree are linked to form the executable. It should be possible to
optimize linking at some stage.

> 
> >   (ii)  within constant expressions, presumably LENGTH is limited to
> >         a constant parameter.
> >
> I think that the compiler has enough information to use the constant
> string length constant at the compile time, and it should. Which again
> can not be the case with the Strings.Length where the constant string
> could only be evaluated at run time. And might be that it was another
> reason for LENGTH implementing.

thanks for clarifying this. Yes the compiler will evaluate at compile
time all constants, and only make reference to Strings.Length for
variables. (Similar to pervasive HALT and M2RTS_HALT).

It would of course be possible to inline Strings.Length if required..

Thanks for all the bug reports and example code

Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]