This Week in Perl 6, May 25, 2005-May 31, 2005


Welcome to another Perl 6 summary, brought to you by Aliya’s new friends, Masha Nannifer and Philippe, and my own secret running joke. Without further ado, I bring you Perl 6 Compiler.

Perl 6 Compiler

Method Chaining

Alex Gutteridge discovered that he couldn’t chain attribute access such as $; in Pugs. Later he provided his example in test form (in case anyone wanted to add it). Maybe someone added them, maybe not; Warnock applies.

BÁRTHÁZI András had trouble making Pugs work on Debian Sid with Perl 5 support. Autrijus provided helpful pointers. I assume from his final silence that the final pointer worked.

Pugs.AST.* Compilation

Samuel Bronson wanted to speed up the compilation of Pugs.AST.* modules by turning off optimizations. Autrijus told him that this was a core module that needed its speed, and optimizations would stay.

Pugs.Types Export List

Samuel Bronson added an export list to Pugs.Types. Autrijus happily applied it and sent him a commit bit.

Export withArgs from Main

Samuel Bronson added an export to Main. Samuel Bronson happily applied it himself this time.

Out-of-Date hs-plugins

Vadim had trouble compiling Pugs with Parrot support. Autrijus helped him fix his problem, and there was much rejoicing.

chomp Problem

Jens Rieks found a problem with chomp and submitted a test. Warnock applies.

Pugs makefile Issue

Grégoire Péan noticed that Pugs was creating a useless Pugs.exe.bat. Autrijus asked if he would be willing to investigate a patch. He responded that he would put it in his queue.

loop or do

Gerd Pokorra wondered why do { ... } was in Pugs, reasoning that loop { ... } while was the correct thing. Luke Palmer explained that do { ... } was part of the with-or-without-a-postfix while.

PxPerl with Pugs 6.2.5 and Parrot 0.2.0

Grégoire Péan announced the release of PxPerl, which includes Pugs 6.2.5 and Parrot 0.2.0. This means that Windows folk can test Pugs and Parrot without having to fight with compilers.

BUILD Errors

Carl Franks found the handling of a named argument to a constructor confusing. He asked for confirmation but no one provided it. Perhaps this poor summary can save him.

White Space and Function Calls

David D. Zuhn didn’t know about the forbidding of white space between a function call and its parentheses. Carl told him that and about the .() variant that allows white space.

Pug’s make clean Issues Long Commands

Carl Franks noticed that make clean issued a command so long that it broke his nmake. Fortunately he had a really old nmake and updating fixed the problem.


thr_windows.h with MinGW

François Perrad provided a patch fixing two compilation problems in thr_windows.h. Warnock applies.

Parrot Slides?

Adam Preble posted a request for slides and notes on Parrot and Perl 6 for a presentation he was working on. Many people provided links in various languages. I usually steal from Dan’s presentations when I need something like this.

Problems with Perl 5.6.1

François Perrad had a problem building Parrot with MinGW and Perl 5.6.1, related to Windows and its binary vs. text distinction. This problem will also crop up if you ever try to seek on files in Windows; not that I have ever lost several days debugging that problem.

Ordered Hash Thoughts

Leo posted his thoughts on a modification to ordered hash, as adding a new element by index breaks the string-hashing part of it. Dan suggested that the ordered hash just pitch exceptions in the bad cases, as it was designed to be lightweight and fast.

Subrules Tests

Dino Morelli provided a patch adding tests for subrules to PGE. Warnock applied, at least until Patrick read this summary.

Python on Parrot

Bloves inquired as to the state of Python on Parrot. The phrasing of the question itself provided some confusion. Michal Wallace provided a link to Pirate, hoping it would help.

Resizable*Array Defeats list.c

Slowly but steadily, my {Fixed,Resizable}<type>Array PMCs are defeating the less consistent array implementations. Leo offered the job of slaying list.c to any interested party. Jerry Gay expressed interest.

Encodings on “Char Constants”

Bob Rogers wants to be able to supply an encoding for his character constants that use '. He also wanted to find the integer that corresponds to a character. Leo explained how he could do the former and that ord is useful for the latter.

Fayland Lam pointed out that the links from the last summary were a little broken. Hopefully this summary will be better.

Refcounts and DOD

Michal Wallace wondered how best to make Python’s refcounts work for embedding it in Parrot. Nicholas Clark pointed out that Parrot_[un]register_pmc would work. Dan noted that if the Python library were to become a Parrot extension, these could become no-ops as Parrot’s DOD would do the necessary work.

BigInt Fixes

Kevin Tew added some tests and fixes to BigInt.pmc. Leo applied the patch.

MinGW and GMP

François Perrad provided a patch fixing GMP for MinGW. Leo provided a slight correction, which François incorporated. Leo then applied the patch.

index Failures

Roger Browne found a failure in the index opcode. Leo fixed it.

MinGW and GDBM

François Perrad provided a patch fixing GDBMfor MinGW. Leo applied the patch.

mod Operation Fails with Negative Integers

Roger Browne noticed that moding with or by negative integers could produce negatives, such as 3 mod -3 = -3. Leo fixed them to provide 0. I hate that fact about C; not that I have ever lost several days debugging that problem, either.

Tracing and Debugging

Leo noted that debugging Parrot has grown more difficult, as the number of abstractions has increased. Is your compiler, IMCC, your PMC, or Parrot broken? Maybe two or three of them? To facilitate debugging, Leo suggested a debug_break opcode and a Debugger PMC. It sounds nifty. He also added support for lexically scoped trace and debug flags.

Adding Unicode, Hex, and Octal Escapes

Will Coleda added more complete escape sequence support to Tcl. Matt Diephouse integrated the patch into his latest version.

the State of ParTcl

Will Coleda proudly noted that as of r8193, ParTcl passed all tests, even with gc-debug. Much praise goes to Matt Diephouse for his cleanup of the Tcl parser.

Strength Reduction Optimization

Curtis Rawls provided a flurry of patches improving Parrot’s strength reduction optimization. Leo applied the patches.

TODO: readline Support

Leo put out a request for adding readline support to Parrot.

get_mmd_dispatch_type Fix

Vladimir Lipsky provided a patch that fixes a bug in mmd.c. Leo applied it.

Uninitialized Variable

Vladimir Lipsky fixed an uninitialized variable. Leo applied the patch.

Improved loadlib Handling

Bob Rogers improved loadlib’s handling of absolute paths. Leo applied the patch.

DOD Sweep Fix

Vladimir Lipsky prevented the NULL PMC_EXT from being added to the PMC ext pool during a DOD sweep. Leo applied the patch.

Packfile Double Destroy

Vladimir Lipsky fixed a problem with double destruction of nested packfiles. Leo applied the patch.

Tcl Autoconverts List <-> String

Tcl can autoconvert between lists and strings. Will Coleda wondered how to implement this behavior to best support language interoperability. People offered suggestions, but there was no real agreement on the best solution, though.

TODO Classification

Chromatic, inspired by Pugs, added TODO classification to Parrot::Test. He threatened to apply the patch if there were no objections … none yet.

HLL Group Support

Leo added support for loading high-level language PMC groups dynamically using the .HLL directive. This will load the lib dynamically and change the return type of some ops to reflect the HLL’s preferences. It is nifty.

Pistol-Wielding Parrot

Leo put out a request for PIR versions of the Computer Language Shootout tests. This will provide a means of gauging Parrot’s performance against other languages. Kinda nifty.

nmake v1.5 Issues

Nigel Sandever also had trouble with overly long lines and nmake. Upgrading nmake fixed his problem, too.

Optimizer Producing Bad Code

Nick Glencross noticed that the optimizer was producing some bad code. Leo fixed one of the problems, but missed the other.

Keys Design

Dan posted an explanation of his original design for keys.

Loop Improvements

Curtis Rawls provided a patch to improve the loop struct in the IMCC optimizer. Leo applied it and asked if he would take a whack at reducing the resource consumption of Bill Coffman’s register allocation patch. Dan and Bob Rogers both expressed interested in speeding up the compiler.

Perl 6 Language

Hash Slices

Carl Franks thought he was having trouble with hash slices. Actually he was having trouble with the s/->/./ in his Perl 5 conversion.

Perl 6 and Refactoring Support

Piers Cawley resurrected Matisse Enzer’s thread about IDEs and tools for Perl 6. He observed that Perl 6 might provide a great deal of support for such things. Deborah Pickett noted that it might not be theoretically possible to parse Perl 6 safely. Luke Palmer felt that it would not be possible, given BEGIN blocks and the like.

$*OS but OS::unix

Rob Kinyon suggested that $*OS be a class that mixes in the correct OS::class. Then MMD could do the heavy lifting. I like this idea.

Reduction Junctions and Cribbage Scoring

Rob Kinyon wanted to use junctions and reductions to score cribbage hands. Unfortunately, he used junctions as a set. This led to discussions of the correct implementation, and of a Set module that should be part of Perl 6. I want such a set module to have a powerset function that returns the powerset of a particular set (preferably lazily instantiated). Also, my cribbage scoring algorithm is better: 1) lay down hand, 2) announce score, 3) peg.

Syntax for Using Perl 5

Autrijus added support to Pugs for using Perl 5 modules. This led him to wonder what the correct syntax for this actually was. Many suggestions, but no decisions, arrived.

MMD and SMD Interaction

Yuval Kogman wondered how MMD and SMD would interact. Warnock applied.

Making Perl 6 Grammars Generative

Aufrank wondered if Perl 6 grammars could be made generative. I would say that this does not belong in the core simply because of its niche application; however, if I were to do this, I would start by using the Perl 6 grammar grammar and modify the way the parse tree is used. Sadly, aufrank posted to Google Groups, so nobody else expressed opinions.

Thomas Sandlaß suggested a Link class to fill the role of auto-dereferencing variables that Luke called “transparent” references.

Use Syntax

Rob Kinyon wondered how exactly ranges of versions and multi-language interoperability would work in Perl 6. Rod Adams provided a few answers.

Anonymous Classes

Simon Cozens announced that he was having a lot of fun converting Maypole to Perl 6. Then he asked how make anonymous subclasses that inherit from other classes and add new methods. Ingo Blechschmidt provided the answers.

Introspectable Code Objects

Ingo Blechschmidt thought it would be nifty if code objects were fully introspectable. Luke agreed, but felt that being able to access them at the statement level might be problematic. I think most of what Ingo would want this for is doable with macros that parse normally (or modify a block), but then munge the resulting match object appropriately.

Signatures As First-Class Types

Yuval Kogman hoped that signatures would be available as first-class types in Perl 6. Ingo Blechschmidt agreed. Sam Vilain pointed to the start of such a translation.

new and MMD

Carl Franks wanted to create a specialized on arguments to new using MMD. Damian told him that his technique was a way to do it, and that bless would still call BUILDALL.

Code Ownership and Debuggability

Yuval Kogman posted his thoughts on code ownership and debuggability in the age of frameworks and generated code.

Strongly Typed Containers

Yuval Kogman wondered how to make a strongly typed container class (similar to C++ templates). Sam Villain provided a pointer to earlier threads and mentioned Haskell’s Generic Algebraic Data Types.

Constants and Optimizations

Ingo Blechschmidt wondered how to create constants so that the optimizer would be able to do as much as possible. Damian suggested that macros would be one solution. This makes me wonder if there is a way to declare a function so that the compiler can create a macro version for constants automatically. That would be nifty.

Date/Time Formatting

Nathan Gray wondered what sort of date/time formating Perl 6 would support. Rob Kinyon suggested porting DateTime. This certainly sounds like something that belongs in a module.

And Pow, I Found Illumination

After much discussion, @Larry has weighed in on the thread I started about reductions on empty lists. Damian feels that it should fail, as finding an appropriate identity operator is no simple task. Somehow a discussion of modulus and division slipped in too.

Sub Call Versus MMD

Luke Palmer wanted a sanity check on sub calls versus MMD. Larry provided an answer, but did not weigh in on his sanity.


People continue to feel very divided about (1,(2,3),4)[2] and @x = [1,2,3]. There are strong opinions on both sides about arrayrefs in array and scalar contexts. I appear to be allied with the losing side. Hopefully things will change.

Unicode Cheat Sheet

Rob Kinyon posted a request for a Unicode cheat sheet so he could make his own nifty symbols. Gaal Yahas and Sam Vilain provided pointers.

Comprehensive List of Rules Tokens

Jeff Pinyan wants a comprehensive list of Perl 6 rule tokens so he can create a Perl 5 module to parse them. Much discussion ensued.

Default Invocant of Methods

Ingo Blechschmidt wondered if a method’s Class could be a default invocant or only instances of it. Somehow this led Larry to musing about Class as a role than people can mixin instead of inherit from. He confuses me.

Posting via the Google Groups interface does not work. To post to any of these mailing lists please subscribe by sending email to,, or If you find these summaries useful or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl. You might also like to send feedback to



Something wrong with this article? Help us out by opening an issue or pull request on GitHub