caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Chris Hecker <checker@d6.com>
To: Dave Mason <dmason@sarg.ryerson.ca>,
	Alessandro Baretta <alex@baretta.com>
Cc: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] choosing modules at runtime
Date: Wed, 02 Oct 2002 13:57:57 -0700	[thread overview]
Message-ID: <4.3.2.7.2.20021002123446.019b8770@mail.d6.com> (raw)
In-Reply-To: <200210021328.g92DSwh23908@sarg.ryerson.ca>


> > And finally, a mixed byte-native runtime is not supported.
>This is definitely something I'd like to see.  As I understand it,
>there are 2 problems: bytecode vs. native function dispatch, and GC.
>Trying to resolve this is on my list of things to do, but it's a long
>list, so I'd love to hear that someone else has done it first!

I looked into this a fair amount and there were some threads on this topic 
on the list.  It's totally possible to do, but it looks like a 
mess.  Xavier explained the problems in the old thread.  I looked into how 
to do the function dispatch without requiring an if statement or two 
pointers in the closures, and it seems doable by being wacky with nop 
instructions on the various supported architectures (for better or for worse).

Here's the thread:
http://groups.google.com/groups?th=d0d0f6e6592e11ea

A unification of the GC between bytecode and native would be good for the 
other wacky feature I'd like to see implemented: 
coroutines/fibers/cooperative-threads/whatever-your-pet-name-is.  These 
require allocating a block of memory, treating it as a stack and switching 
to it to run a coroutine.  All of the allocated stacks have to be visible 
to the GC so it doesn't treat as garbage something living on a non-running 
stack.  I haven't looked into this at all, but I assume there's something 
in there for the preemptive threads, but I wonder how different it is for 
bytecode versus native.  Coroutines are useful in games for writing AI code 
so you don't have to write it as an FSM to spread it across frames.

Chris

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-10-02 20:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-24 11:09 Sebastien.deMentendeHorne
2002-09-24 11:41 ` Markus Mottl
2002-09-30  7:28   ` John Max Skaller
2002-10-02 13:04     ` Alessandro Baretta
2002-10-02 13:28       ` Dave Mason
2002-10-02 20:57         ` Chris Hecker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-09-24 10:40 Sebastien.deMentendeHorne
2002-09-24 11:00 ` Markus Mottl
2002-09-24  8:48 Henri Dubois-Ferriere
2002-09-24  9:36 ` Andreas Rossberg
2002-09-24 10:37   ` Markus Mottl
2002-09-24 10:08 ` Markus Mottl
2002-09-24 10:18 ` Olivier Andrieu
2002-09-24 17:24   ` Sven LUTHER
2002-09-24 10:42 ` Yamagata Yoriyuki
2002-09-24 12:43 ` Alessandro Baretta
2002-09-24 12:55   ` Maxence Guesdon

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.20021002123446.019b8770@mail.d6.com \
    --to=checker@d6.com \
    --cc=alex@baretta.com \
    --cc=caml-list@inria.fr \
    --cc=dmason@sarg.ryerson.ca \
    /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).