-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 7 Feb 2006, Lalo Martins wrote:

Yes... the main point of this thing is running python code, so I'd be
using libpython anyway.  So I figured, the work of binding by hand would
probably be less than figuring out how to integrate the swig bindings.

Or in other words - why would I use the existing swig stuff?  :-)

I think that you will find that in the long run that SWIG is much more maintainable that keeping up a set of bindings by hand. First, since it generates them directly from the C++ API, you can avoid the situation where any change, no matter how small, causes the Python API to break.

Second, complete coverage of the VOS APIs (including metaobjects) means wrapping dozens of classes and hundreds of method calls. Do you really want to do that by hand?

Third, SWIG has very robust Python support, and I understand that it is used extensively at Google for their internal applications. It is quite flexible and permits overriding and extending the default SWIG behavior when needed.

Fourth, the module generated by SWIG is suitable for use by a pure Python program, or embedded in a C++ application. In either case you start your code off with an "import vos" and it just works. Of course we need a C++ library or plugin which links with libpython and initializes the interpreter, but once it is started and registers itself to with the appropriate callbacks, it should fade into the background.

Fifth, the current design is still C++ centric. The preferred way to add new metaobject types is to write a C++ class which can then be easily reflected into Python using SWIG. The design philosophy is to use message function calls within the same process, and message passing between sites*.

(* In fact from looking at the code I don't think sendMsgAndWaitForReply(), which is the standard function for RPC-style query/response calls, even works correctly if the destination object exists in-process. The reply message, while delivered to the sending object, will never be returned by the actual sendMsgAnd...() function. This is a bug). But I digress...

Anyways, the point is that you should take a closer look at SWIG if you haven't already. A little bit of time spent learning how to use it will mean a huge time savings in the grunt work of actually setting up the code to interface each and every API call.

[   Peter Amstutz   ][ [EMAIL PROTECTED] ][ [EMAIL PROTECTED]  ]
[Lead Programmer][Interreality Project][Virtual Reality for the Internet]
[ VOS: Next Generation Internet Communication][ http://interreality.org ]
[ http://interreality.org/~tetron ][ pgpkey:  pgpkeys.mit.edu  18C21DF7 ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFD6UU7aeHUyhjCHfcRAtO9AJ44HxRCogLcmGFXPr4ULuT2v7VXrwCfeCdk
gP1trD2aeCaF8xgNmdQZrhM=
=pktd
-----END PGP SIGNATURE-----


_______________________________________________
vos-d mailing list
vos-d@interreality.org
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d

Reply via email to