[racket-dev] embedding racket without overriding main?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Sep 24 20:58:26 EDT 2012

Yes: Racket needs a consistent starting point for the GC'ed stack
across calls into the Racket.

At Mon, 24 Sep 2012 17:32:26 -0700, Dan Liebgold wrote:
> Is there any reason the scheme_main_setup trampoline can't be done later in
> the program (i.e. only at the point I want to invoke Racket stuff)?
> 
> On Mon, Sep 24, 2012 at 5:09 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> 
> > At Mon, 24 Sep 2012 15:10:08 -0700, Dan Liebgold wrote:
> > > Does anyone have an example of embedding 3m Racket (5.3) in a C++ program
> > > without overriding main?  I have a legacy C++ app that wants to eval some
> > > Racket code but I'd like to be minimally invasive. Might need to shell
> > > out...
> >
> > One strategy is to start a separate OS-level thread for Racket. The
> > rest of the C++ program would send expressions to the Racket thread
> > evaluation via a pipe or some kind of semaphore-based communication.
> >
> > On Windows, you could also try using MzCOM, which is sort of half-way
> > between managing your own thread and starting a separate process.
> >
> > --
> Dan Liebgold    [dan.liebgold at gmail.com]

Posted on the dev mailing list.