Perl 6 summary, 24-30 September, 2006

kudra on 2006-10-01T14:03:28

This week on the Perl 6 mailing lists

"And here I thought you were a responsible, law-abiding citizen... :P "

-- Jonathan Lang, commenting on Larry Wall's self.HOW does Hash

Language

class interface of roles

TSa wondered how typing of mixins would look in Perl 6. A code example of how it might look was included. There were also some questions on roles in Perl 6.

Capture Literals

Responding to an earlier thread, Austin Hastings asked if Capture literals would replace or unify "assuming"/"currying".

Motivation for /<alpha>+/ set Array not Match?

In a previous week, Audrey Tang quoted a section of S05 concerning subrules. She found the 'quantified' clause to be unintuitive and wondered if it would be possible to modify it to produce Match objects and to reserve Array only for noncontiguous same-name subrules. Patrick R. Michaud and Flavio S. Glock made some alternate suggestions.

More recently Audrey replied to the thread, wondering if there was a hidden cost to making /<foo>+/ always react so that $<foo>.from returns something. Masak preferred the proposed semantics and asked if the question had been discussed off-list.

Nitpick my Perl6 - parametric roles

Sam Vilain sent some code on Perl 6 core types as collections and asked if anyone would like to poke holes in it. TSa applauded the use of functions but wondered if it would work. Several other people followed up on that thought.

Mutability vs Laziness

Aaron Sherman pursued a conversation which began in IRC. He listed some immutable types declared in S06 and noted that there appear to be three core attributes (Mutability, Laziness and Ordered), each of which has two states (true or false). From this he derived 8 types of containers.

Dave Whipp thought there was a fourth attribute, exclusivity. Sam Vilain felt that ordered was not an attribute of a collection.

[svn:perl6-synopsis] r12398 - doc/trunk/design/syn

In a recent commit, Larry Wall removed the special [,], which is now just a list op form of [...]. In order to support the |func() syntax, | became the new disigilized *.

Luke Palmer replied in support of the new syntax. TSa also approved, but would have liked the new operator spelled. Aaron Crane thought that was undesirable because there are already terms which begin with /, namely regular expressions.

Common Serialization Interface

Brad Bowman wondered if there was a common element to a serialization role which could be included in the default implementation. Mark Stosberg noted that there is already a .yaml and a .perl to serialize to these formats, but he did not know if they were suitable substitutes for the role-based approach Brad had in mind. He included a code sample. Aaron Sherman and Luke Palmer offered additional code examples. Larry Wall commented that it makes a big difference whether the entire string must be held in memory or not.

[svn:perl6-synopsis] r12417 - doc/trunk/design/syn

Audrey Tang committed a change which introduced the $$x form in adverbial pair parsing to S02 and canonicalized the term 'item' in S02 and S04.

[svn:perl6-synopsis] r12432 - doc/trunk/design/syn

In S03, Audrey Tang noted that chained comparisons short-circuit and never evaluate arguments more than once.

RFC: multi assertions/prototypes: a step toward programming by contract

Aaron Sherman wrote to suggest a signature prototype that all multis defined in or exported to the current namespace must match, as a means of implementing the paradigm of programming by contract.

Trey Harris felt that the point of multiple dispatch is that arguments are not bound to a single type, and the proposal might defeat this use, although junctive types, subsets and roles make 'single type' less of a constraint. Miroslav Silovic was bothered by the possible duplication of functionality and believed that declarative requirements should go in to roles. Many other people responded to this thread.

In addition, there was a discussion on the terminology of libraries in Perl 5 and Perl 6--'package' being the Perl 5 term, and 'module' the Perl 6 term. The definition of 'programming by contract' was also discussed.

There was also a discussion on whether 'package' implied a Perl 5 library and 'module' suggested a Perl 6 one. Larry Wall attempted to clarify.

special named assertions

David Brunton posted about an IRC conversation from earlier. He listed the seven special named assertions found in S05, and the twenty-four found in docs/Perl6/Overview/Rule.pod. He found another one in t/regex/from_perl6_rules/stdrules.t. In his opinion, it was worth creating a single place in S05 where all of these named assertions are listed.

Patrick R. Michaud disagreed with the inclusion of <'...'> and <"..."> as named assertions. He stated that he would compare the list with what PGE has implemented and report differences. Mark A. Biggar noted that the documentation should distinguish between pre-defined character classes and special builtins. Patrick responded with PGE's view on what constitutes a special builtin.

Parrot Porters

A dedicated per-context stack for bsr/jsr/ret

Bob Rogers sent a patch to create a return_stack for bsr/jsr/ret ops. Leopold Toetsch replied that separate stacks are good, but wondered if a return stack per context was desired. Bob Rogers replied in detail and included another patch.

postgres interface

Leopold Toetsch has been working on postgres.pir and reported several changes, including a new test file. Bob Rogers sent a patch to make it more forgiving of an absent libpq.so. It was applied.

[perl #40410] Segfault in packfile code

In ticket [perl #40410], Jonathan Worthington reported a segmentation fault in generating a packfile for compiled PIR generated by .Net. Later he found the bug and implemented a workaround.

FYI improved pugs smokes

Leopold Toetsch referred to the recently improved smoke tests for Pugs, and wondered if it would be possible to do something similar for Parrot. Jerry Gay replied that he'd been working on a Parrot implemention.

External PDD Checkin

chromatic reported that he had added details to the external API draft PDD and welcomed comments on docs/pdds/clip/pdd10_embedding.pod.

[PATCH] Parrot-Embed on Win32

François Perrad supplied a patch to make Parrot-Embed compile and run on Win32.

FYI compiling PIR function calls

Leopold Toetsch wanted people to know about alternate syntax for generating PIR calls from a compiler:
.pcc_begin
.arg "hello"
.arg "\n"
.invocant obj
.meth_call "_meth"
.result $S0
.pcc_end

Allison Randal replied that she felt the problem was one of inconsistency. She gave a few suggestions, which Leopold Toetsch responded to. Jonathan Scott Duff also proposed a slight modification of syntax. A discussion on the syntax followed.

[svn:parrot-pdd] r14741 - in trunk: . docs/pdds/clip

Allison Randal made some modifications to PDD22 to create a first release candidate of the I/O PDD.

A moment of Zen

Allison Randal posted that the single most important thing in the project is shipping a 1.0 release of Parrot, which is now very close. She called for functionality over elegant theory for the moment.

call/return and CPS

Watson Ladd asked how call and ret opcodes will interact with continuations. chromatic replied that the opcodes invoke the appropriate continuations.

PDD 22 - I/O release candidate 1

Allison Randal announced that she'd committed an updated I/O PDD. She requested feedback, especially on which lightweight concurrency model to use for asynchronous operations. She also asked for a reaction on async ops returning status objects while sync ops return integer error codes.

chromatic suggested that ops could always return PMCs, and simply check the intval if required. Tim Bunce wondered if speed-sensitive ops which might be used in loops could be given the PMC to reuse.

Leopold Toetsch remarked that he did not like I/O opcodes and explained why. chromatic disagreed with one of the arguments and Leopold replied.

Joshua Hoblitt asked for more details on Allison's comment about concurrency models: was she speaking of the Parrot API, the actual implementation, or both? He felt that the implementation would need to be highly platform specific.

[CAGE] perl coding standards...

Will Coleda created a perlcritic tests, t/codingstd/perlcritic.t, which isn't run by default. It currently reports only a few rules. He suggested that Cage Cleaners could run this test to receive a long list of things to fix. He offered some advice on addressing the issues which show up.

[perl #40419] 2 PDD 07s

In ticket [perl #40419], Will Coleda reported that there are two PDDs numbered 07.

Prototyping variable-sized PMCs

Allison Randal summarized a telephone conversation with Leopold Toetsch. They discussed proposals on variable-sized PMCs and a shared base class for PMC types ('Two new pdds'). In Allison's opinion, variable-sized PMCs are a step toward closing the gap between low-level PMCs and higher-level Parrot Object PMCs. She also thought there were several good ideas in the shared base class proposal. The new PMCs will be implemented first as prototypes, and assessed/rewritten without changing the existing system.

Two new pdds

Leopold Toetsch announced two new documents in docs/pddfs/clip as of r14774. One, pddXX_cstruct.pod is the metaclass of all publically accessible C-derived structures used in Parrot. The other, pddXX_pmc.pod, describes the general structure of PMC internal layout.

Jonathan Worthington replied to the commit ([svn:parrot-pdd] r14774 - in trunk: . docs/pdds/clip) to give his thoughts on Leopold's proposals.

A related thread is 'Prototyping variable-sized PMCs'.

FYI: $job

Leopold Toetsch announced that his job will require him to reduce his Parrot commitments, but that he would continue to follow development as time permits. Allison Randal thanked him for his contributions.

socket related constants

Nicholas Clark replied to an older thread. He said that there are two problems to be solved, namely parsing C header files and identifying the constants, and injecting identified constants in to Parrot appropriately. Nicholas explained a little about how this is going in Perl 5.10.

Joshua Hoblitt was reminded of the question of whether anyone had looked at APR for doing portable I/O.

[HOWTO] call a method on a PMC in PIR

Karl Forner wanted to call the elements() method on a FixedBooleanArray, or add a custom method get_allocated_size() to the FixedBooleanArray.pmc. Leopold Toetsch replied with suggestions.

Draft of Bytecode PDD

Allison Randal announced that Jonathan Worthington had written a draft PDD for Parrot's bytecode format, which was checked in as '[svn:parrot-pdd] r14784 - trunk/docs/pdds/clip'. Later some additional changes (based upon a conversation with Allison) were also committed.

In 'Bytecode PDD' Jonathan asked for feedback. Leopold Toetsch offered a few comments.

Ben Morrow wanted to know if pbc files could allow an optional #! line so that they could be used as executables. Jonathan replied that he had considered this, but rejected it because it is UNIX-specific. There was additional discussion on the topic.

requirements gathering on mini transformation language

Allison Randal asked for a volunteer to write up the requirements for a mini transformation language to use the compiler tools. The job would involve spending time with Allison and Patrick Michaud and combining their ideas along with your own perspective. Adriano Ferreira offered some opinions on the subject, and Markus Triska volunteered to do it if it relates to his area of expertise.

[perl #40428] [PATCH] Return perl script and module file locations in parrot distro

In ticket [perl #40428], Paul Cochrane submitted a patch to return the names and locations of the perl script and module files within the Parrot distribution.

[perl #40429] [PATCH] test for perl code coda

Paul Cochrane supplied a patch in [perl #40429] to add a test for the Perl code coda. Will Coleda rejected the patch because he'd just added the same test as a Perl::Critic policy class.

[perl #40430] [PATCH] rename and update C code coda test

Paul Cochrane renamed the C coda test and removed Perl-specific code from the test. It was applied as r14812. The ticket for this patch is [perl #40430].

Users

How to pass a ref from a language with no refs

This week the long-running CGI thread splintered in to the question of how to pass a reference from a language with no references when Mark Stosberg replied to a discussion on how Perl 5 embeds in Perl 6.

Mark saw some recent Pugs commits on Perl 5 embedding, which encouraged him to experiment with passing hashes and arrays. In his tests, he was able to send an array as an arrayref, but was unable to get a hashref. He wondered if there was another way to do it. Aristotle Pagaltzis replied.

Perl6 "style-guide"

Last week, Fagyal Csongor asked if someone was willing to write a Perl 6 style guide. This led to a discussion on other resources, desired and existing. This week, Chris Dolan asked if anyone wanted to start a port of Perl::Critic.

xx operator

Fagyal Csongor included some code which gave an unexpected result and wondered if the code or Pugs was at fault. A. Pagaltzis replied that the xx operator is list-repeat rather than string-repeat. Juerd also explained further, and the code was fixed.

Compiler

Synopses on the smoke server are a bit out-of-date

Agent Zhang reported that the synopses on the smoke server are out of date--r12432 as compared to version r12466 on feather, which syncs every hour.

Acknowlegements

This summary was prepared using Mail::Summary::Tools, now available on CPAN.

If you appreciate Perl, consider contributing to the Perl Foundation to help support the development of Perl.

Jamie Cheetham supplied server access this week.

Thank you to everyone who has pointed out mistakes and offered suggestions for improving this series. Comments on this summary can be sent to Ann Barcomb, kudra@domaintje.com.

Distribution

This summary can be found in the following places:

See Also