John Cowan | 13 Jan 2004 23:02

Re: [stack] Joy1 only with NOBDW

Nick Forde scripsit:

>  From my own experiments I've found that the Boehm collector is
> quite a bit slower than the basic stop-and-copy collector in the
> Joy source, although it does require more runtime memory.

Slower and larger, yes; but it does GC strings, which the built in GC
does not.

--

-- 
Henry S. Thompson said, / "Syntactic, structural,               John Cowan
Value constraints we / Express on the fly."     jcowan <at> reutershealth.com
Simon St. Laurent: "Your / Incomprehensible     http://www.reutershealth.com
Abracadabralike / schemas must die!"            http://www.ccil.org/~cowan

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/concatenative/

To unsubscribe from this group, send an email to:
 concatenative-unsubscribe <at> yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 

phimvt | 20 Jan 2004 07:06
Picon
Picon

Re: [stack] Joy1 only with NOBDW


On Tue, 13 Jan 2004, John Cowan wrote:

> Nick Forde scripsit:
> 
> >  From my own experiments I've found that the Boehm collector is
> > quite a bit slower than the basic stop-and-copy collector in the
> > Joy source, although it does require more runtime memory.
> 
> Slower and larger, yes; but it does GC strings, which the built in GC
> does not.

And I and other concatenators are very grateful to you for this
work and all the other additions and corrections that you made to Joy.

Modesty compells me to clarify one important matter about the
relative speeds of my home-grown collector versus the Boehm collector.
It is not the case that my collector is intrinsically better than
Boehm's, even if the figures suggest that it is. Let me explain:

In much of my previous programming I quite often used global
variables for efficiency, but occasionally in some recursive
procedures had to do this trick:
    save current value of global in a local;
    modify global; do something else (possibly recurse);
    restore saved value from local to global;
Silly me, in the earliest versions of the current Joy I used
the same trick to save nodes of various lists (program, stack,
lists being traversed, and so on). When I started on the garbage
collector all sorts of nasties happened (now I say "of course").
(Continue reading)

Nick Forde | 20 Jan 2004 10:36
Picon

Re: [stack] Joy1 only with NOBDW

phimvt <at> lurac.latrobe.edu.au writes:
 > So, why not use locals with the Boehm collector? Assuming that
 > the smaller implementation with my collector is still to be
 > available, there would need to be two versions for all functions
 > that currently need the dumps. Unfortunately there are so many Joy
 > primitives that need the dumps that having two versions will
 > not be a trivial effort. There are indeed several ways of doing it,
 > with lots (and I mean lots) of #ifdef Boehm .. #else .., or
 > with having two distinct files, or probably other methods again.
 > It might become a maintenance nightmare if it is not done well.

Although keeping track of reachable data for the GC implementation may
have been the motivation for the dumps variables I think the resulting
lack of C locals is probably a good thing. See the "Stackless Python"
project for some reasons why:

  http://www.stackless.com/
  http://www.stackless.com/spcpaper.htm

Nick.

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/concatenative/

To unsubscribe from this group, send an email to:
 concatenative-unsubscribe <at> yahoogroups.com

Your use of Yahoo! Groups is subject to:
(Continue reading)

Nick Forde | 14 Jan 2004 14:52
Picon

Re: [stack] Joy1 only with NOBDW

John Cowan writes:
 > Nick Forde scripsit:
 > 
 > >  From my own experiments I've found that the Boehm collector is
 > > quite a bit slower than the basic stop-and-copy collector in the
 > > Joy source, although it does require more runtime memory.
 > 
 > Slower and larger, yes; but it does GC strings, which the built in GC
 > does not.

Good point. I forgot about that.

While on the topic of GC algorithms can anyone suggest a good choice
for concatenative languages? I've been experimenting with some GC
implementations recently and couldn't help but feel that in Joy we
should be able to take advantage of the pure functional nature of the
language and properties of the evaluation stack.

Doing some literature research I came across the paper 'Garbage
Collection on a Stack' by Wolfgang Schreiner:

  http://citeseer.nj.nec.com/schreiner94garbage.html

I think the algorithm described there could be adapted slightly to
handle the multiple return values required for Joy. The thing I like
most about this is that memory compaction is performed on the fly with
no separate garbage collection phase. 

Billy, have you considered the GC scheme you'd like to use in your
cKlike Forth language?
(Continue reading)

Serguey Zefirov | 17 Jan 2004 00:25
Picon

Re[2]: [stack] Joy1 only with NOBDW

Hello Nick,

Wednesday, January 14, 2004, 5:52:15 AM, you wrote:

NF> While on the topic of GC algorithms can anyone suggest a good choice
NF> for concatenative languages? I've been experimenting with some GC
NF> implementations recently and couldn't help but feel that in Joy we
NF> should be able to take advantage of the pure functional nature of the
NF> language and properties of the evaluation stack.

NF> Doing some literature research I came across the paper 'Garbage
NF> Collection on a Stack' by Wolfgang Schreiner:

NF>   http://citeseer.nj.nec.com/schreiner94garbage.html

NF> I think the algorithm described there could be adapted slightly to
NF> handle the multiple return values required for Joy. The thing I like
NF> most about this is that memory compaction is performed on the fly with
NF> no separate garbage collection phase.

To put some constroversy and to change mode from "lurking" one:
----------------------------------------------------------------------
http://citeseer.nj.nec.com/appel87garbage.html
A very old and simple algorithm for garbage collection gives very
good results when the physical memory is much larger than the number
of reachable cells. In fact, the overhead associated with allocating
and collecting cells from the heap can be reduced to less than one
instruction per cell by increasing the size of physical memory.
Special hardware, intricate garbage-collection algorithms, and fancy
compiler analysis become unnecessary.
(Continue reading)

Nick Forde | 19 Jan 2004 19:47
Picon
Picon

Re: [stack] Joy1 only with NOBDW

Serguey Zefirov wrote:
> To put some constroversy and to change mode from "lurking" one:
> ----------------------------------------------------------------------
> http://citeseer.nj.nec.com/appel87garbage.html
> A very old and simple algorithm for garbage collection gives very
> good results when the physical memory is much larger than the number
> of reachable cells. In fact, the overhead associated with allocating
> and collecting cells from the heap can be reduced to less than one
> instruction per cell by increasing the size of physical memory.
> Special hardware, intricate garbage-collection algorithms, and fancy
> compiler analysis become unnecessary.
> ----------------------------------------------------------------------
> 
> Some ML variants puts execution frames into garbage collected heap.

Hi Serguey,

In Manfred and John's Joy implementation programs are lists, data types
are atoms or lists, and the stack is a list. Each of these lists are 
allocated on the heap. The stop-and-copy collector implemented in Joy
is actually the same as described in this paper.

In theory this should mean that by changing the MEMORYMAX value in
globals.h you could run the experiments described in this paper.
Unfortunately in practice this isn't quite true as the Joy2
implementation uses the C stack to implement a number of the
recursive combinators and the main evaluation loop.

Other concatenative languages described on this list use a code stack 
avoiding the need for the C stack. See Martin Young's posting:
(Continue reading)

Heiko.Kuhrt | 14 Jan 2004 20:03
Picon
Favicon

Re: [stack] Joy1 only with NOBDW

Thank you Nick, once more, it worked. I now have a joy that uses less 
that 1% of my system memory after a rabbit run. The old one needed more 
than 40% (400MB)(rabbit is all strings).

Regards,
Heiko

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/concatenative/

To unsubscribe from this group, send an email to:
 concatenative-unsubscribe <at> yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 


Gmane