ank's Journal ank's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-02-08T17:48:59+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 ank's Journal PHP 5.3 includes garbage collection for circular references <p>Now, this is what I'm talking about. I haven't done PHP in ages, but today I needed to do some quick scripting and I realized there's been a new major release sometime after my last contact with the language. Quick look at new features includes garbage collection for circular references, something that perl still doesn't include. </p><p>You see? This is the sort of things that we lose by allowing Wall and his minions to have his way. A few years ago it would have been laughable to think that PHP was somehow more advanced than perl, but that's not the case anymore. </p><p>Of course, PHP has this garbage collection disabled by default, and seems quite experimental, in a very PHP-ish way. But still, at least there's an evolution. </p><p>What's really sad is that GC algorithms are very well known and quite easy to use; the <a href="">Boehm GC</a> comes to mind immediately. </p><p>See what happens when you dream of a pluggable, perfect GC scheme for a language that's been in development for 12 years instead of finishing something that's better than perl 5 and can be done now? </p><p>Cross posted to <a href="">my blog</a></p> ank 2010-06-24T03:42:54+00:00 journal Perl 6: True-Believer Syndrome <p>I've been dealing with some delusional people lately, mostly as a side-effect of recent posts I made regarding chromatic, his entourage and Perl 6. This contact has left me wondering over and over - how was it that I used to love the idea of Perl 6 so much? How did I become so disenchanted with it? And ultimately, why is there still people rooting for Perl 6, seemingly oblivious to the defects the project has been dragging with it for more than a decade? </p><p>It's actually quite easy to explain. I have always been programming Perl and other languages in parallel, so it wasn't that hard for me to stop believing the idea that Perl 6 was going to be great. I have also changed and evolved as a person and programmer, so I am no longer at the place I was when I used to work for Yahoo! and used Perl on a daily basis, a decade ago. </p><p>This is markedly not the position other programmers find themselves in. Fervently believing that Perl 6 will be a good thing for the Perl community and buying O'Reilly reference books for the unfinished language, they simply cannot accept the fact that the whole concept is broken, even after it's been shown to them over and over. </p><p>This cognitive disorder is actually very well known, and is called True-believer syndrome. Wikipedia says: </p><p> <i>According to The Skeptic's Dictionary, an example of this syndrome is evidenced by an event in 1988, when James Randi, at the request of an Australian news program, coached stage performer Jos&#233; Alvarez to pretend he was channelling a two-thousand-year-old spirit named "Carlos". Even after it was revealed to be a fictional character created by himself and Alvarez, many people continued to believe that "Carlos" was real.[5] Randi commented: "no amount of evidence, no matter how good it is or how much there is of it, is ever going to convince the true believer to the contrary."[9]</i> </p><p>This reminds me of Chet Raymo's book "Skeptics and True Believers," which is filled with amusing depictions of True Believers. </p><p>Another point is that the few in the know, such as Larry Wall, chromatic, etc are having fun creating their project, and don't really care all that much about how long it takes - <b>it will be done when it's done</b>. So they don't really fit into this group - they are more like the Carlos who show the rest some mysterious cool magic acts that we are supposed to awe at.</p> ank 2010-06-15T00:48:22+00:00 journal Perl and line noise: an objective comparison <p>We've heard over and over again that perl is like line noise - especially by people who don't program perl and are not used to seeing its code. </p><p>I think it's time to take a scientific approach to this problem, and figure out how "line-noisy" perl is. I believe that by comparing character frequencies in perl files versus C/java/plain English/etc we can ascertain once and for all which language looks more like English, which one more like line noise, etc. </p><p>The only problem I see with this is, just what exactly is line noise? Well, for perfect line noise, I would expect any character to be as likely as any other at any given time; so I think that by using that definition, we can easily compare. </p><p>I'm not going to do it right now because I'm awfully lazy, but I will soon. I'm more than ready to hear comments and criticisms on my approach, and on which code to use.</p> ank 2010-06-14T19:10:28+00:00 journal chromatic's real name <p>What is chromatic's real name?</p><p>So far, my assumption has been that his last name was Christopher, since he has published a few books under that name. Now, it's much more likely that this is an alias used just for publishing - and that his real name is Shane Warden.</p><p>My evidence?</p><p>This is Mr. Warden:<br></p><p>These are some photos of chromatic:<br> [removed]<br> [removed]<br> [removed]</p><p> [new]</p><p>[Update: more to come, he has removed a whole bunch, but I can find them again. I've also ensured there are a few copies of the youtube video; please let me know if it goes down. -- ank]</p><p>See for yourself.</p><p>Note that I couldn't care less if he uses an alias (although I have to confess I find his one-name alias hilarious); and I actually hesitated until now to divulge this information because I believe in individual freedoms (in this case, the freedom of being called whatever the hell you want.) This changed when he didn't approve many of my comments on his blog - a violent, frightened response to a threat I simply don't pose. All I wanted is coherent discussion on what the Perl 6 group has been doing and how this is bad for the Perl community as a whole. I am now disgusted by the way he has dealt with my criticisms - and his utter lack of even a trace of humility or self-doubt.</p><p>I'm just a software developer in Australia, and have a family to feed. I'm much more interested in having my things done at the end of the day so I can play with my son than anything else - and I certainly take no delight in debating pretentious assholes.</p><p>I enjoy complex/weird programming languages just like every other nerd, but I would rather use a coherent, time-tested, stable, multithreaded and fast programming language for my daily work. Ultimately, it's no longer up to us which way Perl 6 goes - the damage has already been done.</p><p>And who do we have to blame for it? Well, largely, ourselves, for not taking the matter into our own hands. After all, this was based on our own RFCs back in the late 90s, so we are partially responsible for the train-wreck.</p><p>But ultimately we do not control what the word "perl" gets glued to - we don't own the name, so we can't just create a new programming language and call it "perl 6" - it doesn't work that way. There is a group of people who can. This is the people that have chosen to turn the Perl 6 logo into a joke. This is the people who think it's okay to have a whole bunch of operators that any smart person will laugh at. This is the people who refuse to see that Perl looks like line noise, even to decade-old Perl programmers. And these same people keep saying that Perl is "like English", even in light of atrocities like twigils.</p><p>We don't have to accept the programming language Wall and his circle of friends decide to unleash - we can sail away to cleaner waters. And lots of us have.</p> ank 2010-06-14T08:21:16+00:00 journal Constructive Criticism: the Perl 6 Butterfly <p>Here is a design I made: </p><p> <a href="">perl6.png</a> </p><p>It only took a few minutes. I hope it fosters some talk and maybe helps understand why I think the current one is defective. It is only a work in progress, and we can change and improve on it a lot; but I just want to put this on the table to show that I'm not being deliberately obtuse; I seriously want the best for perl. </p><p>-- ank</p> ank 2009-09-01T04:36:44+00:00 journal Data::Dumping code refs <p>Just another reason to love Data::Dumper which is, in my opinion, the best module in perlland. Pay close attention. </p><p>Suppose you have this data structure: </p><p> <code> my $ref = { a =&gt; sub { print "a"; } }; </code> </p><p>Data::Dumper dumps it as: </p><p> <code> $VAR1 = { 'a' =&gt; sub { "DUMMY" } }; </code> </p><p>Because it doesn't print out sub references. But you can tell it to deparse them (through B::Deparse) by setting $Data::Dumper::Deparse: </p><p> <code> use Data::Dumper;<br> $Data::Dumper::Deparse = 1;<br> <br> my $ref = { a =&gt; sub { print "a"; } };<br> print Dumper $ref;<br> </code> </p><p>produces </p><p> <code> $VAR1 = {<br> &nbsp;'a' =&gt; sub {<br> &nbsp;&nbsp;print 'a';<br> &nbsp;}<br> };<br> </code> </p><p>I didn't know this feature existed, and was considering creating a new module to mix Data::Dumper and B::Deparse.</p> ank 2008-06-24T13:47:21+00:00 journal