caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Chris Hecker <checker@d6.com>
To: caml-list@inria.fr
Subject: [Caml-list] "yielding" in bytecode
Date: Sat, 28 Apr 2001 19:00:29 -0700	[thread overview]
Message-ID: <4.3.2.7.2.20010428145201.00d75aa0@shell16.ba.best.com> (raw)


I'd like to use ocaml bytecode embedded in another application, so I'll be calling caml_startup() from C code.

I'd like to be able to have bytecode functions yield back to the calling C code but maintain their state when resumed.  I'm not talking about full continuations or anything fancy like that, I'm just talking about breaking out of the interpreter loop and storing the state, so that when it's reentered (via a new API, like caml_resume() or something) it continues executing.

I don't think there's any way to do this right now, but it looks like it'd be possible.  Is there any reason this couldn't be made to work?

In addition, a couple more related features would be nice for embedding ocaml as a scripting language:

- non-preemptive threads (aka fibers), this would be especially good if it was integrated with the above yield thing, so you could yield and then C code could resume individual fibers as it wanted

- having the ocaml byterun state be packaged up in a structure instead of using globals, so you could run multiple copies of it...not sure what kind of performance impact this would have, though...maybe it could be a compile time option, I guess you'd have multiple GCs too...

Chris

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


                 reply	other threads:[~2001-04-29  2:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.3.2.7.2.20010428145201.00d75aa0@shell16.ba.best.com \
    --to=checker@d6.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).