This Fortnight in Perl 6, March 7 - March 21, 2005
All~
Welcome to yet another fortnight’s summary. I believe this is the highest volume I have ever seen the three lists at simultaneously. Hopefully they will keep it up, because they’re doing good work. To aid the epic endeavor of summarizing all this, I have had to add some new Jazz to my playlist. We will see how it works out. If it doesn’t work well, blame Seton.
Perl 6 Language
The Actual Name of &?SUB
David Storrs wanted to know how he could find the name of &?SUB
. Larry told him that $?SUBNAME
would be the most reliable way to get the short name.
Unlimited Argument Patterns
Luke Palmer has tasted the forbidden fruit of Haskell, and now he wants more of it in Perl 6. In particular he wants even more powerful pattern matching of arguments for MMD. Rod Adams speculated that Larry had decided Perl 6 would not be ML. In the end there was no real consensus, but the feeling seems to be to say “don’t hold your breath”.
Limited Argument Patterns
Wolverian was a little unsure of what exactly sub foo(0) {...}
meant. Larry explained that it was just sugar for sub foo ( $bar of Int where { $_ == 0 } $bar ) { ... }
.
List Constructors
Wolverian made a list of list constructors, asking what each did. Larry explained: for the most part, they’re the same thing as in Perl 5, though a few will produce a warning.
Decorating Primitives
The question of how decorating objects with roles interacted with low-level types arose. Larry came to the conclusion that it was okay, unless you wanted to decorate a single element in a primitive array.
Splat Operator in Assignment
Juerd was unsure how splats and list assignment interacted. The answer is that list assignment is exactly the same as Perl 5 to allow for extending a return list.
Logic Programming
Rod Adams pointed out that it’s possible to implement much of logic programming using the rules engine. Unfortunately, the syntax gets a little hairy and cumbersome. Larry said that this particular goal might be something that 6.0 does not address, deferring it instead. Ovid rumbled about porting a Warren Abstract Machine to Parrot. I would like it.
Locale-Keyed Text
Darren Duncan finished up the first non-core Perl 6 module. Being properly hubristic, he asked for a critique. His questions touched on subjects including subtypes, module loading, and strictness.
bar $f =?= $f.bar
Rod Adams wondered what would happen if he had both a sub and a method named bar
. What would $f.bar
and bar $f
do? Jonathan Scott Duff explained that $f.bar
would call the method while bar $f
would call the sub.
MMD Object
Rod Adams wants a single object to represent all of the possible multi methods associated with a particular short name. It seems that Rod drank some of the Lisp Kool-Aid (although in this case, I agree). He explained how this allowed the dispatch scheme to be changed on a multi by multi basis, and also allowed for nice introspection. This led to a discussion of how this would work with lexically installed multi methods, and if this would trip people up. No real consensus appeared.
:foo<o> != :foo('o'); :foo<o> == :foo{'o'}
Juerd wondered what the implications of <a>
mapping to ('a')
were. Larry replied that it did not map in that manner.
Lazy Loading of Object
Yuval Kogman wondered how he could get his objects to load lazily. Larry told him that delegation would probably be the best bet.
Throwing From Higher Up the Call Stack
Thomas Yandell wants a way to throw from further down the call stack. Sadly, Warnock applied.
sprintf
Juerd wants a sprintf
-like function f/FORMAT/EXPR/
. Larry seems to think that EXPR.as(FORMAT)
will suffice, especially if it is a list op.
S29, Built-in Functions
Rod Adams has been hard at work creating a list of built-in Perl 6 functions. This led to good discussions about which things had alternate forms and which did not.
Python to Eliminate reduce()
Aristotle Pagaltzis posted a link explaining that Python 3000 will eliminate reduce
. This led to a brief discussion of various design philosophies.
SEND + MORE = JUNCTIONS
Sam Vilain fixed up the SEND + MORE example to work correctly with junctions. Unfortunately, the hoops through which he had to jump are pretty horrendous. Larry mumbled that the option of autothreading all conditionals might work, but would send too many lynch mobs after him. I for one like both Twin Peaks and that idea.
for
With a Function Reference
Rod Adams wanted to know how for
would behave with various types of functions or codeblocks. Luke Palmer provided answers.
Adding Interfaces to Arguments
Thomas Sandlaß wondered when arguments to function would be decorated with roles from the function signature if they didn’t exist. Larry conjectured about allowing different views on objects versus mixing in various roles. This led people to talk about covariant typing. An array of ints will always return you a number and an array of numbers will always accept an int, but an array of ints will not necessarily accept a number and an array of numbers will not necessarily return an int. Thus, changing your view can be valid when writing and not when reading, or vice versa.
Pugs too Lazy
Andrew Savige noticed that closing a file handle in Pugs did not force all the thunks associated with the file. While this was a bug in Pugs, it led to conversation about whether =
should be lazy or eager. Larry thinks that it will be safer to start eager and become lazy then vice versa.
exists
and delete
as Functions
Rod Adams wondered how he would define the signature of exists
and delete
as they do not evaluate the subscripted variables in their arguments. Larry explained that they are now methods on the hash, so someone will have to do a little macro magic to get it to work the old way.
remove(reset())
Steve Peters pointed out that reset()
was now almost useless and has been “vaguely deprecated” for a while. Larry declared it dead.
Lists in String Context
Juerd put out a plea for lists in string context not to provide spaces between elements automatically. Larry pointed out various ways to join on the empty string, which I think is his way of saying “too bad”.
Popping a Multidimensional Array
Rod Adams wondered what it meant to pop a multidimensional array. Larry agreed that it should pop off entire dimensions. Does this mean that popping such an array in a loop will pop dimensions until there is only one left, at which point it will switch to popping elements?
Index Out of Bounds
Markus Laire wondered what index("Hello", "", 999)
would return. Larry explained that it is not as simple as Markus thinks, because strings use magic indices that do Unicode stuff, but it would probably throw an exception.
GUI Paradigm
Michele Dondi wants Perl 6 to support a GUI paradigm better than most languages currently do. He is not quite sure how, but he is sure that it would be cool. I agree.
Hiding From One’s Callee
Autrijus wants to call a function but make it appear as if his caller did it. Larry suggested that wrap
/call
would be appropriate.
quotemeta
Rod Adams voted for axing quotemeta
. People seemed to agree that it should go, but they disagreed on what to use in its place. Larry suggested an argument to as
.
zip
Function Signature
Rod Adams had
difficulty determining the function signature for &zip
. This led to a discussion of when is rw
was implied, but not an answer to his question.
Symbol Table Interactions
Gall Yahas wondered how ::()
would react to undefined variables. Larry explained that it might be either legal or illegal as an lvalue depending on whether or not the scope had finished being compiled, and that it would be undefined as an rvalue.
Propagating Called Context
Yuval Kogman wants to call a sub with the same context he was called in so that he can munge the result(s). Warnock applies.
true(0)
Juerd suggested renaming true
, as it was really counter-intuitive. Much discussion ensued about alternatives. Larry hemmed for a bit, but decided to stick with true
in the end
Junction Questions
Stevan Little wondered if the junctions in Pugs behaved correctly. Luke Palmer assured him that they were for the examples he posted.
POD vs. kwid : Round 1. FIGHT!
Aaron Sherman posted a rough draft of a better POD. This led to many people passionately discussing the merits and demerits of POD and kwid. Fortunately, as the summarizer endowed with the power of double speaking, I can definitively report that the conclusion was that everybody prefers both kwid over Pod and vim over emacs.
Importing Constants From Another Module
Song10 wanted to know how to import constants from another module into his module without having to specify scope everywhere. Warnock applied.
Returning References vs. Copies
Darren Duncan wants to protect his classes from their malicious enemies who would use his references against him. Thus, he wants to know if his accessor methods return references or copies. Larry explained that they would probably return lazy copies, to provide the requisite protection, except when used inside that class.
Precedence of where
Chip Salzenberg wondered if where
or |
had higher precedence. Larry replied that where
is part of a magic group of declarational keywords that did some weird stuff.
Strings and Pain
Rod Adams wants to change strings to deal with Unicode differently. Larry thinks his idea forces the programmer into the machine’s mindset too much.
Caller’s Slurpy Array
Rod Adams wants access to his caller’s slurpy array and suggested that it be @_
. Larry agreed.
lvalue Slices
Matt Diephouse wants to assign to an array slice but doesn’t know if he can. He can.
.method
; $self.method
; $_.method
As originally specified, .method
means $_.method
. This sets it apart from $.foo
, @.foo
, and %.foo
, which all refer to $self
. Much discussion ensued. I think the pendulum is slowly swinging toward switching the meaning of .method
to refer to $self.method
.
Duff’s Device
Gaal Yahas lamented his inability to use Duff’s Device in Perl 6. Larry made noises that it might not be impossible, but would still not be a good idea.
The Fate of study
Rod Adams wondered what would happen to study
. Because I never did it in high school or college, I doubt I will begin now. Other people seem to think it would be easier to leave it as a no-op in case we want to do it eventually.
Some Ado About Nothing
Rod Adams wants a no-op function and suggested nothing. There was some discussion about whether 1 should work. I am surprised that no one suggested study
.
chr
and ord
Rod Adams thought that perhaps chr
and ord
have a restriction to work only at the code point level. Larry was less sure.
Perl 6 Compilers
Last week, I tried to link to many of the Pugs patches. I now think that was a mistake for two reasons: first, there are a great many; and second, many more occur off-list where I miss them. Therefore, I will not provide links for specific patches unless they pass this arbitrary test: Are they as important as my pizza?
Pugs 6.0.12
Autrijus released Pugs 6.0.11 and 6.0.12. The features are plentiful and awesome. For a more complete list (which is long) as well as daily blow-by-blow of the Pugs development (which is fast) check out Autrijus’s journal.
Helping Pugs
Matthew Campbell wondered how best to help Pugs. Autrijus Tang gave him a helpful nudge.
p6ify Algorithm::Dependency
Adam Kennedy asked for a volunteer to translate Algorithm::Dependency to Perl 6. Darren Duncan did it, and quickly, too.
Help Pugs
Anthony Kilna knew that one of the best ways to help Pugs was to write tests, but didn’t know if there was a database of tests that needed to be written or were written. Stevan Little pointed him to the in-progress attempt to build just such a database, and said that would be a good place to help.
Sand Traps Abound When Golfing in p6
Andrew Savige (a.k.a “mad golfer”) has been working at porting a “small” program to Perl 6.
Numification of Strings
There was some discussion of how to numify a string. Some wanted smart parsing, others wanted simple parsing. For a while simple was winning. I am not sure if it won in the end though.
SQL::Routine
Darren Duncan announced his intent to port SQL::Routine to Perl 6 shortly. You might be able to hold your breath.
Pugs’ Bugs vs. Blue’s Clues
Stevan Little compiled a list of bugs for Pugs. By the time you read this, many will probably have been fixed.
Parrot
I will start this part with a very large announcement. Dan has decided to step down as Parrot’s Chief Architect. Chip Salzenberg (who just earned first name-only status) has taken up the burning parrot…err…torch. To forestall questions/outrage/grumbling, Dan explained that Leo did not get the position because he did not want it. I know that I personally have learned a lot from Dan and Squawks of the Parrot (including how to turn crystal sugar into baker’s sugar), and want to think him a great deal for the work he put into Parrot. This means the responsibility of returning the pie to Guido now falls on Chip’s shoulders.
make install
Parrot Headers
Lambeck noticed that make install
does not install Parrot’s header files. It probably should; he filed a bug.
atan2
needs -xlibmieee
on Sun
Andy Dougherty provided a patch adding appropriate hints to the Solaris build. Leo applied it.
Burning Parrot
Leo put out a request to revive the Parrot tinderboxen. Steve Peters suggested integrating it with the current Perl smoke reporting process. Peter Sinnot put up a server on a spare machine in the meantime.
ncurses_life
Uwe Voelker reported a bug in ncurses_life
. Leo fixed it and put out a plea for someone to update it. Matt Diephouse updated it.
Refactor of t/pmc/pmc.t
Needed
Leo suggested that an interested party would be able to factor the Perl*
tests out of pmc.t
and into perl.t
. Steven Schubiger offered to try.
String Tasks
Leo posted a set of tasks looking for takers with respect to string stuff. Steven Schubiger and Aldo Calpini each stepped up to some.
thr-primes.imc
Bernhard Schmalhofer updated thr-primes.imc
to not use Perl*
PMCs, which uncovered a bug in Undef.pmc
. Leo fixed it.
Aggregate Clone vtable
Leo noticed that some aggregates do deep copies while others do shallow. All should do shallow. Takers welcome.
**Arrays
TODO
Fixed*Arrays
should have a limited form of splice
available to them. Also, the Resizable*Arrays
should have their allocation schemes adapted to that of the ResizeablePMCArray
, and *BooleanArray
should store just bits. Bernhard Schmalhofer offered to take on the *BooleanArrays
.
Anonymous Subclasses
Simon Glober discovered that anonymous subclasses were not working in December. Leo fixed it.
Perl 6 Compiler in Perl 6
Millsa Erlas hoped that writing a Perl 6 compiler in Perl 6 was still a priority. Markus Laire pointed her to Pugs. She seemed happy.
Object Internals
Leo has been steadily hacking away at the object internals. There is now a get_mro
opcode.
Dynclasses Failure in gcc 3.3.3
Leo committed a workaround to a GC problem with dynamic library loading. Eventually someone needs to implement the real solution.
The Many Faces of Win32
It turns out that there are several different flavors of Windows builds with MinGW (not to mention Cygwin or MSVC). This causes pain.
TODO: Clean Parrot’s A*I
Jarkko Hietaniemi posted a TODO for cleaning up both Parrot’s API and ABI. Leo agreed that it would be very nice.
Calling PIR from a PMC
William Coleda wanted to know how to call PIR code from a PMC. Jeff Horwitz pointed him to the Parrot_call_sub_*
API.
PAST Compiler Problems
Bernhard Schmalhofer has a program that he can make work in imc, but not from PAST. It turns out that we don’t yet have a way to pass options to the compile
opcode. We need that.
Makefile
Cleanup
Bernhard Schmalhofer offered to clean some old imcc targets out of the Makefile
. Leo told him to go for it.
MRO Broke Tcl
Will Coleda was sad that Leo kept breaking Tcl. Leo suggested that he add the Tcl tests to the base make test
. Also, there is some funniness going on because tests fail for Leo and not Will.
TODO: Add Multiple Return Values to Parrot_call_sub
Matt Diephouse posted a TODO for adding the ability to access multiple return values from C.
MANIFEST Failures
Bob Rogers was seeing MANIFEST failures. It turns out that he forgot to use the -dP
switch with CVS. We have all done it.
PASM -> IMC
Bernhard Schmalhofer committed a few TODO tests for generating and running PASM from Pir. Jens Rieks pointed out that this does not work and is only a debugging aid. I don’t see anything wrong with wanting it to work, though.
Segfault on splice
Nick Glencross found a segfault when splicing an IntList
. Jens Rieks provided a patch that allowed Parrot to die earlier and more cleanly. Leo fixed the problem.
Documenting the MinGW build
François Perrad provided a patch updating documentation for building with MinGW. Warnock applies.
Segfaulting md5sums
Nick Glencross decided to check up on his md5sum library. It still compiles, but it segfaults. Leo found and fixed the GC bug.
Parrot_Exec_OS_Command
François Perrad noticed that MinGW was very particular about how you execs OS commands. He wondered if this should be fixed at the configure layer or the Parrot_Exec_OS_Command
layer. Dan explained that he never intended the latter to be language independent, and that a language independent version should go in a library.
Namespaces in PIR
Leo posted a call for comments on PIR namespaces. Dan suggested a small addition.
Builtins
Leo committed a change moving builtins to a class namespace and provided convenient access to them from PIR.
MMD: Multi Sub Syntax
Leo put out a call to develop a syntax for multi subs in PIR. Many people suggested options.
Returning a Variable Number of Arguments
Bob Rogers updated PIR code to allow returning a variable number of arguments. Leo applied it.
The Usual Footer
Posting via the Google Groups interface does not work. To post to any of these mailing lists please subscribe by sending email to perl6-internals-subscribe@perl.org
, perl6-language-subscribe@perl.org
, or perl6-compiler-subscribe@perl.org
. 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 ubermatt@gmail.com.
Tags
Feedback
Something wrong with this article? Help us out by opening an issue or pull request on GitHub