Adding Glib::IO to the released modules

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Adding Glib::IO to the released modules

Emmanuele Bassi
Hi all;

would it be possible to make a release of Glib::IO? Right now, it's
basically impossible to write idiomatic Gtk3 code — i.e. using
GtkApplication and GtkApplicationWindow — because you need to install
Glib::IO from Git, as opposed of CPAN; additionally, Linux
distribution won't package the module unless it has a release. This
makes the Perl bindings less featureful and integrated with the rest
of the GNOME platform.

I know that Glib::IO is very much experimental, but at this point all
it needs is an updated POD blurb and a simple tarball. There's also
the argument that until it gets a release, we won't see any actual
user, and thus no bug reports nor patches.

Ciao,
 Emmanuele.

--
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding Glib::IO to the released modules

oldtechaa
I use Glib::IO and it doesn't take any special work. You can use GIR to create a binding, and since the C library is already on the system (it has to be to use GTK+) GIR finds it and binds it. Here's how I use it:

use Glib::Object::Introspection;
Glib::Object::Introspection->setup(
'basename' => 'Gio',
'version' => '2.0',
'package' => 'Glib::IO'
);

If you want to see more about how it works, see my project at:
https://github.com/oldtechaa/SeekMIDI/blob/master/bin/SeekMIDI.pl

or see MaxPerl's tutorial here about it:
https://github.com/MaxPerl/perl-Gtk3-Tutorial

oldtechaa

On June 16, 2017 6:08:42 AM EDT, Emmanuele Bassi <[hidden email]> wrote:
Hi all;

would it be possible to make a release of Glib::IO? Right now, it's
basically impossible to write idiomatic Gtk3 code — i.e. using
GtkApplication and GtkApplicationWindow — because you need to install
Glib::IO from Git, as opposed of CPAN; additionally, Linux
distribution won't package the module unless it has a release. This
makes the Perl bindings less featureful and integrated with the rest
of the GNOME platform.

I know that Glib::IO is very much experimental, but at this point all
it needs is an updated POD blurb and a simple tarball. There's also
the argument that until it gets a release, we won't see any actual
user, and thus no bug reports nor patches.

Ciao,
Emmanuele.

_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding Glib::IO to the released modules

Emmanuele Bassi
On 16 June 2017 at 12:58, oldtechaa <[hidden email]> wrote:
> I use Glib::IO and it doesn't take any special work. You can use GIR to
> create a binding, and since the C library is already on the system (it has
> to be to use GTK+) GIR finds it and binds it.

I know how introspection works. :-)

What I'm asking is to make a release of the existing Glib::IO module,
so that people can depend on it on CPAN and Linux distributions can
package it, like they do for Gtk3.

Ciao,
 Emmanuele.

> On June 16, 2017 6:08:42 AM EDT, Emmanuele Bassi <[hidden email]> wrote:
>>
>> Hi all;
>>
>> would it be possible to make a release of Glib::IO? Right now, it's
>> basically impossible to write idiomatic Gtk3 code — i.e. using
>> GtkApplication and GtkApplicationWindow — because you need to install
>> Glib::IO from Git, as opposed of CPAN; additionally, Linux
>> distribution won't package the module unless it has a release. This
>> makes the Perl bindings less featureful and integrated with the rest
>> of the GNOME platform.
>>
>> I know that Glib::IO is very much experimental, but at this point all
>> it needs is an updated POD blurb and a simple tarball. There's also
>> the argument that until it gets a release, we won't see any actual
>> user, and thus no bug reports nor patches.
>>
>> Ciao,
>>  Emmanuele.
>
>
> _______________________________________________
> gtk-perl-list mailing list
> [hidden email]
> https://mail.gnome.org/mailman/listinfo/gtk-perl-list
>



--
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Aw: Re: Adding Glib::IO to the released modules

max.augsburg
Dear Emmanuele,
 
I fully agree with you. It would be great, if Glib::IO could be released. The manual making of the Glib::IO-binding "on the fly", as oldteecha described, is a very good workaround. I use it myself in several simple projects without problems. But the best solution would be a simple "use Glib::IO;".
 
We discussed this some time ago on the list. But I think, there was nobody, who could maintain the Glib::IO module. Jeremy Volkening and I worked a little bit on the module. But we had not enough time to make it release-ready. And in my case, I don't have the competence to really maintain such a complex module!
 
The only problem I noticed with Glib::IO was, that GIO reads and writes files in raw bytes format, which means everything is passed on without any encoding/decoding. For compability with perl strings one have to convert the bytes (= pure digits) to a bytestring without encoding and then to decode this bytrstring in the utf8 encoding format. The following two lines was for example for th Glib::IO::File::load_contents method:
$content = pack 'C*', @{$content};
my $content_utf8 = decode('utf-8', $content);
 
I tried to fix this (see https://github.com/jvolkening/perl-Glib-IO/pull/1) for the relevant methods in the Glib::IO::File part. But I don't know whether this is a good solution for the problem. I decided that the decoding task (the second command) furthermore has to do manually because perhaps somebody needs another encoding. Perhaps you know a better solution? In any case it would be great if you could check the patch and merge it before releasing...
 
If I could, I would like to help you. But I have not the skill and moreover at the moment the time to really help.
 
Nevertheless thank you very much for your work!
 
Best wishes,
Max
 
 
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: Adding Glib::IO to the released modules

Emmanuele Bassi
On 16 June 2017 at 20:28,  <[hidden email]> wrote:
> Dear Emmanuele,
>
> I fully agree with you. It would be great, if Glib::IO could be released. The manual making of the Glib::IO-binding "on the fly", as oldteecha described, is a very good workaround. I use it myself in several simple projects without problems. But the best solution would be a simple "use Glib::IO;".
>
> We discussed this some time ago on the list. But I think, there was nobody, who could maintain the Glib::IO module. Jeremy Volkening and I worked a little bit on the module. But we had not enough time to make it release-ready. And in my case, I don't have the competence to really maintain such a complex module!

It's been a while since I maintained a Perl module, but I'd be happy
to work on it.

> The only problem I noticed with Glib::IO was, that GIO reads and writes files in raw bytes format, which means everything is passed on without any encoding/decoding. For compability with perl strings one have to convert the bytes (= pure digits) to a bytestring without encoding and then to decode this bytrstring in the utf8 encoding format. The following two lines was for example for th Glib::IO::File::load_contents method:
> $content = pack 'C*', @{$content};
> my $content_utf8 = decode('utf-8', $content);
>
> I tried to fix this (see https://github.com/jvolkening/perl-Glib-IO/pull/1) for the relevant methods in the Glib::IO::File part. But I don't know whether this is a good solution for the problem. I decided that the decoding task (the second command) furthermore has to do manually because perhaps somebody needs another encoding. Perhaps you know a better solution? In any case it would be great if you could check the patch and merge it before releasing...

I think we should leave the contents alone; decoding the data into
UTF-8 is not always appropriate — GIO can be, and often is, used to
load binary data. If you want to automatically encode/decode to/from
UTF-8, you should use one of the GConverter interface implementations;
or use a pure Perl implementation, if you know what you're doing.
Returning an array of bytes is perfectly fine.

Ciao,
 Emmanuele.

--
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding Glib::IO to the released modules

"Torsten Schönfeld"
Hi Emmanuele!

On 20.06.2017 12:35, Emmanuele Bassi wrote:
>> We discussed this some time ago on the list. But I think, there was nobody, who could maintain the Glib::IO module. Jeremy Volkening and I worked a little bit on the module. But we had not enough time to make it release-ready. And in my case, I don't have the competence to really maintain such a complex module!
>
> It's been a while since I maintained a Perl module, but I'd be happy
> to work on it.

Please feel free to go ahead then.  For a first release, I think the
documentation placeholders ("XXX" in README and lib/Glib/IO.pm) should
be handled.  When you do this, please also update all the copyright and
author statements, as you will have written most of the module by then. :-)

Maybe Brian can be coaxed to handle the actual CPAN and SourceForge
release process?

A separate question is whether Gtk3 should automatically load Glib::IO,
which pulls in the rather large GIO API.  On my machine, adding "use
Glib::IO" to Gtk3 increases the load time from roughly 0.068 s to 0.084
s (measured with "dumbbench -- perl -MGtk3 -e0"), i.e., a slow-down of
about 24 %.  Is this significant enough to warrant the inconvenience of
having to manually load Glib::IO when needed?

-Torsten
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding Glib::IO to the released modules

Brian Manning-2
On Fri, Jun 23, 2017 at 2:36 AM, Torsten Schoenfeld <[hidden email]> wrote:

> On 20.06.2017 12:35, Emmanuele Bassi wrote:
>>> We discussed this some time ago on the list. But I think, there was nobody, who could maintain the Glib::IO module. Jeremy Volkening and I worked a little bit on the module. But we had not enough time to make it release-ready. And in my case, I don't have the competence to really maintain such a complex module!
>>
>> It's been a while since I maintained a Perl module, but I'd be happy
>> to work on it.
>
> Please feel free to go ahead then.  For a first release, I think the
> documentation placeholders ("XXX" in README and lib/Glib/IO.pm) should
> be handled.  When you do this, please also update all the copyright and
> author statements, as you will have written most of the module by then. :-)
>
> Maybe Brian can be coaxed to handle the actual CPAN and SourceForge
> release process?

I'd be happy to do releases.  Please let me know on the list or in IRC
when you're ready to do the first release, and I'll take a whack at
it.

Thanks,

Brian
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Loading...