Tag Archives: perl

My paradigm is better than your paradigm

On twitter I participated in the short snarky exchange: @stevedekorte – Threads sharing state by default is like variables being global by default. @luqui – state is like globals :-) @stevedekorte – @luqui only shared state – which is why FP ultimately fails – it trades comprehensibility for shared state optimizations @luqui – @stevedekorte, wow, [...]

OO is not the One True Paradigm, but Haskell still sucks at it

I just read osfameron’s Readable Perl talk. It’s a pretty typical language advocation talk, nothing special, but it reminded me of Perl. Those who have not been reading my blog since 2005 may not know that I used to be a Perl nut. I was even on the Perl 6 design team, attended several design [...]

use Perl journal

I started a use Perl; journal, where I’ll be posting design team meeting notes and various musings about theoretical Perl 6.

More Multimethod Madness

Damian and I have been intelligently screaming at each other on perl6-language, finally really fleshing out the Manhattan distance MMD debate. It has settled down recently, after I discovered that Damian had been arguing against something that was almost, but not quite, entirely unlike my algorithm. I looked through the message history and realized that [...]

PCPP

Way back when Glop was going to be called GLIC1, it was going to be an extension to C++ with closures and such. I started by trying to write a huge grammar for C++, which I would then extend with my own special rules. I’ve just implemented a proof-of-concept framework for a very similar idea, [...]

Parse::RecDescent vim trick

Just thought I’d share this. If you’re using Parse::RecDescent and editing with vim, you’d probably like your grammar to be syntax highlighted (at least I do). Here’s a nice little trick to fool vim (and I don’t consider this a bug; vim folks, don’t fix this!): my $grammar = <<’#'EOG’; #\ grammar goes here #’EOG [...]

Logic.pm preview

Due to a request from several people, I am releasing a not-yet-CPAN-ready module called Logic.pm. The development of the idea to write this module is long and boring. But it’s my blog, not yours, so I’ll talk about it. Many of the problems that I have been solving recently in programming have involved backtracking: rule [...]

Two modules in One day

I just wrote and uploaded Perl6::Attributes to CPAN. It came out of frustration for code like this: sub populate { my ($self, $n) = @_; for (1..$n) { push @{$self->{organisms}}, Organism->new(rand($self->{width}), rand($self->{height})); } } Which I can now write like this: sub populate { my ($self, $n) = @_; for (1..$n) { push @.organisms, Organism->new(rand($.width), [...]

Hypotheticals in Perl 5

In Appendix C of Apocalypse 12, Larry speculatively mentioned the syntax: let foo(); Which would “try” foo, and then revert things back to the way they were before that if something failed in your block. Well, I’ve implemented a Perl 5 module, Data::COW (which hasn’t been indexed at my time of writing, but will be [...]

Continuation-passing style in Perl 5

While I was thinking about my latest perl module, a logic programming framework, I realized that it would be really nice to have continuations. So after going through all the contortions of getting around that limitation using closures, I discovered that it’s possible to use continuation-passing style in Perl: sub fibo { my ($x, $c) [...]

Follow

Get every new post delivered to your Inbox.