Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of nicholas (3034)

Saturday May 10, 2008
04:40 PM

Expanding disks for fun and profit

$ df
Filesystem    1K-blocks     Used Available Capacity  Mounted on
/dev/disk0s2   33554432 29457252   3841180    89%    /
devfs               111      111         0   100%    /dev
fdesc                 1        1         0   100%    /dev
/dev/disk0s3   16777216 16046752    730464    96%    /Volumes/Stuff
map -hosts            0        0         0   100%    /net
map auto_home         0        0         0   100%    /home
$ df
Filesystem    1K-blocks     Used Available Capacity  Mounted on
/dev/disk0s2   33554432 29457252   3841180    89%    /
devfs               111      111         0   100%    /dev
fdesc                 1        1         0   100%    /dev
/dev/disk0s3   20840448 16046808   4793640    77%    /Volumes/Stuff
map -hosts            0        0         0   100%    /net
map auto_home         0        0         0   100%    /home

The first and the second df are truthfully one after the other on in the same shell, on the same machine, without rebooting. The only thing I did was to run Disk Utility, and drag the size of the partition to make it bigger. Live. Without dismounting the disk. Crazy.

Tuesday April 29, 2008
06:07 AM

Who has the best state implementation?

Who has the best state implementation? (For some arbitrary definition of "best".) Let's see:

$ cat state.pl
sub foo {
    state $bar = "Pie";
    say $bar;
    $bar = "Good";
}
foo();
foo();
Rakudo?

$ ./parrot languages/perl6/perl6.pbc state.pl
scope declarator 'state' not implemented at line 2, near "= \"Pie\";\n "
current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)
called from Sub 'parrot;Perl6;Grammar;Actions;_block1900' pc 107647 (src/gen_actions.pir:5109)
called from Sub 'parrot;Perl6;Grammar;Actions;_block1890' pc 107410 (src/gen_actions.pir:5015)
called from Sub 'parrot;Perl6;Grammar;Actions;_block1864' pc 107316 (src/gen_actions.pir:4975)
called from Sub 'parrot;Perl6;Grammar;Actions;scope_declarator' pc 105807 (src/gen_actions.pir:4402)
called from Sub 'parrot;Perl6::Grammar;scope_declarator' pc 73809 (src/gen_grammar.pir:22436)
called from Sub 'parrot;Perl6::Grammar;noun' pc 66663 (src/gen_grammar.pir:19982)
called from Sub 'parrot;Perl6::Grammar;term' pc 62462 (src/gen_grammar.pir:18460)
called from Sub 'parrot;PGE::OPTable;parse' pc 1998 (compilers/pge/PGE/OPTable.pir:532)
called from Sub 'parrot;Perl6::Grammar;statement' pc 18468 (src/gen_grammar.pir:3117)
called from Sub 'parrot;Perl6::Grammar;statementlist' pc 15720 (src/gen_grammar.pir:2170)
called from Sub 'parrot;Perl6::Grammar;statement_block' pc 13578 (src/gen_grammar.pir:1384)
called from Sub 'parrot;Perl6::Grammar;block' pc 14687 (src/gen_grammar.pir:1795)
called from Sub 'parrot;Perl6::Grammar;routine_def' pc 48620 (src/gen_grammar.pir:13549)
called from Sub 'parrot;Perl6::Grammar;routine_declarator' pc 47075 (src/gen_grammar.pir:13013)
called from Sub 'parrot;Perl6::Grammar;noun' pc 66887 (src/gen_grammar.pir:20052)
called from Sub 'parrot;Perl6::Grammar;term' pc 62462 (src/gen_grammar.pir:18460)
called from Sub 'parrot;PGE::OPTable;parse' pc 1998 (compilers/pge/PGE/OPTable.pir:532)
called from Sub 'parrot;Perl6::Grammar;statement' pc 18468 (src/gen_grammar.pir:3117)
called from Sub 'parrot;Perl6::Grammar;statementlist' pc 15720 (src/gen_grammar.pir:2170)
called from Sub 'parrot;Perl6::Grammar;statement_block' pc 13578 (src/gen_grammar.pir:1384)
called from Sub 'parrot;Perl6::Grammar;TOP' pc 10420 (src/gen_grammar.pir:204)
called from Sub 'parrot;PCT::HLLCompiler;parse' pc 564 (src/PCT/HLLCompiler.pir:348)
called from Sub 'parrot;PCT::HLLCompiler;compile' pc 440 (src/PCT/HLLCompiler.pir:291)
called from Sub 'parrot;PCT::HLLCompiler;eval' pc 755 (src/PCT/HLLCompiler.pir:450)
called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)
called from Sub 'parrot;PCT::HLLCompiler;command_line' pc 1246 (src/PCT/HLLCompiler.pir:676)
called from Sub 'parrot;Perl6::Compiler;main' pc 8860 (perl6.pir:183)
Pugs?

$ ./pugs state.pl
Pie
Pie
Perl 5

$ /usr/local/perl-5.10.0/bin/perl -Mfeature=:5.10 state.pl
Pie
Good

Yes, strange as it may seem, Perl 5 has the most complete implementation of Perl 6's state†. Only Perl 5 performs an initialisation via = once. I blame Rafael, Dave and me.

† At least this week. For some value of this week. Until someone reads this Perl blog and gets hacking.

Friday April 25, 2008
06:45 AM

What a nice business model; shame if anything happened to it

I had a further little thought about that Flash contraption that would like to sell you sound clips for £1·50. Notably, be you alive, dead or zombie, mechanical copyright in the UK is still only 50 years, which means that most of the Goon Show (1951-1960) is now out of copyright. Oops.

Except, not being a lawyer but sometimes being a reasonably good pedant with a twisted defensive mind, I've no idea whether:

  1. to take advantage of this you would need to find a recording that is at least 50 years old
  2. or even more tightly, a recording that was legally made 50 years ago
  3. and whether there would still be other royalties owing for the authorship rights on the scripts (and similarly for the rights due to the songwriters of the music)
05:08 AM

Oh, the irony

Yet www.spike-milligan.com is entirely Flash! :-( With Sound :-( Except that it's Brazil...

At least it didn't take much detective work to find out why on Earth there is a harmonica version of Brazil there. Better still, the whole thing is over on the Goon Show Guide. Now, how does one convert .swf to other audio formats?

Thursday April 24, 2008
12:13 PM

Where am I?

(gdb) call Perl_eval_pv(my_perl, "Carp::cluck('Hello world!')", 0)
Hello world! at lib/File/Basename.pm line 52
        File::Basename::BEGIN() called at (eval 28) line 0
        eval {...} called at (eval 28) line 0
        require File/Basename.pm called at lib/File/Copy.pm line 55
        File::Copy::_catname('file-98616', 'lib') called at lib/File/Copy.pm line 112
        File::Copy::copy('file-98616', 'lib') called at lib/File/Copy.t line 125
$8 = (SV *) 0x1008e4838

Yes, it's logical, and I'm sure it's been done before, but I don't remember anyone noting it as a useful hack. Dear lazyweb, which prior art have I missed?

06:38 AM

There's more than one way to do it

The guy leading Microsoft's port of Ruby to .NET has warned of a potential Balkanization of Ruby, which could impair the language's success.

http://www.regdeveloper.co.uk/2008/04/24/ruby_balkanization_john_lam/

This is a stronger wording on the same theme from the same guy (John Lam) as a story about a month ago on the Register which I commented on here.

I'm wary (maybe too wary) of the possibilities of Balkanisation of Perl 5. I remember richardc having a lot of pain with a bug report that he couldn't replicate for one of his modules - turned out in the end that the end user's perl reported itself as "5.8.1" but was actually "5.8.1 RC3", and RC3 had the bug, whereas vanilla 5.8.1 did not. This is one reason why I'm very reluctant to bump maintenence version numbers until close to the release - even if it's an intermediate version, anything claiming to be 5.8.$n but actually a bit more recent should have no new bugs, and some old bugs fixed, whereas if the same executable reported itself as 5.8.$n + 1 then it may not have all the bugs fixed that the true 5.8.$n + 1 release has, leading to much wailing and gnashing of teeth. I'm not happy if people ship a perl that happens to have more command line options, because unknowing users will assume that they are standard, add them to their #! line, and if the program is migrated to another OS, they will assume that the breakage is a bug in Perl, and we look bad. So I added a test that all unknown options remain unknown :-). And I'm not totally comfortable when distributions ship 5.8.x with syntax changing patches such as the defined-or patch, as that, again, could lead to "Perl" programs that work here, but fail with a syntax error there. Although at least the defined-or patch is well written, and makes its presence known in -V.

So it's reassuring to know that Perl 6 starts out with a single strong test suite (which it sounds like @Ruby is only just getting to), as that will reduce fragmentation. Plus, recently a new face, John M. Dlugosz, appeared on Perl 6 Language, and is working hard to hammer out the ambiguities in the Synopses to make them proper specs.

On the down side, I note that Ruby has 5 funded implementations, whereas Perl 6 has about ½ a funded Perl 6 implementation, and 0 funded Perl 5 implementations. (And, grr, when I asked for feedback on the viability of a plan on trying to raise that figure, Perl 5 Porters digress away from helpful things like "try it" or "this specific is bad, this alternative might be better". Whereas they are perfectly happy to digress off topic discussing another Register Ruby FUD story. Does The Register have something against Ruby?)

Meanwhile, to Balkanise properly, Ruby would need an implementation without vowels, an implementation that has a dispute about its name because it's too much like the name of a module in a neighbouring language, and an implementation that fragments out of a (perceived as core) module in an existing implementation.

Friday April 18, 2008
03:21 PM

Dear linguistic lazyweb...

So there was this social, and we worked out that killing a cat would be felicide, but what we didn't work out was whether there is a precise word for killing a kitten (or at least something that makes it clear that it's a small cat).

Crazy, er curious minds want to know. Mostly so that they can write rules interdicting it.

05:44 AM

One fewer thorn in the government's side

Gwyneth Dunwoody has died. She was useful:

In 2001 she survived an attempt by Labour whips to remove her from the transport select committee - which under her chairmanship often produced highly critical reports.

Backbench Labour MPs refused to support the move when it went to a vote in the Commons.

http://news.bbc.co.uk/1/hi/uk_politics/7353743.stm

This is a shame, as on balance of probabilities her replacement is likely to be a sheep.

Edit - corrected the title. Fewer avocados, less guacamole.

Thursday April 17, 2008
03:42 PM

Deer!

We went for a walk in the Prater, and saw a couple of deer. This surprised me, as the Prater is fairly central Vienna.

Wednesday April 16, 2008
05:12 AM

Dopplr for the win!

When I added my current trip to Vienna into Dopplr, for the first time it told me something that I didn't know† - that nothingmuch would also be here. So an Emergency Social was arranged. Dopplr for the win!

† I already knew that Tara would be here.