ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
[C++-sig] Re: Refactoring, Compilation Speed, Pyste, Lua/Ruby/JavaScript...
by Brett Calcott other posts by this author
Jun 18 2003 8:25AM messages near this date
[C++-sig] Re: Refactoring, Compilation Speed, Pyste, Lua/Ruby/JavaScript... | [C++-sig] Re: Re: Refactoring, Compilation Speed, Pyste, Lua/Ruby/JavaScript...
>  >
>  > As somebody who has tried to go through the library, this bit is the
>  > part I'd really like to understand. I'm sure the reorganisation
>  > would help, but I'd really love to read a short doc on how this
>  > actually all hangs together. The registry, how the templates
>  > automates the construction of the PyObject and Type, how conversions
>  > are looked up (what's that graph stuff in there?).
> 
>  The graph stuff is not in this layer, it's in the core.  It
>  implements something like this:
> 
>      dst_ptr = dynamic_cast(src_void_ptr, src_type_id, dst_type_id)
> 

Ok. So I think I need to know about the core as well then.


>  >
>  > I think I could use the library better and assist more in extending it
if I
>  > could put all the bits together in my head.(I have in mind something
like
>  > the big text file that Joel wrote for Phoenix.)
>  >
>  > Just putting in a bid for your time Dave...
> 
>  Well, I'd be happy to collaborate with you on an implementation
>  document.  It's not something I can afford to do by myself, in part
>  because I don't know what questions to answer.  If you would agree to
>  have a conversation with me about it here, and from that create a
>  RestructuredText document which we'll include in the CVS, I'd be more
>  than happy to type out details at length.  I think you might have to
>  dig into the code a little, too.  Deal?
> 

Deal. It be a bit slow at first as I am relocating to another country in the
next 10 days (NZ ->  Aussie), so my internet connection will be sporadic, and
I'll be busy finding a new home and settling in.

I'd like to approach it as though we are trying to write a simplified
version of boost.python, ignoring compiler workarounds, and not using the
preproc. We'll show a coded python C extension, an equivalent in
boost.python syntax, then go through the structures needed for the
boost.python code to generate the equivalently operating C extension code
that we initially showed.

We could work through examples like the ones on this page :

http://starship.python.net/crew/arcege/extwriting/pyext.html


ie.

python extension:
=================
PyObject *python_add(self, args)....
...
...
..


PyMethodDef methods[] = {
{
    "add", MyCommand, METH_VARARGS},
    {NULL, NULL},
};


void initexample()
{
    (void)Py_InitModule("add", methods);
}


equivalent in boost
==================
...
    def("add", python_add);


Explain how the boost example generated equivalent code to above using very
cut-down techniques that capture the 'essence' of the boost.python
implementation, but not the detail.
=================
1. The module def
2. how is the methods array created (or simulated)
3. How does argument parsing happen..
...etc..


Does this make sense?
Comments (from anyone)?

Cheers,
Brett






_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
David Abrahams
David Abrahams
Brett Calcott
Brett Calcott
David Abrahams
Brett Calcott
Brett Calcott
Joel de Guzman
David Abrahams
David Abrahams
Dirk Gerrits
David Abrahams
David Abrahams
Brett Calcott
Joel de Guzman
Nicodemus
David Abrahams
Roman Sulzhyk
David Abrahams
Nicodemus
Roman Sulzhyk
Nicodemus
David Abrahams
Nicodemus
Roman Sulzhyk
Nicodemus
Roman Sulzhyk
Nicodemus
David Abrahams
Nicodemus
Roman Sulzhyk
Ralf W. Grosse-Kunstleve
Nicodemus

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved