unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* discussion: serialize procedures and continuations
@ 2013-08-15 13:47 Chaos Eternal
  2013-08-17 12:55 ` Ludovic Courtès
  2014-03-23 20:25 ` Andy Wingo
  0 siblings, 2 replies; 3+ messages in thread
From: Chaos Eternal @ 2013-08-15 13:47 UTC (permalink / raw)
  To: guile-devel

In Scheme, procedures are closures, that means it has the code of the
procedure itself as well as the required environment for running that
procedure. And, mostly, continuations are considered closure.

Hence, it is reasonable to expect a way to serialize the closures to
disks and/or remote machines over network.

Usage:
Stored procedures can be restored later or restored remotely which
makes remote procedure call more easier.
Problems are when these procedures contain reference to object outside
the scheme, say, opened fds, acquired locks/mutexes these objects will
lost. But hooks can be added to overcome these problems.

Stored continuations can restored later to make program continue to
running after system failure, or, in web application, can be used to
finish a user transaction. also, stored continuations can be
transferred to remote hosts to make process-migration. still hooks are
needed when programmer need to deal with opened files and so on.

existing implementations:
Gambit-C: the termite module of gambit-c heavily depends on
serializable closures to have functions like remote process call,
process migration and remote spawn.
chicken: chicken has termite port and also has these function implemented.

I am porting termite to guile. that's why I am interesting in this.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: discussion: serialize procedures and continuations
  2013-08-15 13:47 discussion: serialize procedures and continuations Chaos Eternal
@ 2013-08-17 12:55 ` Ludovic Courtès
  2014-03-23 20:25 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2013-08-17 12:55 UTC (permalink / raw)
  To: guile-devel

Chaos Eternal <chaoseternal@shlug.org> skribis:

> existing implementations:
> Gambit-C: the termite module of gambit-c heavily depends on
> serializable closures to have functions like remote process call,
> process migration and remote spawn.
> chicken: chicken has termite port and also has these function implemented.

In Guile 2.0, you may be able to do implement closure serialization with
support from (system vm program).

(That will not be portable to 2.1/2.2, though.)

> I am porting termite to guile. that's why I am interesting in this.

Nice.

HTH,
Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: discussion: serialize procedures and continuations
  2013-08-15 13:47 discussion: serialize procedures and continuations Chaos Eternal
  2013-08-17 12:55 ` Ludovic Courtès
@ 2014-03-23 20:25 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2014-03-23 20:25 UTC (permalink / raw)
  To: Chaos Eternal; +Cc: guile-devel

On Thu 15 Aug 2013 15:47, Chaos Eternal <chaoseternal@shlug.org> writes:

> Hence, it is reasonable to expect a way to serialize the closures to
> disks and/or remote machines over network.

Agreed.  Guile 2.2's compiler might be able to do this, with some
modification -- take a closure and tree-shake out its dependencies,
packaged into an ELF image.  Similar to save-lisp-and-die in some ways.
But that's a bit expensive to do; there should probably be a way of
doing it at compile-time instead of at run-time.

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-23 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 13:47 discussion: serialize procedures and continuations Chaos Eternal
2013-08-17 12:55 ` Ludovic Courtès
2014-03-23 20:25 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).