caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] "yielding" in bytecode
@ 2001-04-29  2:00 Chris Hecker
  0 siblings, 0 replies; only message in thread
From: Chris Hecker @ 2001-04-29  2:00 UTC (permalink / raw)
  To: caml-list


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-29  2:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-29  2:00 [Caml-list] "yielding" in bytecode Chris Hecker

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).