In article <
90e0d4b5-2e3e-4606...@googlegroups.com>,
Dmitry Solomennikov <
99dm...@gmail.com> wrote:
>=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=B8=D0=BA, 19 =D1=81=D0=B5=D0=BD=D1=82=D1=
>=8F=D0=B1=D1=80=D1=8F 2017 =D0=B3., 21:14:53 UTC+7 =D0=BF=D0=BE=D0=BB=D1=8C=
>=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C informatimago =D0=BD=D0=B0=
>=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>>=20
>> Also, I don't know if any implementation does this, but it may be worth
>> a try: if you can avoid references in your structure slots (ie. not
>> using type T, but something more specific that could be stored directly
>> in the slot like FIXNUMs), this would allow the implementation to know
>> that it doesn't have to scan the structure to check for object
>
>Unfortunately, I can't follow this. This is an ML-like language and structu=
>res
>can be of any type. It is impossible to make it more precise.
>
>> references, so it would be able to garbage collect the structure more
>> rapidly. This would be worth it as well if you chose to splice your
>> structure in vectors as indicated in my other message (then it could
>> eventually collect the whole vectors without scanning them).
>
>This is another idea I want to check, thanks for advice.=20
I'm thinking about a lisp implemented in Forth.
This gave me an idea.
Apart from the short lived data on the stack that is restricted to
single machine words (items that fit in 32 bits) there are two memory
spaces in Forth.
One is allocated strictly incremental (ALLOT), effectively as stack, and
the other is random and can be garbage collected. (ALLOCATE).
With FORGET , resetting a pointer, the data that was
ALLOTted can be removed very fast.
Now the idea is in e.g. a calculation to ALLOT all intermediate
results and only ALLOCATE the result. Then FORGET all the
intermediate stuff.
I think this mechanism could be added to any lisp implementation,
and could be worthwhile for e.g. the infamous recursive
Fibonacci calculation. Only the result is made permanent and
the O(N^phi) intermediate objects are just discarded in one go.
Note that the type of the objects don't come into play.
You just ALLOCATE the objects that remain after the calculation
and maybe a few objects they refer to. All the rest is garbage.
Groetjes Albert
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&
c.xs4all.nl &=n
http://home.hccnet.nl/a.w.m.van.der.horst