On Fri, Jun 18, 2010 at 08:35:13AM +0200, Fabian Groffen wrote:
> On 18-06-2010 02:08:04 +0200, René 'Necoro' Neumann wrote:
> > In parallel (or thereafter), we build the C-bindings. The API for these
> > bindings probably look different -- but I guess they should be
> > implemented in terms of the library created above.
> >
> > By example:
> >
> > - Operation: get the list of categories
> > - Python-API: portage.api.categories() : Category list
> > - Implementation: def categories(): return ....
> > - C-API: category * categories()
> > - C-Implementation: some wrapper around portage.api.categories
>
> If you want to deliver a C implementation, I'd wonder why you wouldn't
> just make a full C implementation and create Python wrappers for them
> instead of the other way around. Might accidentially speed up Portage,
> and make tools like portage-utils happy.
Got a couple of years of developer time you can spare?
Portage's slowness ain't python, if in doubt look at pkgcore. Even
w/out our extensions we blow it's lid off. So kindly skip the "it'll
be faster in c" bits... that joke is beyond dead at this point
back to the subject at hand...
While I'm not generally a fan of embedding python, in this case it's
what makes sense. That said I'm not hugely convinced the proposal on
the table is accurate- knocking out a public portage API needs to
occur, but a c-api is a very large and seperate beast from a public
python API- namely due to crossing the vm, having to do FFI
conversions, etc. It's not the simplest thing.
For pkgkit, what I'd suggest is basically pushing into pkgkit just cpy
stubs that know to import a specific namespace, and grab functions
from there. It's been a while since I've gone through that code, but
if memory serves this shouldn't be too hard to do- the reasons for
doing this pretty much come down to allowing portage to minimize the
area it needs to provide a stable API for.
If all it has to provide is a stable set of functors for pkgkit,
that leaves open fixing portage internals/architecture.
My two cents either way. I know for pkgcore/pkgkit, this is my
intention also...
~harring