From: Steen Schmidt on
Michael wrote:

> for those critical bits. The cool thing, is that in SRPL, null
> locals are quite fast, so you have the best of both, er, triple
> worlds: speed, readability, flexibility ;-)

That's the first first time I've seen NULLLAMs associated with
readability ;-)

Here's a small tidbit from the uncompressed source of my port of
FluidHP on hpcalc.org:

********
7GETLAM %SQRT %SQRT DUP 6PUTLAM 18GETLAM SWAP 21GETLAM OVER
BINT24 GETLAM %* %+ %* %+ 5PUTLAM 17GETLAM 6GETLAM 20GETLAM
OVER BINT23 GETLAM %* %+ %* %+ DUP 4PUTLAM 5GETLAM DUPDUP %*
22GETLAM 6GETLAM %+ 6GETLAM %* 19GETLAM %+ 4GETLAM %* %4 %*
%+ %SQRT %+ %/ 15GETLAM %+ DUP 2PUTLAM 14GETLAM OVER %+
2GETLAM %* 13GETLAM %+ %SQRT %- 1PUTLAM 10GETLAM BINT25 GETLAM
9GETLAM %- 1GETLAM 10GETLAM %- %* 7GETLAM 9GETLAM %- %/ %+
********

I use up to 28 NULLLAMs in nested environments, so readability is
pretty much a goner (but code size is down and performance is up, so..
:-).

To make a fair point the rest of the code isn't much better - another
tidbit:

********
%0 %0 % 1489.50410795 %0 %1 % 743.07798314 %0 %2 % -97.7083187978
%0 %12 % 2.47424647057 %0 %18 % -0.63281320016 %0 %24
% 1.13859521297 %0 %7 %4 %* % -0.478118636486 %0 %10 %4 %*
% 8.52081234315E-3 %1 %0 % 0.937471473779 %1 %2 % 3.35931186049
%1 %6 % 3.38093556015 %1 %12 % 0.168445396719 %1 %18
% 0.738757452367 %1 %24 % -0.471287374362 %1 TWENTYFOUR PICK
% 0.150202731397 %1 TWENTYFOUR PICK % -2.17641142198E-3 %2
%2 % -2.18107553248E-2 %2 %8 % -0.108297844037 %2 %18
% -4.63333246358E-2 %2 TWELVE PICK % 7.12803519596E-5 %3 %1
% 1.103283179E-4 %3 %2 % 1.89552483879E-4 %3 %12 % 3.08915411605E-3
%3 %24 % 1.35555045549E-3 %4 %2 % 2.86402374774E-7 %4 %12
% -1.07798573575E-5 %4 %18 % -7.64627124548E-5 %4 %24
********

All the code is like that, I didn't even have to search for special
obfuscated parts of it :-/ I have forgotten how many stack levels are
used, but it's close to hundred. The Debug4x source is included in the
FluidHP 2.0 zip-file on hpcalc.org if anyone wants to take a peek.

Regards
Steen
From: Cyrille de Br?bisson on
hello,

on ROT ROT.. try using UNROT, faster and easier to read.
yes, locals are easier to read, but much slower (storage part, memory
movements to create and destroy the local stack, name matching each time you
access a local, need to store in locals (again name matching)...
yes, using locals in a sircumspect way can improve speed on COMPLEX
algorythms, but this is rare. Normally, you never use Locals for critical
loops...
No stack diagrams, use your head, this is a great concentration exercise and
helps fight brain deadness :-)
SysRPL is faster, and nullname Locals in SysRPL are FASTER than stack
manipulation (cause there is no need to move memory along when manipulating
stack), and are REAdABLE! when used properly: ie in MASD:
{{ LocalVar1 LocalVar2 LocalVar3 .... }}(where localVarx is whatever name
you want)

and then use LocalVarx to replace xGETLAM and LocalVarx! for xPUTLAM
ABND

when working with the HPTOOLS, use a DEFINE LocalVarx xGETLAM and DEFINE
LocalVarx! xPUTLAM to get the readability...

regards, cyrille

"Steen Schmidt" <sschmidt(a)nospam.dk> wrote in message
news:xn0ehozp29cvh6000(a)news.tele.dk...
> Michael wrote:
>
>> for those critical bits. The cool thing, is that in SRPL, null
>> locals are quite fast, so you have the best of both, er, triple
>> worlds: speed, readability, flexibility ;-)
>
> That's the first first time I've seen NULLLAMs associated with
> readability ;-)
>
> Here's a small tidbit from the uncompressed source of my port of
> FluidHP on hpcalc.org:
>
> ********
> 7GETLAM %SQRT %SQRT DUP 6PUTLAM 18GETLAM SWAP 21GETLAM OVER
> BINT24 GETLAM %* %+ %* %+ 5PUTLAM 17GETLAM 6GETLAM 20GETLAM
> OVER BINT23 GETLAM %* %+ %* %+ DUP 4PUTLAM 5GETLAM DUPDUP %*
> 22GETLAM 6GETLAM %+ 6GETLAM %* 19GETLAM %+ 4GETLAM %* %4 %*
> %+ %SQRT %+ %/ 15GETLAM %+ DUP 2PUTLAM 14GETLAM OVER %+
> 2GETLAM %* 13GETLAM %+ %SQRT %- 1PUTLAM 10GETLAM BINT25 GETLAM
> 9GETLAM %- 1GETLAM 10GETLAM %- %* 7GETLAM 9GETLAM %- %/ %+
> ********
>
> I use up to 28 NULLLAMs in nested environments, so readability is
> pretty much a goner (but code size is down and performance is up, so..
> :-).
>
> To make a fair point the rest of the code isn't much better - another
> tidbit:
>
> ********
> %0 %0 % 1489.50410795 %0 %1 % 743.07798314 %0 %2 % -97.7083187978
> %0 %12 % 2.47424647057 %0 %18 % -0.63281320016 %0 %24
> % 1.13859521297 %0 %7 %4 %* % -0.478118636486 %0 %10 %4 %*
> % 8.52081234315E-3 %1 %0 % 0.937471473779 %1 %2 % 3.35931186049
> %1 %6 % 3.38093556015 %1 %12 % 0.168445396719 %1 %18
> % 0.738757452367 %1 %24 % -0.471287374362 %1 TWENTYFOUR PICK
> % 0.150202731397 %1 TWENTYFOUR PICK % -2.17641142198E-3 %2
> %2 % -2.18107553248E-2 %2 %8 % -0.108297844037 %2 %18
> % -4.63333246358E-2 %2 TWELVE PICK % 7.12803519596E-5 %3 %1
> % 1.103283179E-4 %3 %2 % 1.89552483879E-4 %3 %12 % 3.08915411605E-3
> %3 %24 % 1.35555045549E-3 %4 %2 % 2.86402374774E-7 %4 %12
> % -1.07798573575E-5 %4 %18 % -7.64627124548E-5 %4 %24
> ********
>
> All the code is like that, I didn't even have to search for special
> obfuscated parts of it :-/ I have forgotten how many stack levels are
> used, but it's close to hundred. The Debug4x source is included in the
> FluidHP 2.0 zip-file on hpcalc.org if anyone wants to take a peek.
>
> Regards
> Steen


From: Steen Schmidt on
Cyrille de Br?bisson wrote:

> when working with the HPTOOLS, use a DEFINE LocalVarx xGETLAM and
> DEFINE LocalVarx! xPUTLAM to get the readability...

I didn't want to do that in the porting of FluidHP, as I use the same
data both within and outside of an inform box - this means that my
stored data suddenly gets offset (when I in one environment need to
recall NULLLAM 14, I in the next environment need to recall NULLLAM 18
to get to the same data for instance). Defining names for the NULLLAMs
would in this case only confuse matters I think.

I agree with (and practice) your point of view to make defines to make
code more readable - FluidHP was just the result of a macrochallenge
between me and TW to get the fastest and smallest port :-)

I have thorough comments throughout the source though, so it should at
all times be quite easy to determine which NULLLAM contain what data
(the comments inlcude elaborate lists of the current data structure in
memory).

Regards
Steen
From: Arnaud Amiel on
This nulllam with a name in MASD is wonderful for me. One of the best
features of the whole metakernel.

Thanks Cyrille. Well I guess you did it??

Arnaud

From: timwessman on
> I agree with (and practice) your point of view to make defines to make
> code more readable - FluidHP was just the result of a macrochallenge
> between me and TW to get the fastest and smallest port :-)

And I was soundly thrashed due to my schedule suddenly getting very
busy. Hail the mighty Steen!!!

TW

(maybe I'll give it a go sometime. . . ;-)

First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: HP28S (ROM)
Next: Duct Sizing Program