guile-user
[Top][All Lists]
Advanced

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

Re: to serialize/deserialize closures; and multithreading


From: Andreas Rottmann
Subject: Re: to serialize/deserialize closures; and multithreading
Date: Fri, 26 Mar 2004 21:35:54 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

"Faraz Shahbazker" <address@hidden> writes:

>         That I accept. It can be speeded up by building the
> transformation into the compiler, something which is not possible
> with guile - bigloo perhaps would be a better choice for such work.
> But it is difficult to leave guile for 2 reasons :
>
> 1. it's got the "GNU" in it's name
> 2. SCM API is too good - absolutely love it. I don't think anyone
> can provide a better extensibility for Scheme than what we have here.
>
Have a look at Pika's API - it's cleaner (IMHO) and more general, due
to passing only location of SCM values (which allows easier/better GC)
and passing an 'arena' (roughly a interpreter instance), which allows
for more than one Scheme "subsystem" in one program; each such
subsystem can have a different memory pool size, independent GC,
... OTOH, this tends to make the C code more verbose. Example:

t_scm_error
scm_ref_list_elt (t_scm_word * result, t_scm_arena arena, t_scm_word * list,
                  ssize_t elt)
{
  struct ref_locals
    {
      SCM_FRAME;
      t_scm_word tail;
    } l;
  t_scm_error status = 0;

  SCM_PROTECT_FRAME (l);

  status = scm_list_tail (&l.tail, arena, list, elt);
  if (status == 0)
    {
      scm_ref_pair_car (result, arena, &l.tail);
    }
   
  SCM_UNPROTECT_FRAME (l);
   
  return status;
}

Cheers, Andy
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Make free software, not war!





reply via email to

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