Boost logo

Boost-Build :

Subject: Re: [Boost-build] Extension style
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-08-03 03:39:15


On Wednesday 28 July 2010 11:56:26 Juraj Ivančić wrote:

> On 26.7.2010 14:22, Vladimir Prus wrote:
>
> > I guess I can try to put it in a different way:
> >
> > 1. Is there a way for a single C++ application to create several, fully
> > independent, instances of Python interpreter?
>
> Googling came up with this:
>
> http://docs.python.org/c-api/init.html#Py_NewInterpreter
>
> > 2. It is possible, within a single instance of Python interpreter, to
> > load the same module twice, so and get two copies of global data of
> > that module?
>
> I think that this can be achieved with module aliases (untested):
>
> import module as module1
> import module as module2

Thanks for suggestions -- I was not aware about Py_NewInterpreter at all. I though
a bit more about it, and I guess that making several isolated projects work inside
one bjam is seriously more trouble than it is worth.

Not only it would require tricks on Python side, but it would require that all global
variables in bjam itself are eliminated, which is non-trivial.

I think that for now, I'll go this route:
- Get rid of the 'manager' object
- Add a mechanism that allow an IDE to run bjam, and then send 'commands' -- actually
Python expressions -- to it. Then IDE will be able to discover things it might care
about, like names of features, without doing anything complicated.

Comments?

Thanks,

--
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build: http://boost.org/boost-build2

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk