[Kde-bindings] Qyoto: Patch - generate argument names from external files

Dimitar Dobrev dpldobrev at yahoo.com
Tue Apr 10 20:01:47 UTC 2012

I didn't think of that (interning the strings), however, I eliminated the repetition of whole lines, which turned out quite often. Fro example, there is a method that does translation (the Tr method, I think) which has an overload with r, c, n. Many classes use this method and instead of repeating the "r, c, n" line I just change the argNamesIndex to point to the single copy of this line. I believe this approach can be combined with interning.

 From: Richard Dale <richard.dale at telefonica.net>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Tuesday, April 10, 2012 9:15 PM
Subject: Re: [Kde-bindings] Qyoto: Patch - generate argument names from external files
On Tuesday, April 10, 2012 07:48:06 PM Arno Rehn wrote:
> On 09/04/12 20:45, Richard Dale wrote:
> > On Tuesday, March 20, 2012 02:10:58 PM Arno Rehn wrote:
> >> But I really would like to keep the Smoke lib as it is, for now.
> >> The next time we break BC in SMOKE, we should do it properly and
> >> introduce
> >> PImpl so we can add functionality as we like.
> > 
> > I've started looking at Smoke bindings for Qt5 and the obvious place to
> > break binary compatibiltiy is when we do those.
> > 
> > I think having argument names in the smoke libs is really useful. Would it
> > be possible to add some sort of option to smokegen so that it generates
> > argument names?
> > 
> > Having an extra text file seems a bit clunky, and maybe we can get the
> > feature debugged with Qt5 bindings and add anything else we think is
> > important for the next BIC Smoke release. Then backport it to the Qt4
> > bindings when it is all 100% there and working?
> I agree about the argument names in text files being clunky; still I
> don't think it's such a good idea to include them in the SMOKE libs
> themselves.
> Argument names aren't required for running apps; it's really only useful
> if you generate bindings and wastes memory in all other cases. Has
> anyone done some measurements on how much larger a smoke libs is when we
> include argument names?
Does Dimitar's patch intern the strings for the argument names so that you 
don't store the string 'arg1' for every single method where it is used, but 
instead give it an int identifier like Smoke handles type names.

> Maybe we can compress the argument names with bzip2 or lzma and then
> include them in the library. Considering that they are plain text, it
> should work reasonably well. Decompression will then be done on demand
> and shouldn't have an impact on normal apps.
I think interning the strings would work quite well because there is probably 
a lot of repetition in argument names.

I see an important use case being the smokeapi tool or whenever you want to 
introspect the Smoke libs - it looks a lot better and is more meaningful with 
the original argument names.

-- Richard
Kde-bindings mailing list
Kde-bindings at kde.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20120410/8a9bed38/attachment.html>

More information about the Kde-bindings mailing list