Re: [gdome]user_data and language bindings



On 5 Apr 2002, John Palmieri wrote:
> On Fri, 2002-04-05 at 06:16, Tobias Peters wrote:
> > It's just much more efficient to simply use the user_data pointer. Admit:
> > I have not thought that people would want to use the same gdome tree from
> > two different languages, and then still want to use the user_data
> > themselves. Not really polite by these people.
> >
>
> Truthfully it is impolite to use user_data for infastrcutre.  Isn't it
> by definition for the user? :-)  In that case my use would be
> illigitimate to.

The gdome library itself does the very same thing inside the libxml tree:
it uses the _private field of the libxml data structures for pointers to
the gdome structures. These fields have just a different name.

>  Actualy I see using user_data for scripting languages
> a bit overeaching since shouldn't the scripting language simply
> encapsulate the API and provide interfaces into the C api?

No. These bindings should provide an API which is apropriate for that
particular scripting language. They should also care for the memory
management and must at all cost prevent the user from crashing the
application by accessing illegal memory. The target audience for a
language binding are IMHO people who develop their applications entirely
in that language. I see the ability to use the same data structure from
different languages only as an additional bonus that may be possible only
with restrictions.

Having said that, it would of course be possible to allow or disallow the
use of the user_data field by the language binding as an additional
parameter.

>  I guess I
> just see scripting lanugaes a means to an end where the scripting
> language extends Gdome.

I view them as tools to develop applications in much less lines of code
and with much less worries.

[...]

Tobias




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]