How to find out the API coverage of Perl bindings

View: New views
5 Messages — Rating Filter:   Alert me  

How to find out the API coverage of Perl bindings

by Emmanuel Rodriguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Is there a way to find which functions are not covered by a specific Perl binding? For the moment I'm mainly concerned of bindings for C libraries that are using Glib/GObject.

I've realized that Champlain.pm (the bindings  for libchamplain) is missing coverage for a few methods defined in the public API. For now the best thing that I could find was to use "nm" on the blib .so and on the C library and to compare the results after transforming the output. This method is far from being the best as it can't handle XS function aliases, but it's the best that I can come up. This is a simplication of what I do now:

  nm --defined-only --extern-only blib/arch/auto/Champlain/Champlain.so | grep XS
  nm --defined-only --extern-only /usr/lib/libchamplain-0.3.so | grep -v '_get_type'

The python maintainer of the same library told me that he gets a warning for symbols that are not covered by his bindings. Is there a way to do the same for the Perl bindings?

--
Emmanuel Rodriguez

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: How to find out the API coverage of Perl bindings

by Torsten Schoenfeld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 12.07.2009 09:35, Emmanuel Rodriguez wrote:
>    nm --defined-only --extern-only blib/arch/auto/Champlain/Champlain.so |
> grep XS
>    nm --defined-only --extern-only /usr/lib/libchamplain-0.3.so | grep -v
> '_get_type'

You could run `nm --undefined-only` on your bindings' Champlain.so to
get a list of external symbols used.  Apart perhaps from stuff from
glibc and the Glib and Gtk2 bindings, these will exactly be those
functions in libchamplain that you wrap.
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: How to find out the API coverage of Perl bindings

by muppet-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 12, 2009, at 3:35 AM, Emmanuel Rodriguez wrote:

> The python maintainer of the same library told me that he gets a  
> warning for symbols that are not covered by his bindings. Is there a  
> way to do the same for the Perl bindings?

That's most likely because pygtk and friends use some header scrapers  
to generate a large portion of uninteresting bindings.  We didn't use  
that when starting gtk2-perl because, well, for uninteresting  
bindings, all you need is a function prototype, and generating the  
input to a code generator seemed a little perverse.

Have you considered the glib introspection repository stuff?  I recall  
that Torsten had some success a while back, but haven't heard anything  
since...


--
Overheard during a game of Lego Star Wars II:
Zella: I can't do it!
Yvonne: You have to do it!
Zella: I'm trying!
Yvonne: There is no try!



_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: How to find out the API coverage of Perl bindings

by Torsten Schoenfeld :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 13.07.2009 06:04, muppet wrote:
> Have you considered the glib introspection repository stuff? I recall
> that Torsten had some success a while back, but haven't heard anything
> since...

The introspection stuff lives at
<http://git.gnome.org/cgit/gnome-perl-introspection>; a slightly
outdated description is at
<http://live.gnome.org/GTK2-Perl/Introspection>.  I haven't tried it
lately, but it should be in good shape.  All the pieces for dynamically
wrapping entire libraries are there; gio, for example, should be
completely doable.  Unfortunately, I haven't been able to get round to
finishing this stuff up.
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Re: How to find out the API coverage of Perl bindings

by Emmanuel Rodriguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Jul 13, 2009 at 8:49 AM, Torsten Schoenfeld <kaffeetisch@...> wrote:
On 13.07.2009 06:04, muppet wrote:
Have you considered the glib introspection repository stuff? I recall
that Torsten had some success a while back, but haven't heard anything
since...
I'm not too familiar with the glib introspection. Although from what I understood the C library that will be binded needs to support the introspection framework, right?
 
The introspection stuff lives at <http://git.gnome.org/cgit/gnome-perl-introspection>; a slightly outdated description is at <http://live.gnome.org/GTK2-Perl/Introspection>.  I haven't tried it lately, but it should be in good shape.  All the pieces for dynamically wrapping entire libraries are there; gio, for example, should be completely doable.  Unfortunately, I haven't been able to get round to finishing this stuff up.
Does this means that we no longer need to write bindings by hand? If all we need is to provide a .typelib file to Glib::Object::Introspection things are going to become easier!
--
Emmanuel Rodriguez

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@...
http://mail.gnome.org/mailman/listinfo/gtk-perl-list