user-pic

Tom Molesworth

  • Commented on I hate unpacking sub calls with shift
    Perl community has moved away from using special predefined Perl variables such as $(, $), $:, $!, $^H, $/ or many others without explicitly commenting their purpose $! is common enough that it shouldn't need comments, though? If the...
  • Commented on Try rakudobrew and play with concurrency
    In some examples, it's actually an order of magnitude faster than Perl 5. That's astonishing given that Perl 5 is already the fastest dynamic language out there. In other examples, it's more than an order of magnitude slower I appreciate...
  • Commented on Please don't use ::Tiny unless it meets the ::Tiny criteria, thanks!
    okay, just spotted the link to http://beta.nntp.perl.org/group/perl.datetime/2007/01/msg6584.html from XML::Tiny, in the "beware of the leopard" section. Even the original modules don't comply with those rules any more though - Config::Tiny is 5.8+, unless it's rewriting the code on installation....
  • Commented on Please don't use ::Tiny unless it meets the ::Tiny criteria, thanks!
    Not sure how practical the suggestion to rename those modules would be. I would have thought that the 5.004 requirement would rule out anything that uses warnings, for a start. That's Routes::Tiny, Role::Tiny, Try::Tiny and HTTP::Tiny out of the picture...
  • Commented on Put your CPAN distributions on github
    Wasn't there a project to import all the CPAN distributions into github? If that's still running, seems that it wouldn't be a huge extra step to add links to those repos in metacpan. This would at least provide a fallback...
  • Commented on Conflict Resolution: local::lib and git's Perl
    Isn't the question why your system perl doesn't have List::Utils? That module has been in core for quite some time now. It's cases like that (software package $foo relying on a working perl) that still make a valid point for...
  • Commented on Do not use each
    Not using each() seems like good advice in general. I think that second problem unfairly singles out Data::Dumper, though - the bug is in the example code, not Data::Dumper itself. The iterator would also be reset if Dumper() used keys()...
  • Commented on POE::Session object_states: handlers are sub names not CODEREFs
    That's nothing to do with POE, though - you're just calling _poll_start / _poll_work etc. without parameters? perl -e'sub _poll_start { print "Called with @_\n" } my $thing = { start => _poll_start };' passing sub { $self->_poll_start } or...
  • Commented on Perl and Me, Part 2: The Power of OOP
    Interesting. It sounded like it was the boilerplate that you were calling out in particular, apologies if I misunderstood. Anyway, seems my experiences are pretty much the opposite - it's the Perl OO code which Just Works. Sure, a typo...
  • Commented on Perl and Me, Part 2: The Power of OOP
    You've mentioned several times that writing objects/classes in C++ is easier than in Perl. Would you be able to provide examples? Generally I find it to be the opposite, to the extent that I have Perl write my C++ code...
  • Commented on MooseStyle: Self-made inline vs cpan-based inline
    > Is your issue about Mo or about non-core dependencies? Neither - it's about modules which use Mo::Inline. Mo itself seems fine, if a module uses it and works, that's great. Non-core dependencies... the more the merrier. I have no...
  • Commented on MooseStyle: Self-made inline vs cpan-based inline
    An upgrade to Mo::Inline appears to be behind this issue for YAML: https://rt.cpan.org/Ticket/Display.html?id=90817 and I think a similar issue was behind this: https://rt.cpan.org/Ticket/Display.html?id=76664 It's not the most pleasant code to be debugging either. It's an interesting idea, but I'm treating...
  • Commented on Arrow Operator Shenanigans
    It's documented in 'Subroutine References as Methods' in perldoc perlobj: You can also use a subroutine reference as a method: $file->$sub(); This is exactly equivalent to writing "$sub->($file)". so I think it's fine to rely on this behaviour. Might be...
Subscribe to feed Recent Actions from Tom Molesworth

  • Nate Glenn commented on Try rakudobrew and play with concurrency

    I'm quite excited to use this! I wonder if it will be possible to patch rakudobrew to work on Windows.

  • Aristotle commented on Try rakudobrew and play with concurrency

    To be fair, I think that's only the case for micro-benchmarks that compare Perl 6 **built-in** features with the equivalent features provided by bloated/unoptimized/neglected Perl 5 **modules**. For example, Perl 6's built-in Rat type vs Perl 5's Math::BigRat.

    No, actually, that is no longer true. There are cases where Rakudo/MoarVM keeps up with Perl 5 at built-ins, or beats it handily. At built-ins. Check out the benchmarks and see for yourself. There is a little “[Code]” button ne…

  • smls commented on Try rakudobrew and play with concurrency
    There are cases where Rakudo/MoarVM keeps up with Perl 5 at built-ins, or beats it handily. At built-ins. Check out the benchmarks and see for yourself.

    I only see 3 kinds of micro-benchmarks on that page where Perl 6 comes in faster or as fast as Perl 5:

    1. Empty loops combined with integer arithmetic: while_empty_native, postwhile_nil_native, loop_empty_native

      This seems like an altogether archaic use-case from a P5 point of view (that is, probably not very meaningful with regards to real-life code).

    2. Rational number ar…
  • Aristotle commented on Try rakudobrew and play with concurrency
    But lets not call it before it happens... :)

    The way I understand these results is “here is proof positive that it can”: a plausible promise. There are still seasons’ worth of low-hanging fruit ahead, anywhere you look, so the fact that we have these results now is an encouraging indicator of how high the effort might be able to reach.

    Before this point, that was always the claim and the idea, and for some people it was the reasonable expectation, but there was no tangible evidence. It remains to be seen if the promise can be fulfilled, but th…

  • Olivier Mengué (dolmen) commented on I hate unpacking sub calls with shift

    Note also that @_ is alias to arguments given to the sub which means that it gives you not only read access to the argument, but also write access if it is a variable.

    my $a = 2;
    say $a;
    
    

    sub change_arg_0
    {
    $_[0] = 1;
    }

    change_arg_0($a);
    say $a;

Subscribe to feed Responses to Comments from Tom Molesworth

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.