Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Automatic generation of lablgtk bindings #106
lablgtk bindings are (mostly) hand-written. The Haskell guys instead made a much better job, automatically generating their bindings from GI (GObject Introspection). I have assigned to a master student of mine the task of trying to adapt the Haskell code to spit-out "lablgtk"-like bindings.
The student worked extremely well and there is now a working prototype at:
The prototype is not fully completed: some ad-hoc Gtk types (eg. GArrays) still need some code. However it can already generate twice the number of methods of the current bindings and it should work on any GI library. I have tried a few examples and they work.
The student has now ended his master period and I need to decide if investing more resources on the project or not. Here I list some pros&cons of automatic generation:
What are your opinions?
Great. I am slowly porting the various examples and applications to iron out bugs/discrepancies and to reduce the manually generated code base. It is not ready yet for prime time.
The only thing that is a bit annoying w.r.t. lablgtk3 is lack of labels and default values for method arguments. Labels are easy to add, maybe only when two parameters have the same type. But there is no way to have reasonable default values for optional parameters because the info is not in GIR (despite many implementors of bindings voicing for them).
As soon as it is reasonably stable I will ask for help. In particular it would be cool to try to port some large application (Matita and Coq for example).
@garrigue: do you have any comment?