Re: To :D or not to :D
On Mon, Oct 12, 2015 at 09:51:13PM +0200, Mark Overmeer wrote: > > method new(MyClassHere:U: *@args) { ... } > > > > in the constructor, which would be quite hostile to newbies. It's still > > not clear to me how to avoid that. > > It is also unclear to me what this means. It is a method which requires > and undef parameter? Because of the second colon, it's a method accepting an undef invocant. This is what would be needed in order for MyClassHere.new(...) to work the way you expect (since MyClassHere is undefined). > > Another concern is that if "everything" defaults to :D, then classes > > (and other type objects) aren't really first class objects anymore, > > which is a really neat thing to have. > > Can you give me an example? Many other languages are capable to live > without undef and have first class type objects. Keep in mind that what Perl 6 calls a "type object" isn't quite the same as class objects in other languages -- a Perl 6 typename is really an undefined instance of a class. In other words, the identifiers C, C, C etc. refer to instances of those classes just like the literals C<3>, C<4/5>, and C<[1,2,3]> are instances of those classes. They share the same method spaces. Pm
Re: To :D or not to :D
On Tue, Oct 13, 2015 at 12:32:01AM +0200, Mark Overmeer wrote: > Yes, that what I started realizing when I saw all the pain Perl6 goes to > ignore the existence of a real "undef" in the language. (I follow Perl6 > from a short distance since its start, read all original designs, but > this penny did not drop before, sorry) Actually, it's the other way around. Perl 6 is not trying to ignore the existence of an "undef", it's recognizing that there are in fact many different kinds of undef. It's the languages that think there's only one "real undef" that are confused. :) > The reasoning behind the output of > my $a; $a.say; $a = 1; $a.saybeing (Any) \n 1 \n > Which actually means > "unstantiated (Any)" versus "instantiated (Int) value=1" > for me personally painfully imbalanced. > > my Car $a; my Car $b; Now I have two different types. Not really, you have two variables, both of which have been initialized to the same (undefined) Car object. It's not much different than my Int $a; my Int $b; $a = $b = 1; where $a and $b end up being variables that contain the same Int object. > Is there any precedence in a succesful programming language where types > and values get mixed-up this way? I think Self would be the (pardon the pun) prototypical example, and it's also a common feature of JavaScript. As to whether there is precedence in other "successful" programming languages -- to me part of Perl's legacy has always been that it offers exotic (at the time) features that other "successful" languages didn't provide. Perl has often been the tip of the spear in making "exotic" features commonplace. :) Larry and the other OO experts can probably comment on this in more detail; but this construction of types allows Perl 6 to incorporate a lot more features of prototype-based languages than the traditional class-based model. I suspect it's also related to a proper implementation of mixins and roles. > For me, a "Car" is not "a vehicle which is not yet there", but is a > featural and functional template of a thing. The template describes the > interface of a car, not the instance of a car. A type is scientific, > an object is dull facts. Is that an old-fashioned, traditional idea > to be abandoned? Perl 6 still has classes and instances, but Perl 6 also adds the ability to represent undefined instances of a type (or, rephrased, to have typed "undefs"). Perl 6 then binds the commonly-used identifier (e.g., C) to an undefined instance rather than the class object that defines the instances. Once you accept that model, it seems to work out very well in practice. When we need to communicate with the class definition (rather than an instance), there's a convenient .^foo syntax that allows us to accomplish this, which works on any instance (defined or undefined). That becomes important when you want to do something like: my Research $a; say $a.methods(); # invoke "methods" defined by Research say Research.methods(); # same as above say $a.^methods(); # return a list of methods for Research objects If Research refers instead to the class definition, then the method namespaces for instances and classes begin to clash, and we have to introduce all sorts of disambiguation for that. Pm
Re: memory leak I think.
On Thu, Dec 19, 2013 at 11:27:32AM +0800, Richard Hainsworth wrote: I've been running a perl6 program that runs through a loop, dumps intermediate results and starts again with new initialisation values. [...] Looking at system resources, the program chews up memory resources continually. a) Is this a known problem due to garbage collection problems? If you're using Rakudo on Parrot, then the likely cause of what you are seeing is due to the way Parrot manages memory. Parrot tends to allocate memory pools up to a certain limit (based on system resources) and never releases any of that allocated memory back to the system until the process terminates. So even though Rakudo is likely releasing the resources back to Parrot, Parrot doesn't release them back to the system. Parrot will start re-using the allocated memory for new objects, however, once it's reached the resource limit mentioned above. Pm
Re: Licensing: Perl 6 specification and test suite
On Tue, Nov 05, 2013 at 03:36:47PM +0100, Moritz Lenz wrote: Somehow I have always worked under the assumption that it is under the Artistic License 2, just as Rakudo and NQP, and community concensus seem to agree with me. Therefor I've added an AL2 LICENSE file to the perl6/roast repository, and I hope that any former or current contributor that disagrees with the choice of license speaks up soon. Just to add my +1: I totally agree that perl6/roast is AL2, and I believe that to be entirely consistent with the way things were in the Pugs repository at the time of the split. Pm
Re: Licensing: Perl 6 specification and test suite
On Tue, Nov 05, 2013 at 04:21:12PM +0100, Jan Ingvoldstad wrote: Considering that the specification is sortof actually a language specification, I think there should at least be some terms regarding how this should apply. Just to nit semantics a bit and push a little harder on something I've generally not pushed too much in the past... I believe that the Perl 6 language specification is actually the test suite. Synopsis 1 even indicates this somewhat explicitly: Perl 6 is anything that passes the official test suite and ... Perl 6 is defined primarily by its desired semantics, not by accidents of history. To me, the Synopses are primarily a detailed language description, and I'm increasingly wishing we wouldn't consider them as the language specification... Forking the documentation, or creating derivative works, shouldn't be a problem, as long as it doesn't change the specification in itself, and thereby create confusion regarding what the Perl 6 specification is. ...and this is the exact reason for that wish. The documentation isn't the specification at all -- the test suite is. Pm
Re: Licensing: Perl 6 specification and test suite
On Tue, Nov 05, 2013 at 11:00:59AM -0600, Patrick R. Michaud wrote: Forking the documentation, or creating derivative works, shouldn't be a problem, as long as it doesn't change the specification in itself, and thereby create confusion regarding what the Perl 6 specification is. ...and this is the exact reason for that wish. The documentation isn't the specification at all -- the test suite is. I should probably clarify. I think that referring to the Synopses as specification *increases* confusion on the issue, because it's the test suite that defines the language, not the Synopses. In some sense, perhaps the Synopses should be considered just another (human-readable prose) implementation of Perl 6. Just like any other Perl 6 implementation, a discrepancy between the Synopses and the test suite means that one of them needs updating (based on experience and evolution), but ultimately it's the test suite that determines what is or is not correct in the Perl 6 specification. Pm
Re: Class attribute introspection
On Mon, Oct 28, 2013 at 05:17:37PM +0400, Richard Hainsworth wrote: Pardon the ignorance, but what is the MOP. I sometimes get floored by the jargon. Whatever answer we get should go into S99. https://github.com/perl6/specs/blob/master/S99-glossary.pod Pm
Re: Introduction to Synopses
On Sun, Sep 29, 2013 at 01:28:48PM +0800, Richard Hainsworth wrote: However, the Synopses are now primary specification and the Apocalypses have only historical significance. Also there are more Synopses than Apocalypses. One correction: The test suite (roast) is the primary specification (see Synopsis 1). To me, the Synopses are the English description of our understanding of the specification / language, as well as a roadmap for growth in the future. Pm
Re: Introduction to Synopses
On Mon, Sep 30, 2013 at 02:03:43AM +0800, Richard Hainsworth wrote: Not wising to disagree with PM, but |docs/feather/syn_index.html states on line 1:| The Synopsis documents are to be taken as the formal specification for Perl 6 implementations What follows is just my opinion, there's plenty of room for reasonable disagreement. Over the last couple of years I've come to disagree with this statement in syn_index.html . Informally we often talk about the synopses as being the official spec, and I'm as guilty of that as anyone else. Even the name of the repository holding the synopses is given as specs. But as all of us know, some parts of the synopses are incredibly slushy, or even quite fluid, and so it's not something that people can really treat as truly specification. And there are countless parts of the synopses that have radically changed as a result of lessons learned in implementation... (I can tell long stories about S05!). Thus it was recognized early on (in Synopsis 1) that acceptance tests provide a far more objective measure of specification conformance than an English description. There are likely things that need to be spec that cannot be fully captured by testing... but I still believe that the test suite should be paramount. Perl6 language development is a gradual change of specification, test suite and implementation until the specification is proven by implementations, which all pass the test suite, for some sense of 'proven' and some set of 'implementations'. A version of Perl6 is described by the combination of a specification suite and a test suite. I'd prefer that versions of Perl 6 be captured solely by the test suite. I don't know how practical this is, though. I don't like the notion of specification suite... it feels too nebulous to me. A version of Perl6 is declared to be ready when there is at least one full implementation exists that generates code considered to be sufficiently fast and memory efficient. I also don't like the idea of defining readiness in the abstract. Something is ready when it is capable of solving the problem(s) to which it is being put. Pm
Re: Are set operations needed?
On Thu, Jul 18, 2013 at 07:07:20PM +0800, Richard Hainsworth wrote: I wondered whether the desire to have sets in perl6 was driven by mathematical fashion sensitivity (in some roundabout unconscious way) and because sets are important to mathematical foundations. [...] Sets do not implement well on a computer. I suspect that these two statements, taken together, give a large part of the reason Perl 6 has sets implemented in the core. They're an important part of the mathematics that program(mer)s use to solve problems, and without a common foundation it's easy to come up with many suboptimal implementations. A similar argument exists for Temporal and date/time objects. Also, in earlier days of Perl 6 discussions, we discovered that people would learn about junctions and then try to use them to solve set-based problems. This frequently led to many dead-end discussions about trying to generalize junctions to that purpose. Having sets and set operators explicitly included in the core is intended to also guide people away from the false path of thinking that junctions are the Perl 6 vehicle for set-based operators. Pm
Rakudo Star 2013.05 released
## A useful, usable, early adopter distribution of Perl 6 On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the May 2013 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball and Windows .MSI for the May 2013 release are available from http://rakudo.org/downloads/star/. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. This Star release includes [release 2013.05] of the [Rakudo Perl 6 compiler], version 5.2.0 of the [Parrot Virtual Machine], plus various modules, documentation, and other resources collected from the Perl 6 community. [release 2013.05]: https://github.com/rakudo/rakudo/blob/nom/docs/announce/2013.05.md [Rakudo Perl 6 compiler]: http://github.com/rakudo/rakudo [Parrot Virtual Machine]: http://parrot.org Some of the new features added to this release include: * The ?-quantifier on regex captures now returns a single Match object (formerly returned an array). Use `** 0..1` to get the old behavior. * Failed matches return Nil instead of a false Match object. * Rakudo warns when pure expressions are used in sink context * .substr(...) now correctly accepts whatever-star closures * Implemented shellwords postcircumfix (%h $x 'foo bar' ) * Defining operators spelled like the empty string is now illegal * Array interpolations now properly do LTM * Autothread none and all junctions before any and one * Helpful error if you write else if/elif instead of elsif * Throw exception if a Range is used as a Range endpoint * Corrected argument order in IO.seek * wrap low level VM objects in ForeignCode, allowing perl6 OO calls on them * for loops are eager again * add link and symlink to IO * add Capture.Bool() * improvements to DUMP() * various optimizations in the optimizer and the runtime * smartmatch against list now supports Whatever wildcards * IO::Spec, a port of Perl 5's File::Spec * regex special characters can be used as delimiters * allow slice with :exists adverb on hashes * added 125 extra opening/closing bracket-pairs This release also contains a range of bug fixes, improvements to error reporting and better failure modes. The following features have been deprecated or modified from previous releases due to changes in the Perl 6 specification, and are planned to be removed or changed as follows: * `postcircumfix:[ ]` and `postcircumfix:{ }` will become multi-subs rather than multi-methods. Both at_pos and at_key will remain methods. * Unary hyper ops currently descend into nested arrays and hashes. This will change to make them equivalent to a one-level map. * The Str.ucfirst builtin is deprecated; it will be replaced by Str.tc. * Leading whitespace in rules and under :sigspace will no longer be converted to `.ws`. For existing regexes that expect this conversion, add a `?` in front of leading whitespace to make it meta again. * The result of failed matches will be Nil instead of a Match object returning boolean False. There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Some of the not-quite-there features include: * advanced macros * threads and concurrency * Unicode strings at levels other than codepoints * interactive readline that understands Unicode * non-blocking I/O * much of Synopsis 9 There is an online resource at http://perl6.org/compilers/features that lists the known implemented and missing features of Rakudo and other Perl 6 implementations. In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. A draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC \#perl6 on freenode.
Re: Rakudo Star 2013.05 released
On Thu, May 30, 2013 at 11:08:13PM -0500, Patrick R. Michaud wrote: This Star release includes [release 2013.05] of the [Rakudo Perl 6 compiler], version 5.2.0 of the [Parrot Virtual Machine] ... Oops. The 2013.05 release actually contains Parrot 5.3.0. Sorry about the typo. Pm
Re: Panda on Windows
On Wed, Mar 20, 2013 at 01:49:21PM +0100, Tadeusz Sośnierz wrote: On 03/20/2013 10:21 AM, phi...@free.fr wrote: Hello, when I type panda on the Windows command line, I get the following message: D:\users\mepanda connect failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established conn ection failed because connected host has failed to respond. Hi, are you sure that you aren't behind some firewall, or restricting proxy? Out of curiosity, is there a way to get the error message to indicate what panda was attempting to connect *to*? connect failed: A connection attempt to somehost.org failed Pm
Re: Perl 6 in Perl 6?
On Thu, Oct 18, 2012 at 09:59:21AM +0200, Moritz Lenz wrote: On 10/18/2012 09:02 AM, Darren Duncan wrote: Something (PyPy et al) got me wondering, is it a goal in the Perl community before too long to have a (compiling) implementation of Perl 6 written entirely in Perl 6? A fair amount of the two major Perl 6 compilers, Rakudo and Niecza, are already written in Perl 6. Both also contain runtime code written in the native underlying language (C/C#), and plans to get rid of that are not realistic right now. As a quick data point: Rakudo's codebase (compiler+CORE setting) currently contains around 4,309 lines of C code (*.c, *.h, *.pmc) and 24,406 lines of Perl 6 code (*.pm, *.nqp). So, 85% of Rakudo is written in Perl 6 and 15% in C-ish languages. Pm
Rakudo Star 2012.09 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the September 2012 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the September 2012 release is available from http://github.com/rakudo/star/downloads. A Windows .MSI version of Rakudo star will usually appear in the downloads area shortly after the tarball release. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. This Star release includes release 2012.09.1 [0] of the Rakudo Perl 6 compiler [1], version 4.6.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. Some of the new features added to this release include: * Basic macro support! * Support for Perl 5 (m:P5/.../) regex syntax! * Indirect type names in routine and type declarations are supported. * We support the is export trait on constant declarations. * The is hidden and base traits are supported. * Str.wordcase, is-prime, and expmod are implemented. * Compilation is slightly faster than before. * Tie-breaking with constraints selects the first matching constraint rather than demanding mutual exclusion. * Smart matching against Signature literals, and binding to Signatures in declarators. This release also contains a range of bug fixes, improvements to error reporting and better failure modes. More exceptions are thrown as typed exceptions, and more meta-model errors have been fixed to properly report line numbers. The following features have been deprecated or modified from previous releases due to changes in the Perl 6 specification, and are being removed or changed as follows: * Iterable is now a role instead of a class, and no longer inherits from Cool. * Parameters preceded by a | or \ can no longer have a sigil. * IO::Path.dir (which returns the directory part of the path) has been renamed to IO::Path.directory. IO::Path.dir will be removed or re-purposed. * The Str.ucfirst builtin is deprecated; it will be replaced by Str.tc. * The (experimental) LAZY statement prefix will soon be removed. * Leading whitespace in rules and under :sigspace will no longer be converted to .ws . For existing regexes that expect this conversion, add a ? in front of leading whitespace to make it meta again. * The ?-quantifier on captures in regexes currently binds the capture slot to a List containing either zero or one Match objects; i.e., it is equivalent to ** 0..1. In the future, the ?-quantifier will bind the slot directly to a captured Match or to Nil. Existing code can manage the transition by changing existing ?-quantifiers to use ** 0..1, which will continue to return a List of matches. There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Some of the not-quite-there features include: * advanced macros * threads and concurrency * Unicode strings at levels other than codepoints * interactive readline that understands Unicode * non-blocking I/O * much of Synopsis 9 There is an online resource at http://perl6.org/compilers/features that lists the known implemented and missing features of Rakudo and other Perl 6 implementations. In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. A draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. [0] https://github.com/rakudo/rakudo/blob/nom/docs/announce/2012.09 [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Rakudo Star 2012.08 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the August 2012 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the August 2012 release is available from http://github.com/rakudo/star/downloads. A Windows .MSI version of Rakudo Star is also being made available in the downloads area. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. This Star release includes release 2012.08 [0] of the Rakudo Perl 6 compiler [1], version 4.6 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. Some of the new features added to this release include: * Rakudo Star now includes a Perl 6 debugger! The debugger allows single-stepping, setting breakpoints, variable inspection/modification, regex debugging, and more! Enter perl6-debug script.pl to run a script in debugging mode. Enter help from a debug prompt to see the available commands. * Memory usage of the build stage has been reduced by 35% - 40%. This makes it possible to build and compile Rakudo Star on machines with less memory (although 1.2GB may still be needed for some 64-bit environments). * Variables prefixed by | or \ in signatures are now sigilless, per updates to the Perl 6 specification. * Circularities in module loading are now detected. * An improved inliner, allowing a wider range of routines to be inlined. * Str.bytes and lcfirst have been removed. The tclc builtin has been added. * 'abs' is now a normal subroutine instead of a prefix operator. * IO::File and IO::Dir have been removed. * The integer argument to IO::Socket.recv is now interpreted as a number of characters/codepoints. This release also contains a range of bug fixes, improvements to error reporting and better failure modes. More exceptions are thrown as typed exceptions, and more meta-model errors have been fixed to properly report line numbers. The following features have been deprecated or modified from previous releases due to changes in the Perl 6 specification, and are being removed or changed as follows: * Parameters preceded by a | or \ can no longer have a sigil. * IO::Path.dir (which returns the directory part of the path) has been renamed to IO::Path.directory. IO::Path.dir will be removed or re-purposed. * The Str.ucfirst builtin is deprecated; it will be replaced by Str.tc. * The (experimental) LAZY statement prefix will soon be removed. * Leading whitespace in rules and under :sigspace will no longer be converted to .ws . For existing regexes that expect this conversion, add a ? in front of leading whitespace to make it meta again. * The ?-quantifier on captures in regexes currently binds the capture slot to a List containing either zero or one Match objects; i.e., it is equivalent to ** 0..1. In the future, the ?-quantifier will bind the slot directly to a captured Match or to Nil. Existing code can manage the transition by changing existing ?-quantifiers to use ** 0..1, which will continue to return a List of matches. There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Some of the not-quite-there features include: * macros * threads and concurrency * Unicode strings at levels other than codepoints * interactive readline that understands Unicode * non-blocking I/O * much of Synopsis 9 There is an online resource at http://perl6.org/compilers/features that lists the known implemented and missing features of Rakudo Star 2012.08 and other Perl 6 implementations. In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. A draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. [0] https://github.com/rakudo/rakudo/blob/nom/docs/announce/2012.08 [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Re: The trouble with awesome
On Sat, May 26, 2012 at 05:34:18AM +0530, Siddhant Saraf wrote: Rakud[o] is not _the_ reference implementation of Perl 6. Actually, there is no reference implementation for Perl 6. There never will be. Whoever wants to make a perl6 implementation is free to do so. Just follow the spec and you get to label your compiler as a Perl6 implementation. yay ! Just a very minor technical nit (to help preserve clarity): Perl 6 is anything that passes the test suite, which is not necessarily the same as the specification. See Synopsis 1. (Yes, this means the synopses can also contain bugs, and we can and do file bug reports on the synopses themselves.) Pm
Re: How to make a new operator.
On Thu, Mar 22, 2012 at 11:07:08AM -0500, Bruce Gray wrote: Well, it works in Niecza. It does not (yet) work in Rakudo: 15:25 Util perl6: my @squares := 0, (- *@a { @a.elems ** 2 }) ... *; say ~@squares[^11]; 15:25 p6eval ..niecza v15-4-g1f35f89: OUTPUT0 1 4 9 16 25 36 49 64 81 100NL 15:25 p6eval ..rakudo 1a468d: OUTPUT0 0 0 0 0 0 0 0 0 0 0NL It now works in Rakudo, as of 2012.03-5-g69920db: my @squares = 0, (- *@a { @a.elems ** 2 }) ... *; say @squares[^11]; 0 1 4 9 16 25 36 49 64 81 100 Also @_ now DTRT again: my @squares = { @_ ** 2 } ... *; say @squares[^11]; 0 1 4 9 16 25 36 49 64 81 100 my @triangle = 1, { @_[*-1] + @_ + 1 } ... *; say @triangle[^11] 1 3 6 10 15 21 28 36 45 55 66 Note that Rakudo also doesn't require a binding operation for the array... assignment of detectably infinite lists (indicated here by the final Whatever term) is supported. Pm
Re: How to make a new operator.
On Fri, Mar 23, 2012 at 03:03:09PM +1300, Martin D Kealey wrote: On Thu, 22 Mar 2012, Carl Mäsak wrote: Jonathan Lang (), Daniel (): 1, 2, 4 ... 100 # same as 1,2,4,8,16,32,64 That last one doesn't work on Rakudo :-( And it never will. Note that 100 is not a power of 2, and that the goal needs to match exactly. Hmmm, so it's likely that most times you get a Num rather than an Int or Rat, those won't stop either? 1, 7 / 6.0 ... 2 1, sqrt(2), 2 ... 8 The expression 7/6.0 produces a Rat, so the first sequence properly stops at 2. On Rakudo on my system, sqrt(2) indeed produces a Num, but since floating point arithmetic doesn't result in sqrt(2) / 1 == 2 / sqrt(2), no geometric sequence is deduced and the sequence fails with unable to deduce sequence. Question: do we support 1, 2i, -4 ... 256 I think this ought to work, but for some reason Rakudo on my system hangs whenever I try it. The following does work in Rakudo: say 1, { $^x * 2i } ... 256 1 0+2i -4+0i -0-8i 16+-0i 0+32i -64+0i -0-128i 256+-0i The fact that the auto-deduced sequence hangs probably needs to be filed as a bug report for Rakudo. Pm
Re: [perl6/specs] a7cfe0: [S32] backtraces overhaul
On Tue, Aug 23, 2011 at 05:36:27PM +0200, Damian Conway wrote: And I'd like there to be a more consistent approach than that (though I don't really care what it actually is). +1 to consistency. Pm
Re: Encapsulating the contents of container types
On Mon, Aug 22, 2011 at 06:39:25AM +0100, Nicholas Clark wrote: Is it? If, at the implementation layer, all accesses to objects are actually function calls called via vtables, then surely it's *relatively* simple to change the vtable to replace * mutator methods with methods which croak (the shallow read-only part) * accessor methods for internal storage with methods which return proxy objects which are read-only At present I don't think we have anything that identifies mutator methods and/or accessor methods, so perhaps that's where we would need to start. Pm
Re: Encapsulating the contents of container types
On Sat, Aug 20, 2011 at 04:41:08PM -0700, Darren Duncan wrote: I believe the general solution to this problem is to make all objects immutable, with the only exception being explicit references, and so mutating an object isn't an option; rather you have to derive a new object. Values of all types should be immutable, even if that type is Array or whatever, and only Variables should be mutable. ... To make sure I understand correctly, you're essentially saying that @a.push(3) should not modify @a directly -- someone would have to write something like @a = @a.push(3) # or @a .= push(3) And to do a shift, one would have to do something like ($value, @a) = @a; since @a.shift would be unable to mutate the array. (I'm not exactly sure what pop would look like.) Is that correct? Pm
Re: Close($file) required in Perl 6, unlike Perl 5
On Mon, Jul 18, 2011 at 10:41:30AM -0400, Peter Lobsinger wrote: On Sun, Jul 17, 2011 at 11:00 AM, Patrick R. Michaud pmich...@pobox.com wrote: On Sun, Jul 17, 2011 at 10:21:19AM +0200, Moritz Lenz wrote: Question to the Parrot developers: How could I implement DESTROY methods in Rakudo? Is there any vtable I can override, or so? Note that such a method might itself allocate new GCables. While not urgent, it's important for us in the long run. A possibly related (and more relevant) question for Parrot devs: is there any reason that FileHandle PMCs do not automatically flush + close on destruction? The destructor does exactly that, but is not triggered by global teardown. To be a bit more direct, then: Several of Parrot's target languages have the semantic that normal program exit will cause any open filehandles to be flushed and closed automatically. How does a HLL writer achieve this in Parrot? Pm
Re: Close($file) required in Perl 6, unlike Perl 5
On Mon, Jul 18, 2011 at 11:26:49AM -0400, Andrew Whitworth wrote: On Mon, Jul 18, 2011 at 10:41 AM, Peter Lobsinger plobs...@gmail.com wrote: The destructor does exactly that, but is not triggered by global teardown. That seems wrong to me, we should be sweeping pools and destroying PMCs on global teardown. If we aren't doing that, it's a bug. Now added as TT #2157, at least for the FileHandle not closing part. Pm
Re: Close($file) required in Perl 6, unlike Perl 5
On Sun, Jul 17, 2011 at 10:21:19AM +0200, Moritz Lenz wrote: Question to the Parrot developers: How could I implement DESTROY methods in Rakudo? Is there any vtable I can override, or so? Note that such a method might itself allocate new GCables. While not urgent, it's important for us in the long run. A possibly related (and more relevant) question for Parrot devs: is there any reason that FileHandle PMCs do not automatically flush + close on destruction? pmichaud@kiwi:~/nom$ cat fh.pir .sub 'main' :main $P0 = new ['FileHandle'] $P1 = $P0.'open'('test.txt', 'w') $P1.'print'(Hello\n) .end pmichaud@kiwi:~/nom$ install/bin/parrot fh.pir pmichaud@kiwi:~/nom$ cat test.txt pmichaud@kiwi:~/nom$ ls -l test.txt -rw-r--r-- 1 pmichaud pmichaud 0 2011-07-17 09:57 test.txt Pm
Re: Bug?
On Sun, Jul 17, 2011 at 10:40:01AM +0200, Moritz Lenz wrote: On 07/14/2011 11:47 PM, Parrot Raiser wrote: When a subroutine is invoked with an empty parameter list, as follows: run_stuff(); sub run_stuff { my ($parm) = @_; say Parameter is $parm; } @_[0] contains Any(). Not Any(), but Any (which say() prints as Any() to ease debugging) Should it? Yes. Not exactly -- master gets this wrong. Type objects are supposed to stringify to and produce a warning. Nom (cf0da7d) also gets this somewhat wrong at present (but still better than master); it's treating the assignment as an item assignment. Pm
Announce: Rakudo Star 2011.04 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the April 2011 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the April 2011 release is available from http://github.com/rakudo/star/downloads. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The April 2011 Star release includes release #40 of the Rakudo Perl 6 compiler [1], version 3.3.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * Modules MiniDBI, form, HTTP::Daemon, Yaml and Module::Tools are removed in this release. * New modules Pies (including panda, the module installer) and HTTP::Server::Simple have been added. * New implementation of IO::Socket::INET, with basic IPv6 support * -p and -n command-line options are now available * Many new IO improvements, including stat-related methods * New --ll-backtrace command-line switch for printing PIR level stack traces * Preliminary implementation of Infix 'orelse' * Added Str.indent * Bugfixes to negation meta operator * Support for complex conjugation There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. Rakudo Star releases are created on a three-month cycle, or as needed in response to important bug fixes or improvements. (The Rakudo compiler will continue with monthly releases.) The next planned release of Rakudo Star will be in July 2011. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Re: Enumerating prefix operators, and spec changes
On Wed, Mar 09, 2011 at 04:40:19PM -0800, Stefan O'Rear wrote: This is a more general problem: the distinction between prefix ops and functions is not well defined. For instance, 'defined 1 0' is parsed as defined(1) 0 by Rakudo, but as defined(1 0) by STD and derivatives. I think STD tends to supercede the spec. Who has the authority to make changes to the spec like this, that would invalidate existing programs for the sake of a perceived improvement? I would change this, and a few other things, but feel I lack this authority. I wonder what the correct process is. I believe the process is Forgiveness is better than permission. In other words, change the spec, and if anyone carps we discuss it then. Pm
Announce: Rakudo Star 2010.12 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the January 2011 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the January 2011 release is available from http://github.com/rakudo/star/downloads. Starting with this January 2011 release, Rakudo Star releases will be created on a three-month cycle, or as needed in response to important bug fixes or improvements. (The Rakudo compiler will continue with monthly releases.) The next planned release of Rakudo Star will be in April 2011. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The January 2011 Star release includes release #37 of the Rakudo Perl 6 compiler [1], version 3.0.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * faster subroutine calls (type cache) * implemented 'handles Rolename' trait * 'use Devel::Trace' debugging pragma * improved parsing of keyword boundaries * faster .comb There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Announce: Rakudo Star 2011.01 released
(Resending, since I had the wrong date in the subject line of my previous post. Apologies to everyone for the duplicates! --Pm) On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the January 2011 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the January 2011 release is available from http://github.com/rakudo/star/downloads. Starting with this January 2011 release, Rakudo Star releases will be created on a three-month cycle, or as needed in response to important bug fixes or improvements. (The Rakudo compiler will continue with monthly releases.) The next planned release of Rakudo Star will be in April 2011. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The January 2011 Star release includes release #37 of the Rakudo Perl 6 compiler [1], version 3.0.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * faster subroutine calls (type cache) * implemented 'handles Rolename' trait * 'use Devel::Trace' debugging pragma * improved parsing of keyword boundaries * faster .comb There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Announce: Rakudo Star 2010.12 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the December 2010 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the December 2010 release is available from http://github.com/rakudo/star/downloads. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The December 2010 Star release includes release #36 of the Rakudo Perl 6 compiler [1], version 2.11.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * New .trans algorithm * Configuration improvements * More bug fixes There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Thus, we do not consider Rakudo Star to be a Perl 6.0.0 or 1.0 release. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. Starting with the January 2011 release, Rakudo Star releases will be created on a three-month cycle, or as needed in response to important bug fixes or improvements. The next planned release of Rakudo Star will be on January 25, 2011. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Announce: Rakudo Star 2010.11 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the November 2010 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the November 2010 release is available from http://github.com/rakudo/star/downloads. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The November 2010 Star release includes release #35 of the Rakudo Perl 6 compiler [1], version 2.10.1 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * qw// is implemented * The .trans method is 5x faster * Indexing with ranges and Whatever offsets now works There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Thus, we do not consider Rakudo Star to be a Perl 6.0.0 or 1.0 release. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. Rakudo Star releases are created on a monthly cycle or as needed in response to important bug fixes or improvements. The next planned release of Rakudo Star will be on December 28, 2010. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Re: IO Multiplexing
On Fri, Nov 12, 2010 at 11:21:10AM -0800, Stefan O'Rear wrote: TIMTOWDI. Perl without system calls is not Perl. +1 This is why S16 is junk - too much blue-sky thinking, not enough pragmatism and practical experience. Agreed. Forbidding things out of idealistic concerns like API purity is not the Perl way. +1 Pm
Re: Unicode Categories
On Wed, Nov 10, 2010 at 01:03:26PM -0500, Chase Albert wrote: Sorry if this is the wrong forum. I was wondering if there was a way to specify unicode categorieshttp://www.fileformat.info/info/unicode/category/index.htmin a regular expression (and hence a grammar), or if there would be any consideration for adding support for that (requiring some kind of special syntax). Unicode categories are done using assertion syntax with is followed by the category name. Thus isLu (uppercase letter), isNd (decimal digit), isZs (space separator), etc. This even works in Rakudo today: $ ./perl6 say 'abcdEFG' ~~ / isLu / E They can also be combined, as in +isLu+isLt (uppercase+titlecase). The relevant section of the spec is in Synopsis 5; search for Unicode properties are always available with a prefix. Hope this helps! Pm
Re: Unicode Categories
On Wed, Nov 10, 2010 at 01:21:57PM -0500, Chase Albert wrote: That's exactly what I was looking for*. Awesome, thank you. * Almost. E.g. isL would be nice to have as well. Those exist also: $ ./perl6 say 'abCD34' ~~ / isL / a say 'abCD34' ~~ / isN / 3 Pm
Announce: Rakudo Star 2010.10 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the October 2010 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the October 2010 release is available from http://github.com/rakudo/star/downloads. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The October 2010 Star release includes release #34 of the Rakudo Perl 6 compiler [1], version 2.9.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * A simple implementation of 'require' * Local timezone is available in $*TZ * Implementations of ms// ss/// (samespace) * Speed improvements to Str.flip * Hyperoperator versions of += * Improved diagnostic messages and warning messages * True and False now stringify properly * Attribute modification via introspection There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Thus, we do not consider Rakudo Star to be a Perl 6.0.0 or 1.0 release. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed at rakudo...@perl.org. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. Rakudo Star releases are created on a monthly cycle or as needed in response to important bug fixes or improvements. The next planned release of Rakudo Star will be on November 23, 2010. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/ [3] http://github.com/perl6/roast
Announce: Rakudo Star 2010.09 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the September 2010 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the September 2010 release is available from http://github.com/rakudo/star/downloads. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The September 2010 Star release includes release #33 of the Rakudo Perl 6 compiler [1], version 2.8.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * Several performance improvements have been implemented; notably in the slurp() and reverse() functions * The series operator has been refactored and updated to the current specification * Temporal objects (DateTime, Date, Instant, and Duration) are now completely implemented * Enumeration objects now conform much closer to the specification * 'now' and 'time' are now terms instead of functions. This means you can write 'time - 1' and it will do what you mean, but 'time()' is no longer valid. * The Perl 6 specification tests [3] are now included in the distribution. There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Thus, we do not consider Rakudo Star to be a Perl 6.0.0 or 1.0 release. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. Rakudo Star releases are created on a monthly cycle or as needed in response to important bug fixes or improvements. The next planned release of Rakudo Star will be on October 26, 2010. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/ [3] http://github.com/perl6/roast
Re: [perl6/specs] 761178: remove some some duplicate words words
On Wed, Sep 08, 2010 at 04:02:10PM +0400, Richard Hainsworth wrote: I do want the diffs back: its the only way I have to keep at least some idea of what is changing any why. We know that a lot of people would like to see the diffs available through the commit messages, but afaik none of us actively maintaining the github archive quite know how to make that happen. Something beyond please bring diffs back would be very helpful to us here. For those who prefer to just have links to the diffs without the text of the diffs, subscribing to the commit RSS feed is probably the best bet. Pm
Announce: Rakudo Star 2010.08 released
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the August 2010 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the August 2010 release is available from http://github.com/rakudo/star/downloads. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. The August 2010 Star release includes release #32 of the Rakudo Perl 6 compiler [1], version 2.7.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. This release of Rakudo Star adds the following features over the previous Star release: * Nil is now undefined * Many regex modifiers are now recognized on the outside of regexes * Mathematic and range operations are now faster (they're still slow, but they're significantly faster than they were in the previous release) * Initial implementations of .pack and .unpack * MAIN can parse short arguments * Removed a significant memory leak for loops and other repeated blocks This release (temporarily?) omits the Config::INI module that was included in the 2010.07 release, as it no longer builds with the shipped version of Rakudo. We hope to see Config::INI return soon. There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Thus, we do not consider Rakudo Star to be a Perl 6.0.0 or 1.0 release. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. An updated draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. Rakudo Star releases are created on a monthly cycle or as needed in response to important bug fixes or improvements. The next planned release of Rakudo Star will be on September 28, 2010. [1] http://github.com/rakudo/rakudo [2] http://parrot.org/
Re: pattern alternation (was Re: How are ...)
On Thu, Aug 05, 2010 at 12:29:38AM -0700, Darren Duncan wrote: Carl Mäsak wrote: Darren (): Read what I said again. I was proposing that the namespace comprised of names matching a pattern like this: /^ [A..Z]+ | [a..z]+ $/ /^ [[A..Z]+ | [a..z]+] $/ Are the square brackets necessary when the pattern doesn't contain anything other than the alternatives? In this case yes -- the original pattern without the square brackets would act like: / [^ [A..Z]+] | [[a..z]+ $] / In other words, the original pattern says starting with uppercase or ending with lowercase. Pm
Re: pattern alternation (was Re: How are ...)
On Thu, Aug 05, 2010 at 10:27:50AM -0400, Aaron Sherman wrote: On Thu, Aug 5, 2010 at 7:55 AM, Carl Mäsak cma...@gmail.com wrote: I see this particular thinko a lot, though. Maybe some Perl 6 lint tool or another will detect when you have a regex containing ^ at its start, $ at the end, | somewhere in the middle, and no [] to disambiguate. You know, this problem would go away, almost entirely, if we had a :f[ull] adverb for regex matching that imposed ^[...]$ around the entire match. Then your code becomes: m:f/[A..Z]+|[a..z]+/ There's a version of this already. Matching against an explicit 'regex', 'token', or 'rule' automatically anchors it on both ends. Thus: $string ~~ regex { [A..Z]+ | [a..z]+ } is equivalent to $string ~~ regex { ^ [ A..Z+ | [a..z]+ ] $ } Pm
Re: Smart match isn't on Bool
On Sat, Jul 31, 2010 at 11:47:13AM -0400, Brandon S Allbery KF8NH wrote: [...], and if the point is to be a general case statement then when expr block should smartmatch expr against $_ instead of evaluating it with $_ available as a shorthand/topic. This is exactly what when expr block does -- it smartmatches expr against $_. The problem is that there are at least two interpretations of a true result of expr: when True { ... }# execute when $_ is exactly True when foo() { ... } # execute when foo() returns true It's been decided that the latter is far more useful in general; there are plenty of ways to express the former that are much less ambiguous. Pm
Re: Smart match isn't on Bool
On Sat, Jul 31, 2010 at 10:56:47AM -0600, David Green wrote: It's not unreasonable, especially if that's what you expect. But it's even more reasonable to expect this to work: given $something { when True { say That's the truth! } when 42 { say Good answer! } when viaduct { say You guessed the secret word! } } I'm not so sure about this. There's an argument to be made that the Cwhen 42 and Cwhen viaduct cases should never be reachable, since both C42 and Cviaduct are considered true values... ... unless you want Cwhen True to do a value-and-type check, in which case it doesn't exactly follow the pattern for smartmatching of the other builtin types (which only check value equivalence, not type equivalence). Pm
Re: Smart match isn't on Bool
On Sat, Jul 31, 2010 at 04:29:00PM -0400, Aaron Sherman wrote: My problem with that is that it's a really odd use of given/when, and given the implicit smart-match, it doesn't make much sense. Now, to slightly backtrack, I do agree that there should be at least one way to do something, and if that were the only way to perform independent tests within a given, I'd agree. Thankfully, it's not: given $_ { when /clock/ { say clock } if time $limit { say tick } default { say tock } } The problem with this formulation is that a successful 'when' exits the block, while a successful 'if' does not. This is one of the significant differences between 'if' and 'when'. So in the above, the default say tock is executed regardless of the result of the time $limit test. Well, since it's easy to do both, as demonstrated above, I think we can agree that we've satisfied the first rule. It's not as easy to do both as your example seems to illustrate. Perhaps you can provide a better example that does illustrate testing for a condition that also results in exiting the Cgiven block? Pm
Rakudo Star - a useful, usable, early adopter distribution of Perl 6
On behalf of the Rakudo and Perl 6 development teams, I'm happy to announce the July 2010 release of Rakudo Star, a useful and usable distribution of Perl 6. The tarball for the July 2010 release is available from http://github.com/rakudo/star/downloads. Rakudo Star is aimed at early adopters of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren't implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These Star releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo's implementation of it. In the Perl 6 world, we make a distinction between the language (Perl 6) and specific implementations of the language such as Rakudo Perl. Rakudo Star is a distribution that includes release #31 of the Rakudo Perl 6 compiler [1], version 2.6.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community. We plan to make Rakudo Star releases on a monthly schedule, with occasional special releases in response to important bugfixes or changes. Some of the many cool Perl 6 features that are available in this release of Rakudo Star: * Perl 6 grammars and regexes * formal parameter lists and signatures * metaoperators * gradual typing * a powerful object model, including roles and classes * lazy list evaluation * multiple dispatch * smart matching * junctions and autothreading * operator overloading (limited forms for now) * introspection * currying * a rich library of builtin operators, functions, and types * an interactive read-evaluation-print loop * Unicode at the codepoint level * resumable exceptions There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases. Thus, we do not consider Rakudo Star to be a Perl 6.0.0 or 1.0 release. Some of the not-quite-there features include: * nested package definitions * binary objects, native types, pack and unpack * typed arrays * macros * state variables * threads and concurrency * Unicode strings at levels other than codepoints * pre and post constraints, and some other phasers * interactive readline that understands Unicode * backslash escapes in regex [...] character classes * non-blocking I/O * most of Synopsis 9 * perl6doc or pod manipulation tools In many places we've tried to make Rakudo smart enough to inform the programmer that a given feature isn't implemented, but there are many that we've missed. Bug reports about missing and broken features are welcomed. See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. Rakudo Star also bundles a number of modules; a partial list of the modules provided by this release include: * Blizkost - enables some Perl 5 modules to be used from within Rakudo Perl 6 * MiniDBI - a simple database interface for Rakudo Perl 6 * Zavolaj - call C library functions from Rakudo Perl 6 * SVG and SVG::Plot - create scalable vector graphics * HTTP::Daemon - a simple HTTP server * XML::Writer - generate XML * YAML - dump Perl 6 objects as YAML * Term::ANSIColor - color screen output using ANSI escape sequences * Test::Mock - create mock objects and check what methods were called * Math::Model - describe and run mathematical models * Config::INI - parse and write configuration files * File::Find - find files in a given directory * LWP::Simple - fetch resources from the web These are not considered core Perl 6 modules, and as module development for Perl 6 continues to mature, future releases of Rakudo Star will likely come bundled with a different set of modules. Deprecation policies for bundled modules will be created over time, and other Perl 6 distributions may choose different sets of modules or policies. More information about Perl 6 modules can be found at http://modules.perl6.org/. Rakudo Star also contains a draft of a Perl 6 book -- see docs/UsingPerl6-draft.pdf in the release tarball. The development team thanks all of the contributors and sponsors for making Rakudo Star possible. If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org mailing list, or join us on IRC #perl6 on freenode. Rakudo Star releases are created on a monthly cycle or as needed in response to important bug fixes or improvements. The next planned release of Rakudo Star will be on August 24, 2010. [1]
Re: Array membership test?
On Fri, Jul 30, 2010 at 01:52:18AM +0200, Jonathan Worthington wrote: Mark J. Reed wrote: Possibly a FAQ, but is there a simple way of asking if an item is contained in an array? my @x = 1,2,3; say ?...@x.grep(2); say ?...@x.grep(4); 1 0 Though more efficient would be: my @x = 1,2,3; say ?...@x.first(2); say ?...@x.first(4); 1 0 If .grep and List.Bool are implemented the way I think they should be (and the way they are in Rakudo), then both of the above are equally efficient. :-) Pm
Rakudo 'ng' branch is now 'master'
I've just completed the rename of the 'ng' branch to become the new 'master' branch. The old 'master' branch is now called 'alpha'. If you have an existing checkout (clone) of the Rakudo repository, it's probably a good idea to get a new fresh clone rather than trying to pull updates from the existing repo. We know that the new 'master' still doesn't pass a lot of tests but we expect that to change soon. People who want to continue using the older-and-more-complete Rakudo should either use the new 'alpha' branch or the 2010-01 (Minneapolis) release. Thanks! Pm
Re: Gripes about Pod6 (S26)
On Fri, Feb 05, 2010 at 03:43:04PM -0500, Austin Hastings wrote: Second, POD is not XML, and it definitely isn't DOCBOOK. Why do I need magic reserved words like TOC and APPENDIX? I'm not writing a book, I'm writing code. And if I was writing a book, I wouldn't be dumb enough to write it in POD. Actually, it's worth noting that (a slightly modified version of) Perl 5 POD has indeed been used to write several substantial books. I'd be very sad if (Perl 6) POD couldn't be easily used or converted into something that can be used to generate manual pages and reference documentation. Pm
Re: One-pass parsing and forward type references
On Sun, Jan 31, 2010 at 06:35:14PM +0100, Carl Mäsak wrote: I found two ways. Either one uses Caugment (the language construct formerly known as Cis also): class B {} class A { sub foo { B::bar } } augment class B { sub bar { A::foo } } ...or one may use the C:: notation to index a type using a string value: class A { sub foo { ::B::bar() } } class B { sub bar { A::foo } } There's a third way: class B { ... }# introduce B as a class name without definition class A { sub foo { B::bar } } class B { sub bar { A::foo } } The first line is a literal ... in the body of the class -- it indicates that we're only declaring the name as being a type, and that something else will fill in the details later. Pm
Announce: Rakudo Perl 6 Development Release #25 (Minneapolis)
[This notice is going out a bit late; the release was indeed produced on time, but I was delayed in sending out this notice. With apologies for the delay... --Pm] On behalf of the Rakudo development team, I'm pleased to announce the January 2010 development release of Rakudo Perl #25 Minneapolis. Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the January 2010 release is available from http://github.com/rakudo/rakudo/downloads . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. The January 2010 release is code named Minneapolis for Minneapolis.pm, hosts of the annual Frozen Perl Workshop [1]. In 2009 the Frozen Perl Workshop featured a one-day hackathon for Perl 6 and Rakudo development, which ultimately informed the design and implementation of the current build system. (The 2010 Frozen Perl Workshop will be on February 6, 2010, for those interested in attending.) Shortly after the October 2009 (#22) release, the Rakudo team began a new branch of Rakudo development (ng) that refactors the grammar to much more closely align with STD.pm as well as update some core features that have been difficult to achieve in the master branch [2, 3]. We had planned for this release to be created from the new branch, but holiday vacations and other factors conspired against us. This is absolutely the final release from the old development branch; we expect to make the new branch the official master branch shortly after this release. This release of Rakudo requires Parrot 2.0.0. One must still perform make install in the Rakudo directory before the perl6 executable will run anywhere other than the Rakudo build directory. For the latest information on building and using Rakudo Perl, see the README file section titled Building and invoking Rakudo. Some of the specific changes and improvements occuring with this release include: * Rakudo is now passing 31,957 spectests, or 85.7% of the available test suite. This is roughly the same level as the December 2009 release (because most effort has taken place in the ng branch as described above). * Rakudo's calling conventions have been updated to match changes in Parrot 2.0.0's calling and context structures. The Perl 6 language specification is still in flux. Please take note of the following changes, which might affect your existing programs. In the next release of Rakudo, the deprecated features will likely be gone. * The root of the object hierarchy has been changed from 'Object' to 'Mu'. The type 'Object' goes away. * The term 'undef' is gone. You can replace it with other constructs, depending on context: - 'Nil' is undefined in item context, and the empty list in list context - 'Mu' is the most general undefined value which does not flatten in list context - as a smart matching target, you can replace '$obj ~~ undef' by '$obj ~~ *.notdef' * Builtin classes will derive from 'Cool' (which itself derives from 'Any'). Most of the builtin methods on these classes will be defined in the 'Cool' class instead of 'Any'. See Synopsis 2 for more details. * Starting with the next release, we will likely switch to using .MM instead of -MM (dot instead of hyphen) as release identifiers. This is intended to simplify building and packaging for other distribution systems. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compi...@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#26) is scheduled for February 18, 2010. A list of the other planned release dates and codenames for 2010 is available in the docs/release_guide.pod file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://www.frozen-perl.org/ [2] http://use.perl.org/~pmichaud/journal/39779 [3] http://use.perl.org/~pmichaud/journal/39874
Re: One-pass parsing and forward type references
On Mon, Feb 01, 2010 at 05:55:47PM +0100, Carl Mäsak wrote: Is it allowed to do 'class B { ... }' several times in different files before finally declaring the real B? If so, then I'd consider it equivalent to my proposed keyword, and thus there'd be no need for the latter. Yes. And declaring the real B doesn't have to be final, nor does it have to occur at all (as long as none of the features needed from B are ever needed). Pm
Re: One-pass parsing and forward type references
On Mon, Feb 01, 2010 at 05:56:09PM +0100, Jan Ingvoldstad wrote: On Mon, Feb 1, 2010 at 17:46, Patrick R. Michaud pmich...@pobox.com wrote: There's a third way: class B { ... }# introduce B as a class name without definition class A { sub foo { B::bar } } class B { sub bar { A::foo } } It seems to me that this doesn't really solve the problems that will occur when people start making packages independently of eachother. Of course it can be solved by submitting patches to the other developer's code, but it seems inelegant. I see it as not being much different that what already happens now in most languages I deal with. Assume the above lines of code are in different files -- one for A and one for B. Presumably A has a reason for saying class B { ... } instead of the more likely use B; -- i.e., the author of A knows that it is using B, and that B is likely to refer back to A. And in the above example, I'd expect the file containing the definition of B to likewise have either a use A; or class A { ... } declaration. It ultimately comes down to the fact that Perl expects each module to declare class names before they get used, unless the class names are part of CORE. Pm
Re: Debugging Grammars
On Sun, Dec 27, 2009 at 01:30:18AM -0800, Ovid wrote: my $config = Config::Tiny::Grammar.parse($text); #say $config ?? 'yes' || 'no'; say $config.perl; Currently this matches, but if I add a \s* before the final \n in the section token, it fails to match. I don't know why this is and I'm unsure of how to debug Perl 6 regexes. Any \s* will end up matching the final \n, and since quantifiers in tokens default to non backtracking, \s* \n in a token will always fail. (In P5, it'd be like (?\s*)\n.) Perhaps \h* \n would do what you want here? Alternatively, you can force backtracking by using \s*! instead. The new version of Rakudo (the ng branch) provides a debugging mode that provides some tracing of the grammar as its matching. I don't know that it would've found the above yet -- it still needs some work. my $config = Config::Tiny::Grammar.parse($text); #say $config ?? 'yes' || 'no'; say $config.perl; Also, if I uncomment that 'say $config ??' line, I get the following strange error: ResizablePMCArray: Can't pop from an empty array! in Main (file unknown, line unknown) It's a parsing error in Rakudo at the moment -- it *should* be telling you that it found a '??' but no '!!'. Again, the new version (arriving in a week or so) should be better about such messages. Pm
Re: r29381 - docs/Perl6/Spec
On Sat, Dec 19, 2009 at 03:29:21PM -0800, Jon Lang wrote: What if I need to make a new type that, like junctions, should not derive from Any, but isn't a junction? Is it that explicitly deriving from a type that's already outside of Any (such as Mu or junction) automatically disables the implicit Any derivation? Yes. Pm
Re: p6 Q: How do I metaprogram this?
On Wed, Dec 09, 2009 at 12:16:32AM -0500, Austin Hastings wrote: But I'm curious if there's some P6 feature I've forgotten about (which I've forgotten most of them, excepting the rev number) that would let me do this without having to go too far away from the metal. Coming at this from a different angle, C# offers syntactic sugar for getter/setter methods. This example of mine might be a candidate for a macro, depending on the language. But is this a p6 macro? Or is there some in-between that I just don't know about. In Perl 6, getter and setter methods are generated automatically for most attributes that are declared with a dot twigil. Writing has $.xyz; in a class declaration (note the dot twigil) automatically defines a getter method for the class that is similar to: multi method xyz() { $!xyz } And writing has $.xyz is rw; automatically creates a getter/setter method that allows both read and write access to the invocant's $!xyz attribute. I've thought briefly about having NQP automatically create getter methods as well, but for the moment it feels safer to not do this and require them to be written explicitly. Writing p6-like setter (rw) methods in NQP is a real pain at the moment, because native Parrot doesn't have a convenient mechanism for a method to return a reference to an attribute slot. (In other words, there's not a good way in core Parrot to do the equivalent of foo() := $value; or $obj.method() := $value; .) Pm
Re: error installing Perl6
On Thu, Nov 12, 2009 at 12:49:01PM -0800, Darren Duncan wrote: I think that a best practice these days is to download and build Parrot separately (which can be in a custom location) and then separately download and configure Rakudo to use Parrot's location, rather than use gen_parrot. Parrot is gotten with Subversion, and Rakudo with Git. I could be wrong. -- Darren Duncan It's still often hard to know *which* revision of Parrot to get -- Rakudo doesn't always build against Parrot HEAD. (Phrased differently, sometimes Parrot introduces a change that breaks Rakudo until we have a chance to catch up.) So, for people whose primary aim is to build Rakudo, we continue to recommend the --gen-parrot approach. That gives the best shot at getting something working. If the primary aim is to build and install Rakudo for a more site wide purpose, then installing Parrot first and building Rakudo to use that makes more sense. But one has to be careful to match the Rakudo version with the corresponding Parrot version (in build/PARROT_REVISION of the Rakudo repository). Pm Richard Hainsworth wrote: Just got error from new clone rakudo directory, Viz. rich...@jupiter:~/Development$ git clone git://github.com/rakudo/rakudo.git Initialized empty Git repository in /home/richard/Development/rakudo/.git/ remote: Counting objects: 22035, done. remote: Compressing objects: 100% (5908/5908), done. remote: Total 22035 (delta 16176), reused 21484 (delta 15720) Receiving objects: 100% (22035/22035), 2.92 MiB | 925 KiB/s, done. Resolving deltas: 100% (16176/16176), done. rich...@jupiter:~/Development$ cd rakudo/ rich...@jupiter:~/Development/rakudo$ perl Configure.pl --gen-parrot Generating Parrot ... /usr/bin/perl build/gen_parrot.pl --prefix=/home/richard/Development/rakudo/parrot_install --optimize Checking out Parrot r42403 via svn... Can't exec svn: No such file or directory at build/gen_parrot.pl line 47. Configuring Parrot ... /usr/bin/perl Configure.pl --prefix=/home/richard/Development/rakudo/parrot_install --optimize Unknown option: prefix Unknown option: optimize ===SORRY!=== Unable to locate parrot_config To automatically checkout (svn) and build a copy of parrot r42403, try re-running Configure.pl with the '--gen-parrot' option. Or, use the '--parrot-config' option to explicitly specify the location of parrot_config to be used to build Rakudo Perl. Building Parrot ... ===SORRY!=== Unable to locate parrot_config To automatically checkout (svn) and build a copy of parrot r42403, try re-running Configure.pl with the '--gen-parrot' option. Or, use the '--parrot-config' option to explicitly specify the location of parrot_config to be used to build Rakudo Perl.
Re: Implicit die in CATCH blocks
On Sat, Sep 19, 2009 at 06:35:45PM -0400, Kodi Arfer wrote: In the process of writing some more tests for CATCH blocks, I've noticed what appears to be a contradiction between Synopsis 4 on the one hand and pugs/t/spec/S04-statements/try.t and Rakudo's current behavior on the other. The short answer is that Rakudo's implementation of exceptions doesn't match the specification yet. We still have quite a bit of work to do there. Pm
Re: How can i contribute for perl 6 ?
On Tue, Sep 15, 2009 at 10:02:02PM +1000, Timothy S. Nelson wrote: On Tue, 15 Sep 2009, Saravanan Thiyagarajan wrote: Would like to be a volunteer in working for perl-6. Can some one help me to get into right direction ? Sure. The best way to help depends on your skill-set. One place to start is at http://www.rakudo.org/how-to-help [...] See also http://use.perl.org/~masak/journal/39445 , which undoubtedly ought to be preserved somewhere on rakudo.org . Pm
Re: How can i contribute for perl 6 ?
On Tue, Sep 15, 2009 at 11:16:56AM -0500, Kyle Hasselbacher wrote: On Mon, Sep 14, 2009 at 11:00 PM, Saravanan Thiyagarajan perlsa...@gmail.com wrote: Would like to be a volunteer in working for perl-6. Can some one help me to get into right direction ? This is how I did it: http://perlmonks.org/?node_id=780001 Now added to http://rakudo.org/how-to-help . Perhaps we also need a how to get involved section on perl6.org ...? Pm
Re: r28196 - docs/Perl6/Spec
On Mon, Sep 07, 2009 at 09:56:51AM -0700, yary wrote: I just saw the intent for this in the split up compilation of the setting thread- that it is useful to: Enable a class stub syntax that allows us to declare a given symbol as being a valid class without having to declare the body of the class at that time. For example: class Rat { ... }; I can agree with that so long as the yada is the only token inside the brackets. On the other hand why not go along with C convention and allow class Rat; We can't use this one -- it already means something different (namely, that the rest of the file is the specification for class Rat). Pm
Re: r28113 - docs/Perl6/Spec
On Mon, Aug 31, 2009 at 01:28:08PM -0700, Darren Duncan wrote: This is a great move; thanks for this change. So now writing things like 5/43 in code will DWIM and produce a Rat which maintains the intended value exactly, with no floating-point imprecision; and so plain 5/43 is now a plain Rat literal, same as 1.23 is. FWIW, presently the specification somewhat implies that 1.23 is a Num literal, and doesn't say anything about it producing a Rat. (Yes, conversations on #perl6 have indicated that it may be otherwise, but nothing is currently in the spec about it.) S02:401 : One consequence of all this is that you may no longer write a Num as C42. with just a trailing dot. You must instead say either C42 or C42.0. Pm
Re: [perl #64566] @a[1..*] adds trailing undef value
On Wed, Aug 19, 2009 at 04:54:10AM -0700, Moritz Lenz via RT wrote: On Wed Apr 08 14:59:19 2009, moritz wrote: 23:55 @moritz_ rakudo: my @a = 1..4; say @a[1..*].perl 23:56 p6eval rakudo 6b9755: OUTPUT«[2, 3, 4, undef]» It should just be [2, 3, 4]. Since the discussion came up on #perl6 if this is really the expected behaviour, S09 says: As the end-point of a range, a lone whatever means to the maximum specified index (if fixed indices were defined): say @calendar[5..*]; # Same as: say @calendar[5..11] say @calendar{Jun..*};# Same as: say @calendar{Jun..Dec} or to the largest allocated index (if there are no fixed indices): say @data[1..*]; # Same as: say @results[1..5] It doesn't mention how the postcifcumfix:[ ] is supposed to introspect those to find out if the WhateverCode object constructed by 1..* needs to receive self.elems or self.elems-1 as an argument. The short answer is that 1..* isn't a WhateverCode object, it's a Range with a Whatever endpoint. (Rakudo currently gets this wrong, yes.) So postcircumfix:[ ] then changes its dispatch based on having a Range argument. Pm
Re: Embedded comments: two proposed solutions to the comment-whole-lines problem
On Mon, Aug 10, 2009 at 06:46:34PM +0100, smuj wrote: Although I can see some minimal uses for embedded comments, I think in general the cost/benefit ratio isn't enough to warrant their existence. I could be wrong of course! :-) I'd like to know if anyone has made much use of them in their code, and under what circumstances. I've used embedded comments a number of times (especially in examples) and found them to be incredibly useful. I'd be sad to see them disappear. I'd be fine with the ##(embedded comment solution) approach (doubling the #'s), but it's much less visually appealing to me. I think I'd prefer to see a doubling of the bracketing chars instead of doubling the #'s -- the # is visually a heavy glyph and I'd prefer something a bit lighter. #((embedded comment)) #{{embedded comment}} Pm
Re: Rukudo-Star = Rakudo-lite?
On Sun, Aug 09, 2009 at 04:30:07PM +0400, Richard Hainsworth wrote: Referring to Patrick's blog about an official 'useable' version of Rakudo, a suggestion: Since Rakudo* (not sure how it is to be written) is intended to be a cut-down version of perl6.0.0 that is useable, how about Rakudo-lite? Hmmm, that's a very reasonable name. Over the past few days I've become a little attached to Rakudo Star, but I agree that Rakudo light might be a bit more descriptive. I'll have to mull it over a while. Pm
Re: Rukudo-Star = Rakudo-lite?
On Sun, Aug 09, 2009 at 10:57:16PM +0100, Tim Bunce wrote: Since Rakudo* (not sure how it is to be written) is intended to be a cut-down version of perl6.0.0 that is useable, how about Rakudo-lite? Hmmm, that's a very reasonable name. Over the past few days I've become a little attached to Rakudo Star, but I agree that Rakudo light might be a bit more descriptive. I'll have to mull it over a while. [...] I like Rakudo Star. It doesn't try to be descriptive. It's just a name. Based on #perl6 discussions and a few other threads, I've decided we'll stick with Rakudo Star. It's non-descriptiveness is an asset at this point. Pm
Re: Rukudo-Star = Rakudo-lite?
On Sun, Aug 09, 2009 at 04:35:42PM -0600, David Green wrote: On 2009-Aug-9, at 3:57 pm, Tim Bunce wrote: Perhaps it's worth asking what we might call the release after that one. Rakudo not-quite-so-lite? Rakudo ** (aka Rakudo Exponentiation)? Though I think Patrick is optimistic that development will proceed exponentially enough that a single interim release will be enough to hold us over until Christmas. I'm not sure I'm quite THAT optimistic. :-) We may end up with multiple interim releases in the Rakudo Star series before we reach Christmas. (And yes, they may even be *+1, *+2, etc.) In some ways I'm starting to think of Star (or whatever designation we end up using) as a label for a series of interim releases in the same sense that NASA used Gemini as the label for the program came between Mercury and Apollo. In other words, Star may really end up being a designation for a program of planned releases with certain major objectives that cumulatively lead up to the ultimate goal of a full Perl 6 release. The precise details are still a little ill-formed in my head at the moment, but as they come together (and are expressed in planning documents) I'll be blogging or writing about them appropriately. Pm
Re: S05 (regex) Q: after
On Sat, Aug 08, 2009 at 05:45:40PM -0400, Austin Hastings wrote: [...] Specifically, is token { ... ?after x } going to match the same pattern as rule { ... ?after x } ?? I ask because (I just did it, and) with rules encouraging the liberal use of whitespace, and implicitly generating .ws matches, something like: rule { X ?after X } will insert a .ws before the ?after, which the after-block should then be aware of. Why should the after-block be (automatically?) aware of the .ws? Put another way, afaik ?after ... is just a subrule like any other -- it doesn't get any special syntactic significance that enables it to be aware of its surroundings. I would say that the rule should be either rule { X?after X } or if checking the whitespace is desired, it should be rule { X ?after [X ] } # note whitespace after the X So, I suppose the question is, does ?after always behave a certain way, ratchet-wise, and if so what is it? Or does it take its mode from the surrounding context, or something else? Ultimately I think that ?after ... behaves the same as any other subrule, and its pattern takes its ratchet/sigspace mode from the surrounding pattern scope. Pm
Re: r27888 - docs/Perl6/Spec
On Fri, Aug 07, 2009 at 08:17:30AM +0200, Moritz Lenz wrote: pugs-comm...@feather.perl6.nl wrote: Author: jimmy Date: 2009-08-07 05:02:42 +0200 (Fri, 07 Aug 2009) New Revision: 27888 Log: [Spec]fixed the wrong space, now it's \x20, not \xC2A0 What was wrong with the non-breaking spaces? We use Perl 5 and Perl 6 as words, so it makes a lot of sense to separate them by non-breaking spaces, IMHO. Also note that this commit breaks 22 smartlinks. I vote to revert this change and keep the non-breaking space. Pm
Re: Placeholder variable misuse.
On Thu, Jul 30, 2009 at 10:29:04AM -0500, Kyle Hasselbacher wrote: In Rakudo right now, this lives: {$foo;$^foo}(1) However, the spec test expects it to die during compilation (see the end of S06-signature/positional-placeholders.t). It says, A non-twigil variable should not precede a corresponding twigil variable. The spec is correct. Rakudo currently has some issues with order-of-lexicals declarations. In Rakudo right now, this says 3: sub foo { my $a = 3; say $^a }; foo(5); # RT #64310 The spec test would seem to imply that this should die during the definition of 'foo'. Rakudo should complain about the placeholder attempting to redefine $^a. I don't know if that elevates to the level of die, though; STD.pm seems to treat it as a potential difficulty. On the other hand, if we swap the statements, it merely complains that $a is redeclared and then croaks because we assigned to a read-only variable. sub foo { say $^a; my $a = 3 }; foo(5); Redeclaration of variable $a 5 Cannot assign to readonly variable. Rakudo is correct that it's a redeclaration and that the variable (parameter) is readonly and cannot be assigned to. Pm
Re: Parameter binding
On Thu, Jul 23, 2009 at 05:56:31PM +0200, TSa wrote: Hmm, it seems to be the case that the binding is defined to be a readonly binding to the variable. I consider this a bad thing. We should have my $x = 1; foo($x++,$x,$x++); to call foo(1,2,2) and not foo(1,3,2) or even foo(2,3,1). The capture creation for the foo call should be strictly left to right and capturing the value at that moment. ...except that captures don't capture values -- they form references. Pm
Re: XOR does not work that way.
On Thu, Jun 25, 2009 at 02:47:55PM +1000, Timothy S. Nelson wrote: What would happen if we had an operator that returned the number of true values? Say we call it boolean plus, or bop. ...why an operator? sub bop(*...@values) { + grep { $_ }, @values } To give one example: 1 bop 3 = 2 bop 1, 3 Say we're looking at: ($x 1) bop 3 bop ($y 0) bop ($x 1), 3, ($y 0) To get the boolean-logic definition, we'd do: ($x 1) bop 3 bop ($y 0) % 2 bop ($x 1), 3, ($y 0) % 2 To get the natural-language one, we'd do: ($x 1) bop 3 bop ($y 0) == 1 bop ($x 1), 3, ($y 0) == 1 Pm
Rakudo Perl 6 development release #18 (Pittsburgh)
On behalf of the Rakudo development team, I'm pleased to announce the June 2009 development release of Rakudo Perl #18 Pittsburgh. Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the June 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we continue to recommend that people wanting to use or work with Rakudo obtain the latest source directly from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. This release is named Pittsburgh, which is the host for YAPC|10 (YAPC::NA 2009) [2] and the Parrot Virtual Machine Workshop [3]. Pittsburgh.pm has also sponsored hackathons for Rakudo Perl as part of the 2008 Pittsburgh Perl Workshop [4]. In this release of Rakudo Perl, we've focused our efforts on refactoring many of Rakudo's internals; these refactors improve performance, bring us closer to the Perl 6 specification, operate more cleanly with Parrot, and provide a stronger foundation for features to be implemented in the near future. Some of the specific major changes and improvements in this release include: * Rakudo is now passing 11,536 spectests, an increase of 194 passing tests since the May 2009 release. With this release Rakudo is now passing 68% of the available spectest suite. * Method dispatch has been substantially refactored; the new dispatcher is significantly faster and follows the Perl 6 specification more closely. * Object initialization via the BUILD and CREATE (sub)methods is substantially improved. * All return values are now type checked (previously only explicit 'return' statements would perform type checking). * String handling is significantly improved: fewer Unicode-related bugs exist, and parsing speed is greatly improved for some programs containing characters in the Latin-1 set. * The IO .lines and .get methods now follow the specification more closely. * User-defined operators now also receive some of their associated meta variants. * The 'is export' trait has been improved; more builtin functions and methods can be written in Perl 6 instead of PIR. * Many Parrot changes have improved performance and reduced overall memory leaks (although there's still much more improvement needed). The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compi...@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#19) is scheduled for July 23, 2009. A list of the other planned release dates and codenames for 2009 is available in the docs/release_guide.pod file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ [2] YAPC|10 http://yapc10.org/yn2009/ [3] Parrot Virtual Machine Workshop, http://yapc10.org/yn2009/talk/2045 [4] Pittsburgh Perl Workshop, http://pghpw.org/ppw2008/
Re: Module naming conventions
On Tue, Jun 02, 2009 at 02:56:46AM +0200, Daniel Carrera wrote: Jon Lang wrote: On Mon, Jun 1, 2009 at 5:44 PM, Daniel Carrera daniel.carr...@theingots.org wrote: I think we might need to come up with some sort of standard naming convention to distinguish dependencies. Something that the *user* can recognize quickly when he browses CPAN. Why do we need the dependencies to be part of the name? Perl 6 provides a rugged versioning system for its modules; we should use it. I read S11 and AFAICT Perl 6 only includes metadata for *versions* and *authority*: class Dog:ver1.2.1:authcpan:JRANDOM; class Dog:ver1.2.1:authhttp://www.some.com/~jrandom; class Dog:ver1.2.1:authmailto:jran...@some.com; Just because these are the only adverbs mentioned doesn't necessarily mean they're the only ones that will be allowed. Indeed, S11 goes on to later say: The required parts for library insertion are the short name of the class/module, its version number, and a URI identifying the author (or authorizing authority, so we call it auth to be intentionally ambiguous). The fact that S11 says required parts leads me to believe that there can be other parts that aren't required. Pm
Re: Module naming conventions
On Tue, Jun 02, 2009 at 10:58:21AM +0200, Daniel Carrera wrote: John M. Dlugosz wrote: The front-end should figure out which binary is proper for your platform. I don't like that idea in the slightest. (1) It is not Perl's job to know if you have a C compiler, C libraries and tool chain. (2) If my computer can handle Perl, C and Parrot, I want the choice of what to install. (3) That includes the possibility of installing more than one module. It is perfectly legitimate to install three implementations of SHA (one in C, one in Parrot and one in pure Perl). This last one means that there has to be a way to tell Perl which of the Digest::SHA modules I want to use for this particular program. Suppose I want to install three versions of SHA. One in C, one in Perl, one in Parrot. I need a way to specify in the use statement which one I want. For the Parrot case at least, I suspect one would/could do: use SHA:fromParrot; (See the :from adverb in S11.) Indeed, for someone who is running an implementation of Perl 6 on Parrot (and where a Parrot-specific implementation of SHA is available), I would expect a plain usa SHA; to load SHA.pm which then in turn does the :fromParrot version of use. Or any other number of implementation-specific tricks that can hide the details for a generic use SHA but still make it possible for more specific requirements to be made. Pm
Re: CPAN -- moving forward
On Mon, Jun 01, 2009 at 06:34:02PM +0200, Daniel Carrera wrote: I am in IRC working with Rakudo folk on how Rakudo is going to store modules on the disk. Once that is done, one can begin talking about a package format and an installer, and then go from there. So far the discussion has been productive and we have some code written that we can experiment with. So I feel encouraged. Rough concensus and running code. +1 Pm
Re: Feature request: Grammar debugging support
On Fri, May 29, 2009 at 11:20:20AM -0700, Larry Wall wrote: Can't help you with PGE, but STD supports a trace facility by setting the STD5DEBUG environent variable to -1, or a set of bits defined in src/perl6/Cursor.pmc in the pugs repo. I'll look at what STD is using for its traces and see if I can come up with something similar for PGE. Pm
Re: Amazing Perl 6
On Fri, May 29, 2009 at 10:04:39AM -0700, Larry Wall wrote: On Fri, May 29, 2009 at 09:50:36AM -0700, yary wrote: : Show that much of the basics still work: : my @x=('a' .. 'z'); @x[3,4]=qw(DeeDee Ramone); : say @x.splice(2,4).join(',') : c,DeeDee,Ramone,f That qw is not a good example of what still works, since it is supposed to be interpreted as a qw subroutine (rakudo bug). I recommend square brackets instead. And Rakudo now correctly treats qw() like a function instead of a quote: $ ./perl6 say qw(DeeDee Ramone); Could not find non-existent sub Ramone say qw (DeeDee Ramone); DeeDeeRamone say qw[DeeDee Ramone]; DeeDeeRamone Thanks Larry! Pm
Re: Meditations on a Loop
On Mon, May 25, 2009 at 12:37:34PM -0700, yary wrote: That's an enjoyable and educational read, thanks! There's one form under TMTOWTDI that I'd like to see, but can't figure out myself. It's the version analogous to this perl5 snippet- sub odd {$_ % 2} say grep odd,0..6; -where the line that filters the list mentions no variables at all, and $_ does its work behind the curtains. How about...? sub odd { ^$a % 2 } say grep odd, 0..6; This gets us to within one character of the p5 version. I think we also have the possibility of subset odd where { $_ % 2 } say grep odd, 0..6; which is the same length as the p5 version, but afaict this last one doesn't seem to be working in Rakudo yet. Pm
Re: Unexpected behaviour with @foo.elems
On Tue, May 26, 2009 at 06:43:40PM -0500, John M. Dlugosz wrote: Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote: The following construction doesn't do what a user might expect: for 0...@foo.elems - $k { do_something($k,@foo[$k]) } Write ^...@foo.elems as a shortcut of 0...@foo.elems, which is the variation to exclude that endpoint if you would rather not write 0...@foo.elems-1. An even cleaner shortcut might be to use ^...@foo instead of ^...@foo.elems: for ^...@foo - $k { do_something($k, @foo[$k]) } Somewhat clearer could be: for @foo.keys - $k { do_something($k, @foo[$k]) } And some may prefer: for @foo.kv - $k, $v { do_something($k, $v) } I think the anti-pattern of 0...@foo.elems (or its incorrect form 0...@foo.elems) should probably disappear in favor of the above forms instead. Pm
Re: Meditations on a Loop
On Tue, May 26, 2009 at 04:10:45PM -0700, yary wrote: On Tue, May 26, 2009 at 1:57 PM, Patrick R. Michaud pmich...@pobox.com wrote: On Mon, May 25, 2009 at 12:37:34PM -0700, yary wrote: How about...? sub odd { ^$a % 2 } typo. sub odd {$^a % 2} works (caret goes between $ and a) Correct, that's a typo. say grep odd, 0..6; nice. I need to learn the differences between calling a sub as odd vs odd in p6. Haven't gotten that far in the synopses yet. In p6, one always uses the sigil to refer to the sub itself; the bare identifier form invokes it. I was wondering why the perl5 example didn't work in p6- $_ is a contextual variable, so why doesn't the body of odd get its $_ value from grep in something like this: sub odd_a { $_ % 2} This is really equivalent to sub odd_a(*...@_, *%_) { $_ % 2 } Every Routine gets its own $_ that isn't inherited from the outer lexical context (and is initialized to undef). Beyond that, what is really happening with say grep odd_a, 0..6 is that grep is performing a smart-match of each value of 0..6 with odd_a, and smart-matching a value to a Code object invokes the Code object with the value as an argument. Pm
Rakudo Perl 6 development release #17 (Stockholm)
On behalf of the Rakudo development team, I'm pleased to announce the May 2009 development release of Rakudo Perl #17 Stockholm. Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the May 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we continue to recommend that people wanting to use or work with Rakudo obtain the latest source directly from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. This release is named Stockholm; Stockholm Perl Mongers will be holding a Perl 6 hackathon on May 29 [3]. Perl 6 developer Carl Mäsak is a member of Stockholm Perl Mongers and a main author of November [4], Druid [5], proto [6], and other Perl 6-based packages. Carl also contributes patches to Rakudo, and has been stress-testing Rakudo over the past year, submitting nearly 400 bug reports. In this release of Rakudo Perl, we've made the following major changes and improvements: * Rakudo is now passing 11,342 spectests, an increase of 875 passing tests since the April 2009 release. With this release Rakudo is now passing 68% of the available spectest suite. * We now have an updated docs/ROADMAP . * Errors and stack traces now report the file name and line number in the original source code. * Some custom operators can be defined, and it's possible to refer to operators using infix:op syntax. * We can start to load libraries written in other Parrot languages. * Regexes now produce a Regex sub. * More builtin functions and methods have been rewritten in Perl 6 and placed as part of the setting. * There are many additional improvements and features in this release, see docs/ChangeLog for a more complete list. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compi...@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#18) is scheduled for June 18, 2009. A list of the other planned release dates and codenames for 2009 is available in the docs/release_guide.pod file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ [2] Stockholm.pm, http://sthlm.pm.org/ [3] Stockholm Perl 6 hackathon, http://vic20.blipp.com/pipermail/kameler/2009-May/000318.html [4] November wiki engine, http://github.com/viklund/november/ [5] Druid, http://github.com/masak/druid/ [6] Proto, http://github.com/masak/proto/
Re: Meditations on a Loop
On Wed, May 20, 2009 at 07:55:55PM -0500, John M. Dlugosz wrote: If you would be so kind, please take a look at http://www.dlugosz.com/Perl6/web/med-loop.html. The page currently says: The reason this [.prime] works is because the method-call syntax will call an ordinary non-member sub also. I think this is no longer the case (and hasn't been for some time). Pm
Re: Whitespace in \c[...], \x[...], etc.
On Tue, Apr 28, 2009 at 01:28:40PM -0400, Mark J. Reed wrote: On Tue, Apr 28, 2009 at 10:22 AM, Larry Wall la...@wall.org wrote: Does anyone know offhand whether the Unicode Consortium has an explicit policy against use of punctuation in a charname? So far they only seem to use hyphen and parens, but I wonder to what extent we can depend on that... According to the 5.0.0 standard, section 4.8: Unicode character names contain only uppercase Latin letters A through Z, digits, space, and hyphen-minus. So it seems the notes in parentheses are not considered part of the char name. Countering this, though: * The XML schema for the Unicode Character Database in XML [1] seems to allow parens in the character name property: character-name = xsd:string { pattern=([A-Z0-9 #\-\(\)]*)|(control) } * The Unicode character name database [2] has parens in the name property field for many characters 000A;control;Cc;0;B;N;LINE FEED (LF) * ICU doesn't seem to recognize the versions of the name without the parens (or if it does, I haven't been able to figure out the correct incantations to make it do so). Of course, it's very possible that I'm misreading the Unicode specifications, and the note that Mark cites would seem to be very explicit. But thus far in playing with this I've seen more indications that the parens are allowed or even required than I've seen that indicate they're excluded. Pm [1] http://www.unicode.org/reports/tr42/tr42-3.html#N66310 [2] http://unicode.org/Public/UNIDATA/UnicodeData.txt
Re: Whitespace in \c[...], \x[...], etc.
On Tue, Apr 28, 2009 at 07:22:18AM -0700, Larry Wall wrote: On Mon, Apr 27, 2009 at 11:04:03AM +0200, Helmut Wollmersdorfer wrote: Std.pm allows e.g. \x[ 41 , 42 , 43 ] For convenience - especially with long charnames - it should be possible to write \c[ SPACE, # blafasel LATIN SMALL LETTER A, # some comment COMBINING DOT BELOW, # thisandthat ] In any case, STD doesn't currently try to check the string in \c[...] for correctness. It just scans for the closing bracket. We will certainly need to refine this, and the suggested approach is certainly a possible outcome, if we decide it's sufficiently unambiguous. FWIW, Rakudo and PGE now allow spaces inside the brackets, although they don't understand the # ... comments yet. Pm
Re: Whitespace in \c[...], \x[...], etc.
On Tue, Apr 28, 2009 at 03:08:05PM -0400, Mark J. Reed wrote: On Tue, Apr 28, 2009 at 2:27 PM, Patrick R. Michaud pmich...@pobox.com wrote: * The Unicode character name database [2] has parens in the name property field for many characters 000A;control;Cc;0;B;N;LINE FEED (LF) That's not the name property field. The Unicode character name is field 1 (control, in this case). The field whose value is LINE FEED (LF) is the Unicode_1_Name field, wihch for control characters supplies the ISO 6429 name. Ah, thanks for the excellent clarification. Returning to the original question: Would this then mean that we don't provide a way to specify U+000A and other control characters using a name inside of \c[...]? Or (more likely) does it mean that the names we accept inside of the \c[...] are more than just the strict Unicode character names listed above--i.e., the Unicode_1_Name field and other related aliases (whatever those might be)? Pm
Oslo Perl 6 Hackathon Notes
As some of you are aware, this week is the Nordic Perl Workshop [1], and in the days immediately following the workshop we will have the Oslo Perl 6 Hackathon [2]. During the first day of the hackathon Gabor Szabo will be doing a Hands-on Perl 6 training course [3], the other two days will be for various hacking tasks (both Perl 6 and Perl 5). I personally have three goals for my participation at the workshop and hackathon: * Attend Gabor's course and take careful note of where issues arise with using Rakudo Perl and/or Perl 6 (including filing bug reports and/or answering questions as needed). * Recruit and encourage people to write Perl 6 programs and otherwise start hacking on/with Rakudo Perl. * Meet with other principal Rakudo and Perl 6 designers and implementors to plan the next phases of work and address any significant obstacles currently before us. For now I've started a page at http://www.perlfoundation.org/perl6/index.cgi?perl_6_hackathon_targets that lists a variety of specific ideas for things to work on or address at the hackathon. I'm sure more ideas will arise at NPW itself, and I invite others to add more items to the list as well. Feel free to add things even if you won't be making it to NPW or the hackathon itself; you may think of something that we've overlooked, and there are other hackathons planned later in the summer that will benefit from having the ideas. Thanks! Pm References: [1] http://www.perlfoundation.org/perl6/index.cgi?oslo_perl_6_hackaton_2009 [2] http://www.perlfoundation.org/perl6/index.cgi?perl_6_hackathon_targets [3] http://szabgab.com/blog/2009/03/1235863222.html
Re: S08 Draft questions (Captures and Signatures)
On Wed, Apr 01, 2009 at 09:55:37AM -0300, Daniel Ruoso wrote: Em Qua, 2009-04-01 às 05:41 -0700, Jon Lang escreveu: ...nor would I expect it to. I'm just wondering if (@_, %_) _are_ still part of a placeholder-generated signature. In short, is there a way to access a slurpy array or hash in a block that uses placeholder parameters? I'd guess not, but I think it's a plain design decision. @_ and %_ are part of a placeholder-generated signature if they're mentioned in the block. From S06:154: Note also that if the sub's block contains placeholder variables (such as C$^foo or C$:bar), those are considered to be formal parameters already, so in that case C@_ or C%_ fill the role of sopping up unmatched arguments. That is, if those containers are explicitly mentioned within the body, they are added as slurpy parameters. [...] Pm
Re: On Junctions
On Fri, Mar 27, 2009 at 05:49:02PM -0400, Henry Baragar wrote: I believe that there are hands where $p = 15|26 which would not beat a hand where $d = 17. I believe that the correct way to calculate the value of the hand is: my $p = ([+] @p).map{.eigenstates}.grep{$_ 21}.max; Since the result of [+] is a scalar we don't need to 'map' it. Assuming that .eigenstates exists it would then be my $p = ([+] @p).eigenstates.grep({ $_ 21 }).max Pm
Re: Junction Algebra
On Sat, Mar 28, 2009 at 02:08:22PM +0300, Richard Hainsworth wrote: 3) Conjecture: The following is true of all junction types, eg., junc(..., junc(...)) === junc(..., ...) The conjecture is false for one/none junctions: one(0, one(1, 1)) # true one(0, 1, 1) # false none(0, none(0, 0)) # false none(0, 0, 0) # true I'm still considering the any/all cases. Pm
Re: Junction Algebra
On Sat, Mar 28, 2009 at 10:19:31AM -0500, Patrick R. Michaud wrote: On Sat, Mar 28, 2009 at 02:08:22PM +0300, Richard Hainsworth wrote: 3) Conjecture: The following is true of all junction types, eg., junc(..., junc(...)) === junc(..., ...) The conjecture is false for one/none junctions: one(0, one(1, 1)) # true one(0, 1, 1) # false Boy, I typoed that one. I meant to write: one(1, one(1, 1)) # true one(1, 1, 1)# false Pm
deciphering infix:cmp
Rakudo gives some strange results when sorting a list of mixed strings and numbers, which leads me to look for some clarification on infix:cmp (which S03:2866 says that sort uses by default). Here's the case I found in Rakudo: say ('a', 1, 'b', 2 , 'c', 3, 'd', 4).sort.perl; [a, b, c, 1, 2, 3, 4, d] After tracking it down a bit -- it's not clear what infix:cmp should do when given arguments of differing types. S03:2855 says: Binary Ccmp is no longer the comparison operator that forces stringification. Use the Cleg operator for the old Perl 5 Ccmp semantics. The Ccmp is just like the Ceqv above except that instead of returning CBool::False or CBool::True values it always returns COrder::Increase, COrder::Same, or COrder::Decrease (which numerify to -1, 0, or +1). So, since Ccmp is just like Ceqv, here's the definition of Ceqv for immutable types (S03:2829): Binary Ceqv tests equality much like C=== does, but does so with snapshot semantics rather than eternal semantics. For top-level components of your value that are of immutable types, Ceqv is identical in behavior to C===. And if we look at C===, we have (S03:2802): Binary C=== tests immutable type and value correspondence: for two value types (that is, immutable types), tests whether they are the same value (eg. C1 === 1); [...] Two values are never equivalent unless they are of exactly the same type. This means that C 3 === '3' would be false, and since Ceqv is identical to C=== for immutable types, C 3 eqv '3' would also be false. But what to do with something like C 3 cmp '3' , or any infix:cmp where the operands are of differing types? Unlike Ceqv and C=== that can simply return false for arguments of different types, Ccmp wants to return an ordering. Do we constrain Ccmp to only work on similarly-typed operands (in which case my sort above would fail), or am I overlooking something obvious? Pm
Re: Logo considerations - 3 logos needed
On Wed, Mar 25, 2009 at 10:36:56AM -0400, Mark J. Reed wrote: Rakudo is a particular implementation of Perl 6 using Parrot. While it is a separate project from both Perl 6 and Parrot, it is intimately tied to both, and I think its logo should reflect that. I don't see much point in having separate logos for Rakudo on Parrot and Rakudo without Parrot. I mean, I suppose much of the frontend work could be ported to a different backend, but would that still be considered Rakudo? I don't know that I consider Rakudo Perl to be forever tied to Parrot. If we come up with other backends, I'd still consider the result Rakudo; similar to how Pugs referred to all of the various backends available to it and not just the Haskell backend. So from that perspective, I don't know that the Rakudo logo ought to be strongly tied to Parrot, any more than we tie the Parrot logo to the various GNU tools used to build it. Pm
Re: Logo considerations
On Tue, Mar 24, 2009 at 10:24:47AM -0700, Larry Wall wrote: I want something with gut appeal on the order of Tux. In particular I want a logo for Perl 6 that is: Fun Cool Cute Named Lively Punable [...] +2 to this approach. Pm
Rakudo Perl development release #15 (Oslo)
On behalf of the Rakudo development team, I'm pleased to announce the March 2009 development release of Rakudo Perl #15 Oslo. Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the March 2009 release is available from http://www.pmichaud.com/perl6/rakudo-2009-03.tar.gz However, because of the rapid pace of Rakudo development and addition of new features, we still recommend that people wanting to use or work with Rakudo obtain the latest version directly from the main repository at github -- more on this in a bit. Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. This release is named Oslo in honor of the organizers of the 2009 Nordic Perl Workshop [2], April 16-17, 2009. The 2009 Nordic Perl Workshop will have a special focus on Perl 6, Rakudo Perl, and Parrot, including Perl 6 tutorials and hackathons after the conference itself. A list of the other planned release dates and codenames for 2009 is available in the docs/release_guide.pod file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Rakudo Perl now uses git [3] for its version control system, hosted at http://github.com/rakudo/rakudo . The README file there is kept up-to-date with the latest instructions for obtaining and building Rakudo Perl. In this release of Rakudo Perl, we've made the following major changes and improvements: * Rakudo is now passing 7273 spectests. This is an increase of 197 passing tests since the February 2009 release. * The eval() construct now understands lexical variables from an outer scope. * More of the builtin functions (settings) are being written in Perl 6. * Rakudo supports the R (reverse) metaoperator. * Parsing of if, unless, while, until, etc. statements after blocks now works correctly. * The Q quote operator is now implemented, along with several adverbial forms. In particular, the Q:PIR form allows inline PIR to be included in Perl 6 code. * Multi-method dispatch now works with inheritance also. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. The next release of Rakudo (#16) is scheduled for April 23, 2009. References: [1] Parrot, http://parrot.org/ [2] Nordic Perl Workshop 2009, http://www.perlworkshop.no/npw2009/ [3] Git version control system, http://git-scm.org/
Re: .map/.reduce with larger arity
On Sun, Mar 08, 2009 at 09:31:19PM -0700, Larry Wall wrote: On Sun, Mar 08, 2009 at 09:36:17PM +0100, Moritz Lenz wrote: : But both pugs and rakudo respect the arity of the code ref passed to it, : so that (1..6).map({$^a + $^b + $^c}) returns the list (6, 15), which is : very nice and very DWIM'my. : : But it opens the question what should happen if there is a number of : items in the list that's not easily divisible by the arity - should the : rest just be padded with undef's? or just ignored? Or fail() with a : friendly error message? I think the basic rule has to be simply can the signature bind to the remaining arguments. If not, we get a warning on unused arguments. We can mark arguments as optional if that's what we mean. [...] My gut feeling is that placeholder variables probably should not be considered optional; in most cases a non-divisible number of arguments indicates a logic error in the program, and an earlier message is better, even at the expense of thowing away some (possibly valid) partial data. Especially since we do have a way to indicate that partial data is acceptable: - $a, $b?, $c? { $a + ($b//0) + ($c//0) } Presumably whatever we decide for Cmap() also applies to Cfor, yes? for 1..4 - $a, $b, $c { ... } # error for 1..4 - $a, $b, $c? { ... } # error for 1..4 - $a, $b?, $c? { ... }# ok Pm
Re: Masak List, take 3
On Fri, Mar 06, 2009 at 01:37:16PM +1100, Timothy S. Nelson wrote: I guess the way I decide things like this is: - If it's a method on a role/object, then it lives in S32 - If it's not a method, then it lives in S29 Do we have many things that aren't methods? * Should there be a way to extract information about a Rat's numerator/denominator? What methods does a Rat have? I'm also curious about extracting real and imaginary components from Complex. # true(), not(), also methods On? Ctrue is a method on Object (S02:3391), I suspect that Cnot is also (S03:3282). Beyond that, I think that what one would think of as true() or not() are really prefix:true and prefix:not, and not functions in the normal sense. Pm
Re: r25745 - docs/Perl6/Spec
On Sun, Mar 08, 2009 at 09:43:17AM +0100, pugs-comm...@feather.perl6.nl wrote: =item * ws Match whitespace between tokens. =item * space Match a single whitespace character. Hence C ws is equivalent to C space+ . The definitions of ws and space above are incorrect, or at least misleading. ws matches required whitespace between pairs of word characters; it's optional whitespace otherwise. The default definition of ws is something like: token ws { ?before \w ?after \w ! || \s* } It's certainly _not_ the case that ws is equivalent to space+ . To make things a bit quicker for people writing custom versions of ws (which may need to include comment whitespace), the Parrot Compiler Toolkit also provides an optimized ww rule that matches only between a pair of word characters. Then the default definition of ws becomes token ws { !ww \s* } Grammars can change this to things like: token ws { !ww [ \s+ || '#' \h* \n ]* } Pm
Re: r25745 - docs/Perl6/Spec
On Mon, Mar 09, 2009 at 10:32:02AM -0700, jerry gay wrote: To make things a bit quicker for people writing custom versions of ws (which may need to include comment whitespace), the Parrot Compiler Toolkit also provides an optimized ww rule that matches only between a pair of word characters. Then the default definition of ws becomes token ws { !ww \s* } if you need a mnemonic to help you remember what 'ww' means, use 'within word'. this reminds me that pge's ww may be incorrect in its treatment of apostrophe. these characters (['-] by default) are word characters, but i don't think that's been tested, and i don't think it's been implemented, either. A couple of clarifications: - PGE doesn't implement ww by default, because that's not (yet?) part of the spec. It only appears in PCT::Grammar, for people using the Parrot Compiler Toolkit to create languages. - AFAICT, apostrophe and hyphen are not yet word characters in the sense of being members of \w . That is, they're considered to be valid in identifiers, but only when they are immediately preceded by a word character and immediately followed by an alphabetic character. Otherwise they're not part of the identifier. (At least, that's how the current STD.pm reads.) Pm
Re: r25745 - docs/Perl6/Spec
On Mon, Mar 09, 2009 at 10:53:12AM -0700, Larry Wall wrote: : - PGE doesn't implement ww by default, because that's not (yet?) : part of the spec. It only appears in PCT::Grammar, for people : using the Parrot Compiler Toolkit to create languages. I have wanted !ww a number of times, particularly after generic tokens that might or might end in \w. So feel free to spec it. Now done in r25767. I went ahead and removed word and fixed up the wb, ws, space, and block descriptions while I was at it. Pm
Re: r25102 - docs/Perl6/Spec
On Fri, Jan 30, 2009 at 08:30:25AM -0800, Larry Wall wrote: So anyway, just because other languages call it a prelude doesn't mean that we have to. Perl is the tail that's always trying to wag the dog... What is the sound of one tail wagging? For my dog Sally, the sound of one tail wagging is regularly used to indicate that she believes I'm in desperate need of taking her on a walk. Pm