Skip Menu |

This queue is for tickets about the AnyEvent-Handle-UDP CPAN distribution.

Report information
The Basics
Id: 116560
Status: open
Priority: 0/
Queue: AnyEvent-Handle-UDP

People
Owner: Nobody in particular
Requestors: alexchandel [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Remove Moo dependency
Could you remove the Moo dependency? Moo brings compile-time and runtime overhead, and adds to the dependencies of anyone using AnyEvent-Handle-UDP. It shouldn't be hard. The original AnyEvent-Handle doesn't use any object system, and it does a lot more than AnyEvent-Handle-UDP does. You should also also remove the "use strict;" and "use warnings FATAL => 'all';" lines. They might be useful for testing, but these can break some programs, and like Moo shouldn't be forced on the user.
On 2016-07-28 15:34:00, alexchandel@gmail.com wrote: Show quoted text
> You should also also remove the "use strict;" and "use warnings FATAL > => 'all';" lines. They might be useful for testing, but these can > break some programs, and like Moo shouldn't be forced on the user.
Neither of these will affect your code. They have limited scope.
From: alexchandel [...] gmail.com
On Thu Jul 28 20:38:45 2016, ETHER wrote: Show quoted text
> On 2016-07-28 15:34:00, alexchandel@gmail.com wrote: >
> > You should also also remove the "use strict;" and "use warnings FATAL > > => 'all';" lines. They might be useful for testing, but these can > > break some programs, and like Moo shouldn't be forced on the user.
> > Neither of these will affect your code. They have limited scope. >
This isn't necessarily true. Though rare, there are some modules that interfere with strict everywhere. And more commonly, warnings are added and removed between perl versions, potentially causing the user of this module to fatally die until the module is updated. But there's already bug #110560 for this. But using Moo (and namespace::clean and Sub::Name) for a simple module seems to consign the user with unnecessary dependencies and overhead.
Subject: Re: [rt.cpan.org #116560] Remove Moo dependency
Date: Fri, 29 Jul 2016 09:30:37 +0200
To: bug-AnyEvent-Handle-UDP [...] rt.cpan.org
From: Leon Timmermans <leont [...] cpan.org>
On Fri, Jul 29, 2016 at 12:34 AM, alexchandel@gmail.com via RT < bug-AnyEvent-Handle-UDP@rt.cpan.org> wrote: Show quoted text
> Could you remove the Moo dependency? Moo brings compile-time and runtime > overhead, and adds to the dependencies of anyone using AnyEvent-Handle-UDP. > > It shouldn't be hard. The original AnyEvent-Handle doesn't use any object > system, and it does a lot more than AnyEvent-Handle-UDP does. >
Yeah, if I'd write it today I wouldn't have used Moo (mainly for the dependencies, the compile-time costs are relatively low and the runtime costs are pretty much non-existent), but given I'm no longer using Anyevent this is a really low priority. It may not be hard to convert, but it is a non-trivial amount of work. Patches welcome I suppose. Show quoted text
> You should also also remove the "use strict;" and "use warnings FATAL => > 'all';" lines. They might be useful for testing, but these can break some > programs, and like Moo shouldn't be forced on the user. >
I don't fatalize my warnings anymore in new code, but removing warnings altogether and even strict is not making sense at all. Leon
From: alexchandel [...] gmail.com
On Fri Jul 29 03:31:07 2016, LEONT wrote: Show quoted text
> On Fri, Jul 29, 2016 at 12:34 AM, alexchandel@gmail.com via RT < > bug-AnyEvent-Handle-UDP@rt.cpan.org> wrote: >
> > Could you remove the Moo dependency? Moo brings compile-time and > > runtime > > overhead, and adds to the dependencies of anyone using AnyEvent- > > Handle-UDP. > > > > It shouldn't be hard. The original AnyEvent-Handle doesn't use any > > object > > system, and it does a lot more than AnyEvent-Handle-UDP does. > >
> > Yeah, if I'd write it today I wouldn't have used Moo (mainly for the > dependencies, the compile-time costs are relatively low and the > runtime > costs are pretty much non-existent), but given I'm no longer using > Anyevent > this is a really low priority. It may not be hard to convert, but it > is a > non-trivial amount of work. Patches welcome I suppose. > >
> > You should also also remove the "use strict;" and "use warnings FATAL > > => > > 'all';" lines. They might be useful for testing, but these can break > > some > > programs, and like Moo shouldn't be forced on the user. > >
> > I don't fatalize my warnings anymore in new code, but removing > warnings > altogether and even strict is not making sense at all. > > Leon
I did most of the rewriting myself, attached. It's a fairly literal translation, preserving all the underscored methods. The only thing I didn't translate was the type-checking & range-checking on a few attributes. I also didn't change the calls to used symbols to use global names instead, but it's easy to find/replace them. I also found two places where the "fh" key was directly accessed instead of the "fh" method, on lines 310 and 323 in the original file. I'm not sure if this was intentional to work around something, but I changed it in the attached file. I tested it with a small UDP example, but you should diff/test it yourself.
Subject: UDP.pm

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #116560] Remove Moo dependency
Date: Sun, 8 Jan 2017 20:31:25 +0100
To: bug-AnyEvent-Handle-UDP [...] rt.cpan.org
From: Leon Timmermans <fawaka [...] gmail.com>
On Tue, Aug 2, 2016 at 5:30 PM, alexchandel@gmail.com via RT < bug-AnyEvent-Handle-UDP@rt.cpan.org> wrote: Show quoted text
> Queue: AnyEvent-Handle-UDP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=116560 > > > On Fri Jul 29 03:31:07 2016, LEONT wrote:
> > On Fri, Jul 29, 2016 at 12:34 AM, alexchandel@gmail.com via RT < > > bug-AnyEvent-Handle-UDP@rt.cpan.org> wrote: > >
> > > Could you remove the Moo dependency? Moo brings compile-time and > > > runtime > > > overhead, and adds to the dependencies of anyone using AnyEvent- > > > Handle-UDP. > > > > > > It shouldn't be hard. The original AnyEvent-Handle doesn't use any > > > object > > > system, and it does a lot more than AnyEvent-Handle-UDP does. > > >
> > > > Yeah, if I'd write it today I wouldn't have used Moo (mainly for the > > dependencies, the compile-time costs are relatively low and the > > runtime > > costs are pretty much non-existent), but given I'm no longer using > > Anyevent > > this is a really low priority. It may not be hard to convert, but it > > is a > > non-trivial amount of work. Patches welcome I suppose. > > > >
> > > You should also also remove the "use strict;" and "use warnings FATAL > > > => > > > 'all';" lines. They might be useful for testing, but these can break > > > some > > > programs, and like Moo shouldn't be forced on the user. > > >
> > > > I don't fatalize my warnings anymore in new code, but removing > > warnings > > altogether and even strict is not making sense at all. > > > > Leon
> > I did most of the rewriting myself, attached. It's a fairly literal > translation, preserving all the underscored methods. The only thing I > didn't translate was the type-checking & range-checking on a few > attributes. I also didn't change the calls to used symbols to use global > names instead, but it's easy to find/replace them. > > I also found two places where the "fh" key was directly accessed instead > of the "fh" method, on lines 310 and 323 in the original file. I'm not sure > if this was intentional to work around something, but I changed it in the > attached file. > > I tested it with a small UDP example, but you should diff/test it yourself. >
Your code was not passing the timeout unit tests. I rewrote it myself, and released it to CPAN. Leon