On Tue, Sep 29, 2009 at 1:36 PM, pancake <[email protected]> wrote: > I am planning to write a tool to generate bindings for Python/.NET/Perl/... > > My idea is to parse the vapi files and based on the signatures of the > functions > create the necesary stub to have the bindings for other languages. GIR and > related > are designed for GObject bindings. > > What I'm thinking is to do the same for non-gobject bindings. This is > because > Vala (in vapi files) allows to describe in a much better way the function > signatures > (like direction of refs, and out parameters) which C doesn't. > > I wrote some manual proof of concepts and I think that .net, python and lua > bindings > will be an easy task. > > I had not written anything yet, but I'm really interested on this for many > reasons, > (some projects of mine) and I would like to know your opinion and tips about > how to > face this. > > Should I use libvala? like valadoc does? Is there any example code iterating > over > methods, namespaces, arguments of signatures, etc..? > > Thanks! > > --pancake > _______________________________________________ > Vala-list mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/vala-list >
Hi, I have some old and not quite finished code that generates python ctypes bindings from vapi. Hopefully its useful. Though there have been a few vala releases since i played with it. http://github.com/Jc2k/valapy The code for pulling information out of namespaces and classes and functions is in the bindgen folder. There is some code thats mostly the valac entry point hacked to run my code and then some code to generate the ctypes bindings. It also builds a C program that generates a python file of any enums and constants in the vapi. There is also a pycode library which knows how to generate some simple python statements (enough for bindgen and then some). Its kind of like the ccode library in vala itself. I was at some point able to generate libsyncml bindings with this, but its been a while and im not sure what state i left it in. John _______________________________________________ Vala-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/vala-list
