[perl #125555] [NYI] Comparison ops for DateTimes in Rakudo

2018-02-05 Thread Moritz Lenz via RT
Tests added in https://github.com/perl6/roast/commit/ff0472adfc



Re: [perl #130638] [LTA] X::Seq don't say which Seq the exception occurred on

2017-01-25 Thread Moritz Lenz


On 25.01.2017 10:47, Samantha McVey wrote:
> On Wednesday, 25 January 2017 01.45.59 PST you wrote:
>> On Tue, 24 Jan 2017 23:15:32 -0800, samant...@posteo.net wrote:
>> > CODE:
>> > my Seq $thing = (1,3,4).Seq; $thing.iterator; $thing.iterator
>> > 
>> > STDERR:
>> > This Seq has already been iterated, and its values consumed
>> > (you might solve this by adding .cache on usages of the Seq, or
>> > by assigning the Seq into an array)
>> >   in block  at  line 1
>> > 
>> > I have had lines that have multiple sequences on that, and it is very
>> > difficult to know which Seq it was without a nice error.
>> 
>> What would you suggest we do? The point of the Seq iterator is that it 
>> doesn't generally store the old values, so pretty much by definition we 
>> *can't* give more details about the contents of the Seq, and we generally 
>> don't know which variable it's stored in either.
>> 
>> Unless somebody has a good idea on how to improve this, I'd close it as 
>> "sadly won't fix".
>> 
>> Cheers,
>> Mority
>> 
>> 
> 
> I don't want the values of the Seq, I want the name of the variable.

Trying to find the name of a variable (if there is one at all) from the
object is inherently brittle, and has lead to many false positives in
the past (like reporting the name of a parameter from a routine in CORE
somewhere).

-- 
Moritz Lenz
https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/


[perl #130396] [BUG] =:= operation aginst item contextualized object returns incorrect result

2016-12-23 Thread Moritz Lenz via RT
This is not a bug. $b is a container that contains the array @a, so @a !=:= $b.
:
An easy test is assigning to $b, and see if it's reflected in @a:

$ perl6 -e 'my @a = 1,2; my $b = @a.item; $b = 42; say @a'
[1 2]


Re: [perl #130371] [REGRESSION] return in block does not return from sub that is parameterised with that block

2016-12-18 Thread Moritz Lenz
Hi,

On 18.12.2016 15:35, Wenzel Peppmeyer (via RT) wrote:
> # New Ticket Created by  Wenzel Peppmeyer 
> # Please include the string:  [perl #130371]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=130371 >
> 
> 
> my  = { say 'returning from '; return };
> sub returned-from() { say 'enter returned-from'; code; say 'leave 
> returned-from' };
> sub forcing-a-return { returned-from  };
> forcing-a-return;
> 
> # OUTPUT«enter returned-from␤returning from ␤Attempt to return outside 
> of any Routine␤  in block  at  line 1␤␤»
> # expected
> # OUTPUT«enter returned-from␤returning from ␤»
> # this may be a regression caused by a4ca12afa30be4ce5dfc3602f54a5563d069ffa5

I'm pretty sure that's not a bug;  is supposed to be tied to the
lexically outer Routine, and in this example, there is no lexically
outer Routine, so the error message is valid.

Cheers,
Moritz

-- 
Moritz Lenz
https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/


Re: unicode

2016-09-17 Thread Moritz Lenz
Hi,

On 17.09.2016 13:12, MT wrote:

> Searching further I found the ucd2c.pl program in the Moarvm tools 
> directory. This generates the unicode_db.c somewhere else in the rakudo 
> tree. I run this program myself on the Unicode 9.0.0 database and 
> comparing the generated files shows many differences between the one in 
> the rakudo tree and the generated one.

Please make a rakudo spectest with those changes, and if it passes,
submit your patch as a pull request.

> The date found in the file  unicode_db.c file is 2012-07-20 which is 
> about Unicode version 6.1.0

docs/ChangeLog in MoarVM says

+ Updated to Unicode 8

in the section of the 2015.07 release, so it's not that bad :-)

Cheers,
Moritz

-- 
Moritz Lenz
https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/


Re: Inline::Python panda installation fails

2016-07-13 Thread Moritz Lenz

Hi,

On 07/13/2016 11:01 AM, The Holy Ghost wrote:


On linux 2016.04 and windows 2016.01 :

==> Fetching Inline::Python
==> Building Inline::Python
gcc pyhelper.c -Wall -I"/usr/include/python2.7" -L"/usr/lib/python2.7/config" 
-lpython2.7 -shared -o /home/erana/.panda-work/1468400277_1/resources/libraries/libpyhelper.so 
-fPIC -g
pyhelper.c:1:20: fatal error: Python.h: No such file or directory


It seems you do need a Python.h, so a libpython-dev of python-devel or 
so package that includes the header files.


Cheers,
Moritz


Re: [perl #127890] [IMPROVEMENT PROPOSAL] Test.pm6 make subtest multi to take description first

2016-04-13 Thread Moritz Lenz

Hi,

On 04/13/2016 02:52 PM, Zoffix Znet (via RT) wrote:

# New Ticket Created by  Zoffix Znet
# Please include the string:  [perl #127890]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=127890 >


Hey,

I propose we make Test.pm6's `subtest` a multi sub that can also take a Pair. 
The key of the Pair is to be the description of the test and the value is to be 
the codeblock to run.

Test.pm6 has `subtest` sub that lets you group your tests. It takes a code 
block and description, but that description follows AFTER the codeblock, 
following the same pattern as all the other subs the module provides.

The problem is unlike all the other subs, `subtest` takes a codeblock, which 
can get large quickly.
A programmer reading the code has to skip through all the way to the END of the 
codeblock to find
the description and understand what the subtest is testing.

Here's an example of the current way to use subtest:

 subtest {
 my $res= $glot.list;
 ok $res.keys ⊆ , 'return keys match expectations';

 my $expected
 = ;
 for |$res {
 ok .keys ⊆ $expected, 'item keys match expectations';
 }
 }, '.list method';

My proposal, if implemented, would allove the above to be written as:

 subtest '.list method' => {
 my $res= $glot.list;
 ok $res.keys ⊆ , 'return keys match expectations';

 my $expected
 = ;
 for |$res {
 ok .keys ⊆ $expected, 'item keys match expectations';
 }
 };


Why not simply allow two ordinary arguments?

Like this:
subtest 'description', { code here };

Since one of the arguments is always a string or String-alike (probably 
Cool), and the other is always Callable, there shouldn't be any 
ambiguous cases.


All in all I approve of this idea though.

Cheers,
Moritz


Re: [perl #127878] UTF8-C8 + Str.subst either dumps core or corrupt memory

2016-04-12 Thread Moritz Lenz


On 11.04.2016 17:00, Moritz Lenz wrote:
> On 04/11/2016 03:04 PM, Nicholas Clark wrote:
>> On Mon, Apr 11, 2016 at 04:39:59AM -0700, H. Merijn Brand wrote:
>>
>>> In a one-liner:
>>>
>>> $ p6 -e'my$b=Buf.new(61,^2048 .map({256.rand.Int}));my Str 
>>> $u=$b.decode("utf8-c8");$u.=subst(/("a"|"b")/,{"c$0"},:g);'
>>> Segmentation fault
>>>
>>> or (same code)
>>
>> With timotimo's commit from this afternoon:
>>
>> commit 808fd05041b3d846b0a54acc4297299af2a1b71d
>> Author: Timo Paulssen <timona...@perpetuum-immobile.de>
>> Date:   Mon Apr 11 14:05:57 2016 +0200
>>
>>  cope with buffers being too small in re_nfg
>>
>>  fixes a crash when working with utf8-c8 strings.
>>
>>
>> that one liner changes from ASAN barfage to no output.
>> (which means that the SEGV is fixed).
>>
>> That means it's now "tests needed" ?
> 
> It is.
> 
> I'd also be grateful if somebody could provide a deterministic string of 
> numbers that made Rakudo segfault, because I hate having fuzzy/random 
> tests in the test suite.

Turns out that somebody is me :-)

This code coredumps reliably on a not-yet-patched rakudo for me:

use v6;
my @ints = 103, 248, 111, 217, 210, 97;
my $b = Buf.new(@ints);
my Str $u=$b.decode("utf8-c8");
$u.=subst("a","b");

Cheers,
Moritz


> Cheers,
> Moritz
> 


[perl #66820] Null PMC access in find_method() while accessing bound return value from gather/take

2016-03-12 Thread Moritz Lenz via RT
On Sun Jun 21 11:24:57 2009, moritz wrote:
> $ perl6 -e 'my @a := gather {  for 1..3 { take $_; say @a.perl } }; say
> @a.perl'
> Null PMC access in find_method()
> in Main (:1)

Current behavior:

Type check failed in binding; expected Positional but got Seq (?)


If I change it to 'my \a = gather { ... }'

I get

$ ./perl6 -e 'my \a = gather { for 1..3 { take $_; say a.perl } }; say
a.perl'
Seq.new-consumed()
Seq.new-consumed()
Seq.new-consumed()
(1, 2, 3).Seq

Which, IMHO, is sane enough to make this ticket go away.


Re: [perl #127263] Cannot pass a Method object to .^can

2016-01-14 Thread Moritz Lenz

Hi Dave,

On 01/14/2016 07:47 AM, Dave Rolsky (via RT) wrote:

# New Ticket Created by  Dave Rolsky
# Please include the string:  [perl #127263]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=127263 >


If I do a get errors like:

Method object coerced to string (please use .gist or .perl to do that)  in any 
can at gen/moar/m-Metamodel.nqp line 1109
Method object coerced to string (please use .gist or .perl to do that)  in any 
can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that)  in any 
can at gen/moar/m-Metamodel.nqp line 1115
Method object coerced to string (please use .gist or .perl to do that)  in any 
can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that)  in any 
can at gen/moar/m-Metamodel.nqp line 1115
Method object coerced to string (please use .gist or .perl to do that)  in any 
can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that)  in any 
can at gen/moar/m-Metamodel.nqp line 1114

I find it a bit surprising that this doesn't work. I'm not sure if this is 
intentional or not.


The documentation at
https://doc.perl6.org/routine/can calls the parameter $method-name and 
talks about method names, not Method object. Why does it surprise you 
that you when you pass in something that's not a method name, you get 
weird behavior?


Please also read the disclaimers at 
https://doc.perl6.org/language/mop#Power%2C_Convenience_and_Pitfalls


Cheers,
Moritz


Announce: Rakudo Star Release 2015.11

2015-11-28 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to
announce the November 2015 release of "Rakudo Star", a useful and usable
distribution of Perl 6. The tarball for the November 2015 release is
available from .

This Rakudo Star release comes with support for the MoarVM
backend (all module tests pass on supported platforms).

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 2015.11] of the
[Rakudo Perl 6 compiler], version 2015.11 of [MoarVM], plus various
modules, documentation, and other resources collected from the
Perl 6 community.

[release 2015.11]:
https://github.com/rakudo/rakudo/blob/nom/docs/announce/2015.11.md
[Rakudo Perl 6 compiler]: http://github.com/rakudo/rakudo
[MoarVM]: http://moarvm.org/

Some of the new compiler features since the ast Rakudo Star release include:

+ There is now an `infix:<.>` operator that does method calls with slightly
  looser precedence than the postfix unary method call.
+ New operator `infix o` for function composition
+ `fc` for Unicode-correct case folding implemented
+ grep now accepts :k, :v, :kv, :p attributes
+ `Supply.throttle` for rate-limiting
+ Array.push is now used for pushing one element (mostly); Array.append
  exists for pushing multiple values. Same for `unshift`/`prepend`
+ Basic arithmetic operations (`+`, `*`, `-`, `/`) on Range objects
  that shift or scale the end points while maintaining exclusions
+ The v notation now allows alphabetic components: v1.2.beta.  (Incompatible
  because method calls on a version must be protected by \ or () now.)
+ `use v6b+;` notation is now recognized and enforced
+ Many built-in methods that return iterables are now much faster
+ Better error messages when comparing version strings with numbers
+ Several error messages that were lacking line numbers now include them
+ Initial shaped array support
+ `\r\n` (Carriage Return/LineFeed) is now a single (synthetic) grapheme
+ Unicode support adheres to Unicode Annex #29
+ Unicode quotes are now also allowed in regular expressions
+ Improved newline support with "use newline" and updates to IO::Handle
+ Added List.head, List.tail, List.repeated methods
+ Str.encode now allows :replacement parameter for unencodable sequences
+ Str.split now accepts multiple strings to split on
+ New Range.int-bounds returns first/last value for integer ranges
+ Auto-generated meta-ops vivified by referring to them, instead of
executing
+ Illegal assignment of different Numeric values now caught at compile time
+ `` implemented, which returns the routine that `nextsame`
would invoke
+ Many speedups

The Rakudo Perl 6 compiler is now officially in beta for the upcoming
production release around Christmas 2015.

Please note that this release of Rakudo Star is not fully functional
with the
JVM backend from the Rakudo compiler. Please use the MoarVM backend only.

Notable changes in modules shipped with Rakudo Star:

* Bailador: Add MIT License
* DBIish: Improved Windows support
* doc: More documentation; generated HTML is better searchable
* Template::Mustache: Switched from LGPL to Artistic License 2.0
* panda: Default action is no longer `install`; better help messages
* Digest::MD5: Now accepts non-ASCII input (internally encodes as Latin-1)
* LWP::Simple: Support for successful return codes besides 200
* Shell::Command: `which` routine for locating executables
* Updated docs/2015-spw-perl6-course.pdf from Nov 21

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
  * non-blocking I/O (in progress)
  * much of Synopsis 9 and 11

There is an online resource at 
that lists the known implemented and missing features of Rakudo's
backends 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 .

See  for links to much more information about
Perl 6, including documentation, example code, tutorials, reference
materials, specification documents, and other supporting resources. A
Perl 6 tutorial is available as docs/2015-spw-perl6-course.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
, ask on the 
mailing list, or join us on IRC \#perl6 on freenode.


Re: Misunderstanding when usng elems on undefined Array

2015-09-28 Thread Moritz Lenz

Hi,

On 09/25/2015 05:46 PM, mt1957 wrote:

Found the following using Array;

 > my Array $a;
 > say $a.elems;
1
 > $a.push(1)
[1]
 > say $a.perl
[1]
 > say $a.elems
1


 > my Array $a .= new;
[]
 > say $a.elems;
0

Seems that an uninitialized Array reports one element but pushing values
on the array will define the properly. In this case it is important to
initialize.


I know that this can be surprising, but it's actually quite sensible.

If you iterate over the Array type object, you get one iteration:

for Array { .say }

so it makes sense that Array.elems returns 1.

if .push wouldn't autovivify a defined array, thinks like

my %h;
%h.push: $new_value;

couldn't work.

But  the real advise is it use @-sigiled variables when dealing with 
arrays; they don't exhibit such interesting corner cases.


Cheers,
Moritz


Re: [perl #126208] [BUG] Many threads results in data corruption

2015-09-28 Thread Moritz Lenz


On 09/27/2015 11:58 PM, Benjamin Goldberg (via RT) wrote:

# New Ticket Created by  Benjamin Goldberg
# Please include the string:  [perl #126208]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=126208 >


The code at https://gist.github.com/BenGoldberg1/bc39a9a31eaeb733012a creates 
many threads for the task of sorting numbers as they are sent to a channel.  
Roughly twice as many threads are created as there are distinct values.

The output should be a list of random numbers, sorted.

Instead, it produces a error message; changing the number of element to be 
sorted causes the error message to change.  This leads me to conclude that the 
problem is memory corruption of some sort.

One of the error messages was:
Attempt to return outside of any Routine␤  in block  at /tmp/4c1CWudfwj:33


I think this error message is correct

#!/usr/bin/env perl6
use v6;

sub sort-promise ($c) {
   start {
  my @same;
  earliest $c {
 more $c { push @same, $c.receive }
 done $c { return }
  }

You try to return from a routine through a start { } boundary -- I don't 
think that's allowed.



Another error message was:
Cannot send a message on a closed channel␤  in block  at 
/tmp/T9gWZ7YfGJ:33


Can be correct as well. I don't think you wait with the .close until all 
the other tasks are done.



Another error message was:
Cannot receive a message on a closed channel␤  in block  at 
/tmp/rPtHPIxsTw:33


Same here.


Announce: Rakudo Star Release 2015.09

2015-09-26 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm excited to
announce the September 2015 release of "Rakudo Star", a useful and
usable distribution of Perl 6. The tarball for the September 2015
release is available from .

This Rakudo Star release comes with support for the MoarVM backend (all
module tests pass on supported platforms).
Please note that this release of Rakudo Star is not fully functional
with the JVM backend from the Rakudo compiler. Support should be
restored shortly.

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 2015.09] of the [Rakudo Perl 6
compiler], version 2015.09 of [MoarVM], plus various modules,
documentation, and other resources collected from the Perl 6 community.

[release 2015.09]:
https://github.com/rakudo/rakudo/blob/nom/docs/announce/2015.09.md
[Rakudo Perl 6 compiler]: http://github.com/rakudo/rakudo
[MoarVM]: http://moarvm.org/

Some of the new compiler features added to this release include:

* Great List Refactor (GLR) - See http://design.perl6.org/S07.html
* All Deprecations removed in preparation for Christmas release
* Added support for calling into C++ libraries and calling methods on
C++ classes
* New slurpy parameter, +args or +@args, to allow for one-argument style
binding
* New with/orwith/without conditionals allow you to check for .defined
but topicalize to the actual value returned
* New `supply`, `whenever` and `react` blocks for easy reactive programming
* All Unicode digits can now be part of literal numbers
* `val()` and allomorphic types implemented
* Most European quoting styles are now supported
* New $[...] and ${...} constructs allow prefix itemization
* The .gist and .perl methods can now deal with self-referential structures


Notable changes in modules shipped with Rakudo Star:

* All modules fixed to work with GLR where needed
* Panda now includes JSON::Fast and no longer precompiles to byte code
* Terminal::ANSIColor replaces the deprecated Term::ANSIColor
* New Perl 6 tutorial replaces original perl6 book draft

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
  * non-blocking I/O (in progress)
  * much of Synopsis 9 and 11

There is an online resource at 
that lists the known implemented and missing features of Rakudo's
backends 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 .

See  for links to much more information about
Perl 6, including documentation, example code, tutorials, reference
materials, specification documents, and other supporting resources. A
Perl 6 tutorial is available as docs/2015-spw-perl6-course.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
, ask on the 
mailing list, or join us on IRC \#perl6 on freenode.


Re: [perl #126113] [BUG] Cannot bind to &::("CORE")::foo

2015-09-20 Thread Moritz Lenz
On 09/20/2015 09:55 AM, Tobias Leich (via RT) wrote:
> # New Ticket Created by  Tobias Leich 
> # Please include the string:  [perl #126113]
> # in the subject line of all future correspondence about this issue. 
> # https://rt.perl.org/Ticket/Display.html?id=126113 >
> 
> 
> t/spec/S02-names/pseudo.t expects that you can do:
> 
> use Test; plan 1;
> sub f3() { }
> &::("CORE")::none := 
> ok  =:= , 'works';

I'm pretty sure that test is incorrect.

Lexical scopes are read-only after compile time, and &::CORE is a
lexical scope, after all.


Re: Problem documentation and/or compiler

2015-06-18 Thread Moritz Lenz

Hi Marcel,

On 06/18/2015 11:17 AM, mt1957 wrote:

Sorry I've been too fast, It's in the doc. However, why can't I assign
it to a Buf with automatic coercion from utf8 to Buf which is more generic?


The docs are wrong; it should be Blob, not Buf.

I've fixed it in
https://github.com/perl6/doc/commit/ec673618159fc85249c105d76f4157bf76880759

The right place to report errors to the docs is 
https://github.com/perl6/doc/issues/


Cheers,
Moritz


Re: New Logo Design for perl6 modules

2015-06-11 Thread Moritz Lenz

Hi,

On 06/10/2015 02:01 PM, Lin Yo-an wrote:

Hi folks!

I designed a logo for CPAN, and I think it can be used for perl6
modules, don't know if you're interested in it?
https://twitter.com/c9s/status/608549774648692736


Great, I like it!

Is there a high-res version available? What's the license?

Any chance we can get a p5/p6 twin theme (like, one with a butterfly, in 
addition to the one with the camel)?
It would be awesome to have cpan.org or metacpan.org and 
modules.perl6.org with clearly related but distinct art work.


One word of caution: the use of the camel in relation to Perl is a 
trademark by O'Reilly.


Cheers,
Moritz


Re: [perl #125211] Error Function X::Panda needs parens to avoid gobbling block when running panda on JVM, but not on Moar

2015-05-18 Thread Moritz Lenz



On 05/18/2015 04:07 AM, Rob Hoelz (via RT) wrote:

# New Ticket Created by  Rob Hoelz
# Please include the string:  [perl #125211]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org/Ticket/Display.html?id=125211 


The full error message:

===SORRY!===
Function X::Panda needs parens to avoid gobbling block
at bin/panda:21
-- Panda { %failed{$x}.push($_)  say $_ }⏏ };
Missing block (apparently taken by 'X::Panda')
at bin/panda:21
-- anda { %failed{$x}.push($_)  say $_ } ⏏};


Could you please supply a self-contained sample code that triggers this 
error?


Thanks!




Re: [perl #125153] Pod nesting needs some clarity

2015-05-11 Thread Moritz Lenz



On 05/11/2015 02:47 PM, (via RT) wrote:

# New Ticket Created by
# Please include the string:  [perl #125153]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org/Ticket/Display.html?id=125153 


It's not clear which =begin is not terminated here, based on the error.
Maybe '=begin at line 1 not terminated by matching '=end pod' would be a
clearer error statement.


I think the clearest error message would be

Expected =end Documentation to terminate =begin Documentation; found 
=end pod instead.





--cut here--
=begin pod

=begin Documentation

=end pod
--cut here--

===SORRY!=== Error while compiling /home/jgoff/bug.pm
'=begin' not terminated by matching '=end Documentation'
at /home/jgoff/bug.pm:5
-- BOL⏏=end pod
  expecting any of:
  horizontal whitespace
  whitespace

--cut here--
=begin pod

=begin Documentation

=end Documentation
--cut here--
===SORRY!=== Error while compiling /home/jgoff/bug.pm
'=begin' not terminated by matching '=end pod'
at /home/jgoff/bug.pm:6
-- BOL⏏EOL
  expecting any of:
  horizontal whitespace
  whitespace



Re: rakudo Test module: expanding tests considered?

2015-03-24 Thread Moritz Lenz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On 24.03.2015 13:51, Nicholas Clark wrote:
 On Tue, Mar 24, 2015 at 09:44:19AM +0100, Moritz Lenz wrote:
 
 I'd suggest developing those test functions in a separate module,
 and after gathering some experience with it, when can discuss
 putting them into rakudo's Test.pm.
 
 Seems a good plan (for these functions)
 
 However, does Rakudo's lib/Test.pm scale in the way that Perl
 5's Test::* do?
 
 By which I mean, all the (sane) Perl 5 test modules use
 Test::Builder, which means that the test counting, plan
 manipulation (etc) is coherent and co-ordinated, even if you're
 using Test::More, Test::Deep, etc.
 
 
 It doesn't look to me like there's a way to do that (yet) in the
 Perl 6 ecosystem. Am I missing a way to mix in new test functions
 without having to replace/redo the existing ones?

We don't have such a fine API as Test::Builder, but you still can call
Test.pm's ok() from within your own test modules.

Cheers,
Moritz
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlURXrEACgkQT81LMIj/VkQGaQCeLCP2pM0HTlkPTuxkgeeJQsu0
tNEAnjW3PR9mbWTiVhJS+tpc4ueVPXZ1
=QLjU
-END PGP SIGNATURE-


Re: rakudo Test module: expanding tests considered?

2015-03-24 Thread Moritz Lenz
Hi,

On 24.03.2015 00:15, Tom Browder wrote:
 On Mon, Mar 23, 2015 at 5:53 PM, Elizabeth Mattijsen l...@dijkmat.nl wrote:
 On 23 Mar 2015, at 23:50, Tom Browder tom.brow...@gmail.com wrote:
 Question:  Would it be better to submit pull requests for some (or
 all) for the rakudo Test module or start creating a new Test::*
 module?
 Good question.
 What functionality are you currently missing in Test.pm ??
 
 From CPAN Test::Number::Delta:
 
 # Equality test with default tolerance
 delta_ok( 1e-5, 2e-5, 'values within 1e-6');
 
 # Provide specific tolerance
 delta_within( 1e-3, 2e-3, 1e-4, 'values within 1e-4');
 
 # Compare arrays or matrices
 @a = ( 3.14, 1.41 );
 @b = ( 3.15, 1.41 );
 delta_ok( \@a, \@b, 'compare @a and @b' );
 
 # Set a different default tolerance
 use Test::Number::Delta within = 1e-5;
 delta_ok( 1.1e-5, 2e-5, 'values within 1e-5'); # ok
 
 # Set a relative tolerance
 use Test::Number::Delta relative = 1e-3;
 delta_ok( 1.01, 1.0099, 'values within 1.01e-3');
 
 Note that the functions can be used for scalars or suitable arrays
 (and they each have a 'not' version for convenience).
 
 So far I've used the core's 'is_approx' for the 'delta_ok' emulation,
 but 'is_approx' doesn't allow the user to specify tolerances as
 'delta_ok' does.  The ability to specify tolerances would be useful
 for the core 'is_approx' function.

I'd suggest developing those test functions in a separate module, and
after gathering some experience with it, when can discuss putting them
into rakudo's Test.pm.

Cheers,
Moritz


Re: [perl #124108] [BUG] reduce meta-operator fails with 'max' on list larger than 2**15 with MoarVM

2015-03-19 Thread Moritz Lenz



On 03/19/2015 10:14 AM, Nicholas Clark wrote:

On Wed, Mar 18, 2015 at 05:13:54AM -0700, David Hoekman wrote:

Thanks for the concise and interesting bug report.
There might be a whole bunch more things that break in a similar way...


perl6-m -e 'say [max] 1..(1+2**15)'

arg flag is empty in slurpy positional
   in sub infix:max at src/gen/m-CORE.setting:2181
   in sub  at src/gen/m-CORE.setting:20740
   in block unit at -e:1


$ ./perl6-m -Ilib -e 'say [max] 1..(1+2**15)'
ASAN:SIGSEGV
=
==1476==ERROR: AddressSanitizer: SEGV on unknown address 0x0004 (pc 
0x7fa75096588a sp 0x7fffda54e0e0 bp 0x7fffda54e210 T0)
 #0 0x7fa750965889 in flatten_args src/core/args.c:711
 #1 0x7fa75095aff7 in MVM_args_checkarity src/core/args.c:140
 #2 0x7fa750979e30 in MVM_interp_run src/core/interp.c:573
 #3 0x7fa750bf4f8b in MVM_vm_run_file src/moar.c:210
 #4 0x4019bf in main src/main.c:189
 #5 0x7fa750267d5c in __libc_start_main (/lib64/libc.so.6+0x1ed5c)
 #6 0x400fc8 (/home/nicholas/Sandpit/moar-san/bin/moar+0x400fc8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV src/core/args.c:711 flatten_args
==1476==ABORTING

and a non-ASAN build under valgrind reports

==17316==
==17316== Invalid write of size 8
==17316==at 0x4F4D91B: flatten_args (args.c:711)
==17316==by 0x4F4A427: MVM_args_checkarity (args.c:140)
==17316==by 0x4F54721: MVM_interp_run (interp.c:573)
==17316==by 0x5039D5C: MVM_vm_run_file (moar.c:210)
==17316==by 0x401250: main (main.c:189)
==17316==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==17316==
==17316==
==17316== Process terminating with default action of signal 11 (SIGSEGV)
==17316==  Access not within mapped region at address 0x4
==17316==at 0x4F4D91B: flatten_args (args.c:711)
==17316==by 0x4F4A427: MVM_args_checkarity (args.c:140)
==17316==by 0x4F54721: MVM_interp_run (interp.c:573)
==17316==by 0x5039D5C: MVM_vm_run_file (moar.c:210)
==17316==by 0x401250: main (main.c:189)


Is this something to do with P6Int having alternative storage representations?


sounds more like the number of arguments is a signed 16 bit int 
somewhere, and overflows for calls with = 2**15 arguments (which a long 
list flattened into an argument list can cause).


Cheers,
Moritz


Re: [perl #123949] Inconsistent APIs for IO::Socket::Async and Proc::Async

2015-03-04 Thread Moritz Lenz
Hi,

On 27.02.2015 23:57, Elizabeth Mattijsen wrote:
 On 27 Feb 2015, at 17:24, Moritz Lenz (via RT) 
 perl6-bugs-follo...@perl.org wrote:
 
 # New Ticket Created by  Moritz Lenz 
 # Please include the string:  [perl #123949]
 # in the subject line of all future correspondence about this issue. 
 # URL: https://rt.perl.org/Ticket/Display.html?id=123949 
 
 
 Both IO::Socket::Async and Proc::Async have the options to get supplies
 for binary or string data, but there are two inconsitentcies:
 
 1) Proc::Async has methods stdout(:$bin), IO::Socket::Async has
 chars_supply and bytes_supply. There should be some naming consistency here
 
 2) Proc::Async has live supplies, and requires you to set them up before
 starting the process. IO::Socket::Async has on-demand supplies that you
 can get after the fact.
 
 In the interest of a smooth asynchronous experience, we should make them
 more consistent.
 
 I will take that into the newio branch, unless someone beats me to it in nom.

Thanks.

While I'm at it, there are two more inconsistencies between
IO::Socket::Async and IO::Socket::INET:

1. IO::Socket::Async.connect() uses positional arguments for the host
and port, while IO::Socket.:INET.new uses

2. ::Async uses separate .connect and .listen methods, ::INET uses a
.new with a separate :listen argument to distinguish them. (I think I
tend to prefer the separate methods approach).

Cheers,
Moritz


[perl #123758] panda doesn't cope well when projects.json isn't a JSON document

2015-02-08 Thread Moritz Lenz via RT
On Sun Feb 08 04:58:14 2015, pmqs wrote:
 My ISP is currently blocking access to http://ecosystem-
 api.p6c.org/projects.json  returning a HTML document instead, with at
 200 OK.
 
 This makes panda blow up.

FWIW panda bugs are better reported at https://github.com/tadzik/panda/issues

 $ panda
 No such method 'ast' for invocant of type 'Any'
   in sub from-json at
 /home/paul/perl/perl6/rakudo/languages/perl6/lib/JSON/Tiny.pm:51
   in submethod BUILD at
 /home/paul/perl/perl6/rakudo/languages/perl6/lib/Panda/Ecosystem.pm:36
   in method BUILDALL at src/gen/m-CORE.setting:979
   in method bless at src/gen/m-CORE.setting:961
   in method new at src/gen/m-CORE.setting:947
   in sub make-default-ecosystem at
 /home/paul/perl/perl6/rakudo/languages/perl6/lib/Panda/App.pm:39
   in block unit at /home/paul/perl/perl6/rakudo/bin/panda:11
 
 Can panda be made more user-friendly when this happns?

The new error message is:

Cannot parse 
/home/moritz/p6/rakudo/install/languages/perl6/site/panda/projects.json as 
JSON: Unable to parse expression in array; couldn't find final ']' 

(this is an example where I added garbage in front of the closing ']')

Cheers,
Moritz



Announce: Rakudo Star Release 2015.01

2015-02-07 Thread Moritz Lenz
# Announce: Rakudo Star Release 2015.01

## 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 January 2015 release of Rakudo Star, a useful and usable
distribution of Perl 6. The tarball for the January 2015 release is
available from http://rakudo.org/downloads/star/.

This Rakudo Star release comes with support for the MoarVM
backend (all module tests pass on supported platforms) along with
experimental support for the JVM backend (some module tests fail).
Three shipped modules are known to fail on Parrot (zavolaj (NativeCall),
jsonrpc and doc)

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 2015.01.1] of the
[Rakudo Perl 6 compiler], version 7.0.1 of the [Parrot Virtual
Machine], version 2015.01 of [MoarVM], plus various modules,
documentation, and other resources collected from the Perl 6
community.

[release 2015.01.1]:
https://github.com/rakudo/rakudo/blob/nom/docs/announce/2015.01.md
[Rakudo Perl 6 compiler]: http://github.com/rakudo/rakudo
[Parrot Virtual Machine]: http://parrot.org
[MoarVM]: http://moarvm.org/

Some of the new compiler features added to this release include:

+ Many improvements to Java interop for the JVM backend
+ New simple way of creating an object hash: :{}
+ Substitution now supports assignment meta-op, e.g. s[\d+] += 2
+ Many memory and CPU optimizations
+ Supply.for deprecated in favour of Supply.from-list

Changes to modules included in Rakudo Star:

- [Bailador](https://github.com/tadzik/Bailador) handles POST and URL
params separately
- [DBIish](https://github.com/perl6/DBIish) has improved error reporting
on SQLite
- [doc](https://github.com/perl6/doc) ships with much more documentation
- [panda](https://github.com/tadzik/panda) has a new command `installdeps`
- [Pod::To::HTML](https://github.com/perl6/Pod-To-HTML) now supports
callbacks for code areas

Parrot support will likely be suspended or dropped from future Rakudo
and Rakudo
Star releases, starting with the February or March releases.

In the next Rakudo Star release, modules `Math::RungeKutta` and
`Math::Model`
will likely be dropped. They can still be installed with `panda`.

In future, the `nqp::` namespace willl only be available after a declaration
like `use nqp;'.

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 (in progress for the JVM and MoarVM backend)
  * Unicode strings at levels other than codepoints
  * interactive readline that understands Unicode
  * non-blocking I/O (in progress for the JVM and MoarVM backend)
  * much of Synopsis 9 and 11

There is an online resource at http://perl6.org/compilers/features
that lists the known implemented and missing features of Rakudo's
backends 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-compiler@perl.org
mailing list, or join us on IRC \#perl6 on freenode.


Re: [perl #123497] AutoReply: p6doc does not work on OSX (Rakudo * 2014.09)

2015-01-10 Thread Moritz Lenz

On 10.01.2015 12:45, Gabor Szabo wrote:

If I put

#!/usr/bin/env perl6

as the sh-bang of either of those script, they start to work.


That's quite dangerous. Precompiled modules (on which scripts often 
depend) only work with the rakudo that compiled them. If a different one 
is in $PATH before that, the scripts will start to fail with weird errors.


Does #!/usr/bin/env /full/path/to/perl6-m work?

Cheers,
Moritz


Re: [perl #123515] Using for + Supply.list results in high CPU usage

2014-12-29 Thread Moritz Lenz


On 29.12.2014 13:44, Elizabeth Mattijsen wrote:

On 29 Dec 2014, at 03:05, Rob Hoelz (via RT) perl6-bugs-follo...@perl.org 
wrote:

# New Ticket Created by  Rob Hoelz
# Please include the string:  [perl #12351]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org/Ticket/Display.html?id=123515 


See the attached script.  When running the script, CPU usage (as reported by top) is 
very high.supply-cpu-test.p6


Looking deeper into the code, this appears to be caused by the implementation 
of “earliest” (former “winner”), which basically does a Thread.yield():

loop { Thread.yield }

This also eats 100% of one CPU.  Not sure whether this is intended behaviour of 
Thread.yield or not.


yield just tells the scheduler to prefer another thread; if no other 
thread has work to do, it'll re-enter the thread that called yield, 
causing 100% CPU usage.



Having to use Thread.yield in “earliest” may also be sub-optimal.


Agreed.

Cheers,
Moritz


Re: [perl #123048] [JVM] test in S02-names-vars/perl.t fails sporadically

2014-10-27 Thread Moritz Lenz

Hi,

On 10/24/2014 06:16 PM, Christian Bartolomaeus (via RT) wrote:

# New Ticket Created by  Christian Bartolomaeus
# Please include the string:  [perl #123048]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org/Ticket/Display.html?id=123048 


Today I got a failure while spectesting for rakudo.jvm:

Failure summary:
S02-names-vars/perl.rakudo.jvm 84 - .perl on user-defined type roundtrips okay

I investigated and the test in question runs fine most of the time but fails 
only once in a while. The test in question is on the last line of following 
code:

# RT #61918
#?niecza skip Stub code executed
{
 class RT61918 {
 has $.inst is rw;
 has $!priv;
 has $.string = 'krach';

 method init {
 $.inst = [ rand, rand ];
 $!priv = [ rand, rand ].perl;
 }
 }

 my $t1 = RT61918.new();
 my $t1_new = $t1.perl;
 $t1.init;
 my $t1_init = $t1.perl;

 ok $t1_new ne $t1_init, 'changing object changes .perl output';

 # TODO: more tests that show EVAL($t1_init) has the same guts as $t1.
 ok $t1_new ~~ / krach /, 'attribute value appears in .perl output';

 # RT #62002 -- validity of default .perl
 my $t2_init = EVAL($t1_init).perl;
 is $t1_init, $t2_init, '.perl on user-defined type roundtrips okay';
}

To me it looks as if rand (in method init) sporadically generates values 
that don't survive the roundtrip on JVM. I tried to reproduce the failure and eventually came up 
with an example:

$ perl6-j -e 'my $a = 0.219947518065601987e0; say $a.perl; say 
EVAL($a.perl).perl'
0.21994751806560198e0
0.219947518065602e0

Moar and Parrot return less decimal places for $a.perl already:

$ perl6-m -e 'my $a = 0.219947518065601987e0; say $a.perl; say 
EVAL($a.perl).perl'
0.219947518065602e0
0.219947518065602e0

So .perl behaves differently in this case on JVM and Moar/Parrot.

Maybe I'm looking in the wrong direction, but the test failure should not 
occur. I'm going to fudge the test ('skip') for rakudo.jvm.


The better approach is to isolate the user-defined type roundtrips test 
from roundtripping floats with many digits.


So rather remove the rand's, replace them by fixed values, and have 
separate tests for round-tripping 0.21994751806560198e0. Then fudge that 
test for JVM as needed.


Cheers,
Moritz



Re: [perl #122221] Stubbing a parent class breaks instantiating its child from within the parent definition

2014-07-03 Thread Moritz Lenz
On 03.07.2014 13:04, Peter (via RT) wrote:
 # New Ticket Created by  Peter 
 # Please include the string:  [perl #11]
 # in the subject line of all future correspondence about this issue. 
 # URL: https://rt.perl.org/Ticket/Display.html?id=11 
 
 
 23:29 pschm: class A::B {...}; class A::C is A::B { method WHICH { say 
 which } }; class A::B { method inst { return A::C.new } }; my $a = 
 A::B.inst; $a.WHICH
 23:29 camelia rakudo-moar b8a188: OUTPUT«Cannot invoke this object (REPR: 
 Null, cs = 0)␤  in method inst at /tmp/tOJLKN8zrC:1␤  in block  at 
 /tmp/tOJLKN8zrC:1␤␤»

I don't see how that could ever be made to work. At the time that the
child classes' closing bracket is parsed, the class is composed, which
mean its method table (including methods from superclasses) is calculated.

This means at the very least that if you inherit from a stubbed class,
you won't be able to call methods from the parent class.

So the best thing we can do is throw a better error message, at class
inheritance time.

Cheers,
Moritz


Re: [perl #121772] $x ~~ s///;

2014-05-02 Thread Moritz Lenz

On 04/30/2014 05:21 PM, schw...@rt.perl.org wrote:

# New Ticket Created by  Schwenn, Peter
# Please include the string:  [perl #121772]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org/Ticket/Display.html?id=121772 


Designation: Non-Finmeccanica
Dear Perl6'rs

[In short: no variation of   $x ~~ s/...(...)../$0/;   seems to work 
(to substitute any capture).]


With a current Rakudo, I cannot reproduce this:

my $line = bar foo; $line ~~ s/(\w+) \s+ (\w+)/$1 $0/; say $line
# output:
foo bar

So either the bug has been fixed in the mean time (and a Rakudo Star 
release is upcoming today), or you need to produce a runnable piece of 
code (including example data) with which we can replicate your problem.


Cheers,
Moritz


Re: [perl #77350] Calling a token 'any' calls for trouble

2014-04-14 Thread Moritz Lenz


On 04/14/2014 06:11 AM, Alexander Moquin via RT wrote:

On Thu Oct 18 02:13:15 2012, moritz wrote:

The problem is that the $*ACTIONS contextual is set to a type object
(used to be Any, now Mu), so $*ACTIONS.any existed, but caused an error.

commit 0973612366de17d6eab26e975663e63170e5d1d5 eased some of the pain
by switching it from Any to Mu, but the underlying problem is still there.


00:11 Mouq r: grammar A { token TOP { any }; token any { 'foo' | 'bar' } }; 
say A.parse('foo')
00:11 camelia rakudo-parrot 79167a, rakudo-jvm 79167a, rakudo-moar 79167a: 
OUTPUT«「foo」␤ any = 「foo」␤␤»

Closeable with tests


The problem can still be reproduced with method names from class Mu, for 
example 'so':



moritz m: grammar A { token TOP { so }; token so { 'foo' | 'bar' }
 }; say A.parse('foo')
camelia rakudo-moar 07dcb2: OUTPUT«Too many positional parameters
  passed; got 2 but expected 1␤  in method so at
  src/gen/m-CORE.setting:834␤  in any !reduce at
  gen/moar/stage2/QRegex.nqp:759␤  in any !cursor_pass at
  gen/moar/stage2/QRegex.nqp:721␤  in regex so at
  /tmp/4Fzij7cVZH:1…»



Re: using git-bisect on rakudo

2014-03-28 Thread Moritz Lenz


On 03/28/2014 07:13 PM, Siddhant Saraf wrote:
 Hello,
 
 I used to be unable to build nqp-p a month ago or so. Recently, that
 changed, and now parrot + nqp-p builds fine. (rakudo doens't build
 yet, but that is another email)
 
 Now I want to find out which commit fixed things for me. I know how to
 use git-bisect on a single repo to find the commit of interest, but in
 this case, there are three repositories: rakudo, nqp, and parrot. How
 do I find out which commit in which repo fixed things ?
 
 I build parrot  nqp-p the recommended way:
 1. clone rakudo from GitHub
 2. cd rakudo
 3. perl Configure.pl --gen-parrot
 
 
 (I guess the next step 'make' is just to build rakudo, and that parrot
 and nqp-p are built before i invoke 'make' )

That's correct.

To answer your actual question:

if you bisect rakudo, the most reliable way is to clean out rakudo, nqp
and parrot before each build step.

I usually use 'git clean -xdf' for that, which deletes all files that
git doesn't track, but not directories which are git repos again. So
reliable cleaning instructions are

# in the rakudo dir:
git clean -xdf

cd nqp
git clean -xdf
cd ..

cd parrot
git clean -xdf
cd ..


If you run those instructions before each run of rakudo's Configure.pl,
you should be safe.


More sophisticated approaches exist for just bisecting NQP, for example,
which will be faster, but require a bit more care, because NQP's
Configure.pl defaults to a different prefix (and parrot location) than
Rakudo's.

Cheers,
Moritz


Re: [perl #121454] Can't inline complex constraints in multisub signatures

2014-03-19 Thread Moritz Lenz

Hi,

On 03/19/2014 12:45 AM, Darren Duncan wrote:

Damian, Moritz, etc,

It seems to me that the basic problem here is that the vertical bar |
has 2 different meanings (outside rules) depending on context.

When used with type names it produces a union type, while with normal
values such as integer literals it produces a junction value.


No. It's always a Junction. Perl 6 has no union types.

Cheers,
Moritz


Re: [perl #121454] Can't inline complex constraints in multisub signatures

2014-03-19 Thread Moritz Lenz
f'up to p6l, because the ticket doesn't need the rest of the discussion.

On 03/19/2014 10:21 PM, Darren Duncan wrote:
 On 2014-03-19, 1:20 AM, Moritz Lenz wrote:
 On 03/19/2014 12:45 AM, Darren Duncan wrote:
 Damian, Moritz, etc,

 It seems to me that the basic problem here is that the vertical bar |
 has 2 different meanings (outside rules) depending on context.

 When used with type names it produces a union type, while with normal
 values such as integer literals it produces a junction value.

 No. It's always a Junction. Perl 6 has no union types.
 
 Really?  All this time I thought in Perl 6 you could write say:
 
my Int|Str $foo;

You were wrong.

The only way to achieve something comparble is

subset IntStr of Any where Int|Str

but for example for multi dispatch, it matters that not a nominal type
matched, but rather a constraint, so that's a not a great replacement.

 Or otherwise say Int|Str anywhere a type name could go, and then this is 
 saying 
 you accept anything that is a Int or a Str but nothing else there.
 
 Was that never true or was it replaced by something while I wasn't looking?

There was something like that in the specs, but no concept whatsoever of
how that might work. You can't just slap on union types onto an existing
type system, and have it magically work out. In languages like Haskell
where they work fine, they are right at the core of the language.

So the feature was removed years ago, because it's not really implementable.

Cheers,
Moritz


Re: [perl #121454] Can't inline complex constraints in multisub signatures

2014-03-18 Thread Moritz Lenz



On 03/17/2014 05:19 PM, Damian Conway (via RT) wrote:

# New Ticket Created by  Damian Conway
# Please include the string:  [perl #121454]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org/Ticket/Display.html?id=121454 


On the 2014.01 release of Rakudo, this works as expected:

 subset Zero of Int where 0;
 subset One  of Int where 1;

 multi fib (Zero){ 1 }
 multi fib (One) { 1 }
 multi fib (Int $n)  { fib($n-1) + fib($n-1) }

 say fib(3);

And we can then reduce the syntactic load by inlining the constraint:

 multi fib (0)   { 1 }
 multi fib (1)   { 1 }
 multi fib (Int $n)  { fib($n-1) + fib($n-1) }

 say fib(3);

Which also works under 2014.01.

Or we could have optimized the syntax with a junctive constraint instead:

 subset ZeroOne of Int where 0|1;

 multi fib (ZeroOne) { 1 }
 multi fib (Int $n)  { fib($n-1) + fib($n-1) }

 say fib(3);

Which also works under 2014.01.

So then I wanted to use the final syntactic optimization: once again
inlining the constraint:

 multi fib (0|1) { 1 }
 multi fib (Int $n)  { fib($n-1) + fib($n-1) }

 say fib(3);

But that doesn't even compile. :-(
I believe it should.


As I read the specs,

multi fib(0|1) { 1 }

would be short for

multi fib(Junction $ where 0|1) { 1 }

which I believe doesn't do what you want.

Cheers,
Moritz


Re: [perl #121326] comparison numerically with non-numeric fails

2014-02-25 Thread Moritz Lenz


On 02/26/2014 02:48 AM, Will Coleda (via RT) wrote:
 # New Ticket Created by  Will Coleda 
 # Please include the string:  [perl #121326]
 # in the subject line of all future correspondence about this issue. 
 # URL: https://rt.perl.org/Ticket/Display.html?id=121326 
 
 
 Marked as a nom regression, there are todo'd tests
 in S03-operators/comparison.t
 
 {
 class Blue {
 method Numeric() { 3; }
 }
 my $a = Blue.new;
 
 ok +$a == 3, '+$a == 3 (just checking)';
 ok $a == 3, '$a == 3';
 ok $a != 4, '$a != 4';
 nok $a != 3, 'not true that $a != 3';
 
 lives_ok { $a  5 }, '$a  5 lives okay';
 lives_ok { $a = 5 }, '$a = 5 lives okay';
 lives_ok { $a  5 }, '$a  5 lives okay';
 lives_ok { $a = 5 }, '$a = 5 lives okay';
 }
 
 the lives_ok tests die with:
 
 # Cannot call 'Real'; none of these signatures match:
 # :(Mu:U \v: *%_)

I'd argue that the current behaviour is actually correct, and the tests
are wrong.

The background is that method Numeric might return a Complex, which
would be fine for addition, but not for comparison. Thus comparison
operators call .Real and not .Numeric, and there's no such method.

I understand the desire to provide just one method for coercion to a
numeric value, but I can't think of any efficient way to offer such an
API that would be compatible with potentially returning Complex.

Cheers,
Moritz


Re: [perl #79294] [BUG] $*PERLversion should be version of Perl, not version of Rakudo in Rakudo

2014-02-24 Thread Moritz Lenz

On 02/24/2014 09:04 AM, Will Coleda via RT wrote:

On Tue Nov 16 16:15:29 2010, masak wrote:

TheHarlot rakudo: say $*PERL
p6eval rakudo 015d77: OUTPUT«name  rakudo␤version 2010.10-22-
g015d77b␤␤»
TimToady $*PERL should be the Perl version, not the rakudo version
TimToady the rakudo version should be in VM
* masak submits rakudobug


Since this was opened, what was version is now in ver, and version is unset:

03:02  [Coke] r: say $*PERLversion
03:02 +camelia rakudo-parrot e8cea1, rakudo-jvm e8cea1, rakudo-moar e8cea1:
  OUTPUT«(Any)␤»

What version should we declare to make this ticket closable?


Maybe something like '6.2014.02' or '6.preview' or so.

Cheers,
Moritz


Re: Rough cut at shrinking the GC header

2014-02-06 Thread Moritz Lenz
I've imported those changes into the branch 
nwc10/feature/gc-header-shrink which might simply review for somebody 
who feels confident to do it :-)


Cheers,
Moritz

On 02/06/2014 11:52 AM, Nicholas Clark wrote:

Attached is a rough cut at shrinking the GC header.
It's tidier than the working version, but it still has a lot of assert()s in
it, which aren't (yet) removed by the C pre-processor under --optimize
[However, none fail]

I'm also not very happy with adding a couple of non-inline functions:

commit b575e123dfc6ab49639fec28871247b8fe8bdeab
Author: Nicholas Clark n...@ccl4.org
Date:   Wed Jan 29 21:41:26 2014 +0100

 Encapsulate SC access through MVM_sc_{get,set}_{stable,obj}_sc()

 Ideally these would be inline functions.

diff --git a/src/6model/sc.c b/src/6model/sc.c
index 3114bbd..93dc8a5 100644
--- a/src/6model/sc.c
+++ b/src/6model/sc.c
@@ -255,6 +255,16 @@ MVMuint64 MVM_sc_get_object_count(MVMThreadContext *tc, 
MVMSerializationContext
  return sc-body-num_objects;
  }

+/* Gets an object's SC. */
+MVMSerializationContext * MVM_sc_get_obj_sc(MVMThreadContext *tc, MVMObject 
*obj) {
+return obj-header.sc;
+}
+
+/* Gets an STables's SC. */
+MVMSerializationContext * MVM_sc_get_stable_sc(MVMThreadContext *tc, MVMSTable 
*st) {
+return st-header.sc;
+}
+
  /* Sets an object's SC. */
  void MVM_sc_set_obj_sc(MVMThreadContext *tc, MVMObject *obj, 
MVMSerializationContext *sc) {
  MVM_ASSIGN_REF(tc, obj, obj-header.sc, sc);

[snip]

diff --git a/src/6model/sc.h b/src/6model/sc.h
index 7edc67d..e449d17 100644
--- a/src/6model/sc.h
+++ b/src/6model/sc.h
@@ -18,6 +18,8 @@ MVMObject * MVM_sc_get_code(MVMThreadContext *tc, 
MVMSerializationContext *sc, M
  void MVM_sc_set_code(MVMThreadContext *tc, MVMSerializationContext *sc, 
MVMint64 idx, MVMObject *code);
  void MVM_sc_set_code_list(MVMThreadContext *tc, MVMSerializationContext *sc, 
MVMObject *code_list);
  MVMuint64 MVM_sc_get_object_count(MVMThreadContext *tc, 
MVMSerializationContext *sc);
+MVMSerializationContext * MVM_sc_get_obj_sc(MVMThreadContext *tc, MVMObject 
*obj);
+MVMSerializationContext * MVM_sc_get_stable_sc(MVMThreadContext *tc, MVMSTable 
*st);
  void MVM_sc_set_obj_sc(MVMThreadContext *tc, MVMObject *obj, 
MVMSerializationContext *sc);
  void MVM_sc_set_stable_sc(MVMThreadContext *tc, MVMSTable *st, 
MVMSerializationContext *sc);
  MVMSerializationContext * MVM_sc_find_by_handle(MVMThreadContext *tc, 
MVMString *handle);


but for now I needed them to hang the assertions off that prove that I'm not
doing anything (*too*) stupid.

Preliminary results [ie 1 run, on a shared machine :-)] suggests that it
reduces RSS size for compiling the setting by 4.8% (roughly what I expected)
and seemingly CPU time by 11% (more than I expected, but I guess all those L2
cache misses now saved were costing us)

Not tested on any 32 bit platform yet.

Not sure what to do next, but currently I'm somewhat sleep deprived after a
long night, to the point of not even being reliably able to operate a kettle,
so there may be errors in this.

Nicholas Clark



Re: [perl #121072] [PATCH] Use the git protocol instead of https, as the build is breaking in systems where curl-devel packages are not installed(Or more importantly can't be installed, due to various

2014-01-24 Thread Moritz Lenz
On 01/24/2014 05:15 PM, Will Coleda via RT wrote:
 On Thu Jan 23 22:11:10 2014, arafatkam...@gmail.com wrote:
 
 
 There are other situations where *only* http connections are allowed, and git 
 connections are not (corporate firewalls). I'd like to have some discussion 
 here before it gets applied.

I've started a discussion here:

https://github.com/perl6/nqp/pull/153

Cheers,
Moritz


Announce: Rakudo Perl 6 compiler, Development Release #71 (Advent)

2013-12-20 Thread Moritz Lenz

On behalf of the Rakudo development team, I'm happy to announce the
December 2013 release of Rakudo Perl #71 Advent. Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine and the Java Virtual
Machine. The tarball for this release is available from
http://rakudo.org/downloads/rakudo/.

Please note: This announcement is not for the Rakudo Star
distribution[^1] --- it's announcing a new release of the compiler
only.  For the latest Rakudo Star release, see
http://rakudo.org/downloads/star/.

The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group. The December 2013 release is
code-named after Advent, the non-geographical group which fits this time of
year.

Some of the changes in this release are outlined below:

+ The Whatever Star now works inside chain operators like comparisons
+ Private attributes from roles are now visible in the classes they apply to
+ Use invokedynamic in some places on the JVM.
+ Memory improvements in ListIter
+ Faster method List.combinations
+ Simple lookahead assertions in regexes are optimized
+ Regexes do less superfluous scanning

These are only some of the changes in this release. For a more
detailed list, see docs/ChangeLog.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Elizabeth Mattijsen, Timo Paulssen, Jonathan Worthington, Moritz Lenz, 
Tobias Leich, Larry Wall, Carl Mäsak


If you would like to contribute, see http://rakudo.org/how-to-help,
ask on the perl6-compiler@perl.org mailing list, or ask on IRC
\#perl6 on freenode.

The next release of Rakudo (#72), is scheduled for January 23, 2014.
A list of the other planned release dates and code names for future
releases is available in the docs/release_guide.pod file. A Rakudo
development release typically occurs a few days (often two) after the
third Tuesday of each month.

On behalf of the development team, I encourage you to try the new release,
step out of your comfort zone, and get a library card.

[^1]: What's the difference between the Rakudo compiler and the Rakudo
Star distribution?

The Rakudo compiler is a compiler for the Perl 6 language.
Nothing else.

The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, the most recent
incarnation of the Using Perl 6 book, and other software that can
be used with the Rakudo compiler to enhance its utility.  Rakudo Star
is meant for early adopters who wish to explore what's possible with
Rakudo Perl 6 and provide feedback on what works, what doesn't, and
what else they would like to see included in the distribution.


Rakudo Star 2013.11 released

2013-11-24 Thread Moritz Lenz

## 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 November 2013 release of Rakudo Star, a useful and usable
distribution of Perl 6. The tarball for the November 2013 release is
available from http://rakudo.org/downloads/star/. 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 2013.11] of the
[Rakudo Perl 6 compiler], version 5.9.0 of the [Parrot Virtual
Machine], plus various modules, documentation, and other resources
collected from the Perl 6 community.

[release 2013.11]:
https://github.com/rakudo/rakudo/blob/nom/docs/announce/2013.11.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:

+ Order::Increase/Decrease are deprecated.  Please use Order::Less/More.
+ Leading whitespace is ignored for :sigspace
+ Better null pattern detection in regexes
+ improved run()/shell(), these return Proc::Status-objects now
+ The gethostname function implemented
+ Performance optimization: unfold junctions in 'when' clauses

This release also contains a range of bug fixes, improvements to error
reporting and better failure modes.

Please note that this release of Rakudo Star does not support the JVM
backend from the Rakudo compiler. While the JVM backend mostly 
implements the same features as the Parrot backend, many bits are still 
missing, most prominently the native call interface.

We hope to provide a JVM-based Rakudo Star release soon.

The following notable 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:


  * All unary hyper ops currently descend into nested arrays and
hashes. In the future, those operators and methods that are
defined nodal will behave like a one-level map.

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 (in work for the JVM backend)
  * Unicode strings at levels other than codepoints
  * interactive readline that understands Unicode
  * non-blocking I/O
  * much of Synopsis 9 and 11

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-compiler@perl.org
mailing list, or join us on IRC \#perl6 on freenode.


Announce: Rakudo Star Release 2013.09

2013-09-26 Thread Moritz Lenz

## 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 September 2013 release of Rakudo Star, a useful and usable
distribution of Perl 6. The tarball for the September 2013 release is
available from http://rakudo.org/downloads/star/. 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 2013.09] of the
[Rakudo Perl 6 compiler], version 5.5.0 of the [Parrot Virtual
Machine], plus various modules, documentation, and other resources
collected from the Perl 6 community.

[release 2013.09]:
https://github.com/rakudo/rakudo/blob/nom/docs/announce/2013.09.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:

+ candidate argument to bless removed (per spec change)
+ @a.VAR.name and %h.VAR.name implemented
+ The $var.++ and $var.() syntaxes work
+ basics of tr/// implemented
+ Sets/Bags/KeySet/KeyBag now up to spec, except for the empty set 
symbol '∅'


This release also contains a range of bug fixes, improvements to error
reporting and better failure modes.

Please note that this release of Rakudo Star does not support the JVM
backend from the Rakudo compiler. While the JVM backend mostly implements
the same features as the Parrot backend, many bits are still missing,
most prominently the native call interface.
We hope to provide a JVM-based Rakudo Star release soon.

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 *IN THE NEXT RELEASE* of Rakudo
Star. Both at_pos and at_key will remain methods.

  * All unary hyper ops currently descend into nested arrays and
hashes. In the future, those operators and methods that are
defined nodal will behave like a one-level map.

  * The Str.ucfirst builtin is deprecated; it will be replaced by
Str.tc.  In the next Rakudo Star release, use of Str.ucfirst will 
actually

generate a warning upon first usage.

  * 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.

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 and 11

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-compiler@perl.org
mailing list, or join us on IRC \#perl6 on freenode.


Rakudo Star 2013.08 released

2013-08-24 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to
announce the August 2013 release of Rakudo Star, a useful and usable
distribution of Perl 6. The tarball for the August 2013 release is
available from http://rakudo.org/downloads/star/. 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 2013.08] of the
[Rakudo Perl 6 compiler], version 5.5.0 of the [Parrot Virtual
Machine], plus various modules, documentation, and other resources
collected from the Perl 6 community.

[release 2013.08]:
https://github.com/rakudo/rakudo/blob/nom/docs/announce/2013.08.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:

* `is default` traits on variables are now implemented
* assigning Nil restores the default value
* `Buf` is now a role, and Buf objects are immutable.
* `printf` now correctly handles big integers
* fixed handling of indented heredocs
* `dir()` is now lazy

This release also contains a range of bug fixes, improvements to error
reporting and better failure modes.

Please note that this release of Rakudo Star does not support the JVM
backend from the Rakudo compiler. While the JVM backend mostly implements
the same features as the Parrot backend, many small IO bits are still
missing, rendering some crucial parts like the module installer unsable.
We hope to provide a JVM-based Rakudo Star release soon.

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.

  * All unary hyper ops currently descend into nested arrays and
hashes. In the future, those operators and methods that are
defined nodal will behave like 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.

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-compiler@perl.org
mailing list, or join us on IRC \#perl6 on freenode.


Rakudo Perl 6 compiler, Development Release #67 (Bicycle)

2013-08-22 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm proud to announce the
August 2013 release of Rakudo Perl #67 Bicycle. Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
http://www.parrot.org) and the Java Virtual Machine. The tarball for
this release is available from http://rakudo.org/downloads/rakudo/.

Please note: This announcement is not for the Rakudo Star
distribution[^1] --- it's announcing a new release of the compiler
only.  For the latest Rakudo Star release, see
http://rakudo.org/downloads/star/.

The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group. The August 2013 release is
code-named after Bicycle.pm, probably the Perl Mongers group with the
coolest t-shirts.

Some of the changes in this release are outlined below:

+ is default, is dynamic, of and will traits on variables
+ assigning Nil restores the default value
+ CALLER::$var now only works on dynamic variables, as per spec.
+ improvements to concurrency/parallelism support, including Channel,
  select, KeyReducer and basic asynchronous file reading (JVM only)
+ once phaser implemented
+ reimplementation of Buf as a role, and addition of Blob and other
  sized Buf/Blob related types
+ ConfigureJVM.pl now takes --gen-nqp, easing the Rakudo on JVM build
+ printf now correctly handles big integers

These are only some of the changes in this release. For a more
detailed list, see docs/ChangeLog.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Elizabeth Mattijsen, Jonathan Worthington, Moritz Lenz, Donald Hunter,
Tobias Leich, Timo Paulssen, Solomon Foster, Tadeusz Sośnierz, Marton
Papp, ivanoff, TimToady, Mouq, Patrick R. Michaud, awwaiid

If you would like to contribute, see http://rakudo.org/how-to-help,
ask on the perl6-compiler@perl.org mailing list, or ask on IRC
\#perl6 on freenode.

The next release of Rakudo (#68), is scheduled for September 19, 2013.
A list of the other planned release dates and code names for future
releases is available in the docs/release_guide.pod file. In
general, Rakudo development releases are scheduled to occur soon after
each Parrot monthly release.  Parrot releases the third Tuesday of
each month.

On behalf of the development team, I encourage you to try the new release,
to live life to its fullest, to cherish each moment, and to have fun.


[^1]: What's the difference between the Rakudo compiler and the Rakudo
Star distribution?

The Rakudo compiler is a compiler for the Perl 6 language.
Nothing else.

The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, the most recent
incarnation of the Using Perl 6 book, and other software that can
be used with the Rakudo compiler to enhance its utility.  Rakudo Star
is meant for early adopters who wish to explore what's possible with
Rakudo Perl 6 and provide feedback on what works, what doesn't, and
what else they would like to see included in the distribution.


Re: [perl #118053] cannot specify optional positional with Mu as default

2013-05-19 Thread Moritz Lenz
On 05/19/2013 06:41 PM, Elizabeth Mattijsen (via RT) wrote:
 # New Ticket Created by  Elizabeth Mattijsen 
 # Please include the string:  [perl #118053]
 # in the subject line of all future correspondence about this issue. 
 # URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118053 
 
 
 [18:35:53] lizmatr: sub a ($a=Mu) { }; a
 [18:35:54] +camelia  rakudo 9c5650: OUTPUT«Nominal type check failed for 
 parameter '$a'; expected Any but got Mu instead␤  in sub a at 
 /tmp/IvMlnzFJOY:1␤  in block  at /tmp/IvMlnzFJOY:1␤␤»
 [18:36:18] lizmatexpected Any?  but but, I specified Mu as the default

Any is the default type constraint if you specify none; So you specify a
default that doesn't pass the type constraint, and it dies when you
don't specify a value.

If you want it to be able to receive a Mu, you have to add a type
constraint:

sub a(Mu $a = Mu) { }; a;

or simply

sub a(Mu $a?) { }; a;

So, not a bug.

Cheers,
Moritz


Re: [perl #117235] [BUG] Deep-cloned array loses its original content on .unshift in Rakudo

2013-03-21 Thread Moritz Lenz

On 03/20/2013 10:37 PM, Patrick R. Michaud wrote:

On Wed, Mar 20, 2013 at 12:41:41PM -0700, Carl Mäsak wrote:

# New Ticket Created by  Carl Mäsak
# Please include the string:  [perl #117235]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=117235 

masak just found my heisenbug :)
masak yeah, this is a weird one.
diakopter run it?
masak rn: my $c = [[1]].map({ [ @$_ ] }); $c.push( 42 ); say $c.perl
p6eval rakudo 9be4cc, niecza v24-35-g5c06e28: OUTPUT«([1], 42).list.item␤»
masak rn: my $c = [[1]].map({ [ @$_ ] }); $c.unshift( 42 ); say $c.perl
p6eval rakudo 9be4cc: OUTPUT«(42,).list.item␤»
p6eval ..niecza v24-35-g5c06e28: OUTPUT«(42, [1]).list.item␤»
* masak submits rakudobug
masak rn: my $c = [[1], [2], [3]].map({ [ @$_ ] }); $c.unshift( 42
); say $c.perl
p6eval niecza v24-35-g5c06e28: OUTPUT«(42, [1], [2], [3]).list.item␤»
p6eval ..rakudo 9be4cc: OUTPUT«(42,).list.item␤»

Niecza is right throughout, of course. The .unshift method adds
elements; it doesn't remove them.


The problem is apparently with sink context, not .unshift.  I have a temporary
fix in mind, but can't get to it until Wednesday night or Thursday night.

20:26 pmichaud I wonder if the problem is related to sink context.
20:26 pmichaud r: my $c = [[1],[2],[3]].map( { $_ } ); $c.unshift(42).say
20:26 p6eval rakudo 9be4cc: OUTPUT«42 1 2 3␤»
20:26 pmichaud $c.unshift(42); is being evaluated in sink context.
20:26 moritz that might be it
20:27 pmichaud r: my $c = [[1],[2],[3]].map( { $_ } ); $c.unshift(42).sink;  
say $c.perl;
20:27 p6eval rakudo 9be4cc: OUTPUT«(42,).list.item␤»
20:27 pmichaud there ya go.
20:27 moritz niecza doesn't implement sink context
20:27 masak huh.
20:28 pmichaud r: my $c = [[1],[2],[3]].map( { $_ } ); $c.sink;  say $c.perl;
20:28 p6eval rakudo 9be4cc: OUTPUT«().list.item␤»
20:29 moritz pmichaud: c4083c42f2e63c97254b7a215a858913c4ff4a44 is the 
relevant merge commit
20:29 pmichaud golfed.


This patch works in this particular case:

diff --git a/src/core/List.pm b/src/core/List.pm
index 84f7eff..964d6f4 100644
--- a/src/core/List.pm
+++ b/src/core/List.pm
@@ -379,8 +379,8 @@ my class List does Positional {
 $val;
 }

-method sink() {
-self.gimme(*, :sink);
+method sink(\SELF:) {
+SELF.gimme(*, :sink) unless nqp::iscont(SELF);
 Nil;
 }
 }


But of course it's not a real fix. Should I apply it?

Cheers,
Moritz


Re: [perl #117235] [BUG] Deep-cloned array loses its original content on .unshift in Rakudo

2013-03-21 Thread Moritz Lenz
On 03/21/2013 01:40 PM, Patrick R. Michaud wrote:
 On Thu, Mar 21, 2013 at 08:49:42AM +0100, Moritz Lenz wrote:
 -method sink() {
 -self.gimme(*, :sink);
 +method sink(\SELF:) {
 +SELF.gimme(*, :sink) unless nqp::iscont(SELF);
  Nil;
  }
  }
 
 
 But of course it's not a real fix. Should I apply it?
 
 I think I prefer
 
 method sink(\SELF:) {
 SELF.gimme(*) unless nqp::iscont(SELF);
 Nil;
 }
 
 because I'm not entirely certain that :sink is safe in
 all cases (and it may go away anyway).

Not using :sink isn't safe either:


Test Summary Report
---
t/spec/S04-statements/next.rakudo   (Wstat: 0 Tests:
12 Failed: 2)
  Failed tests:  8-9
t/spec/S12-introspection/walk.t (Wstat: 0 Tests:
11 Failed: 2)
  Failed tests:  6-7

They go away when keeping the :sink.

Cheers,
Moritz


Re: [perl #117147] doesnt compile under mac 10.8.3

2013-03-14 Thread Moritz Lenz

On 03/13/2013 03:07 PM, herbert breunung (via RT) wrote:

# New Ticket Created by  herbert breunung
# Please include the string:  [perl #117147]
# in the subject line of all future correspondence about this issue.
# URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=117147 


error msg:

http://pastebin.com/35N6aaN8
thanks a lot,keep on the goodherbert


The interesting part:

/Users/lichtkind/Perl/six/rakudo/install/bin/parrot  -o 
blib/Perl6/Actions.pbc src/gen/perl6-actions.pir

Cannot open output file blib/Perl6/Actions.pbc

Have you checked that your disc isn't full?

Cheers,
Moritz


Announce: Rakudo Star 2013.02 released

2013-02-24 Thread Moritz Lenz

On behalf of the Rakudo and Perl 6 development teams, I'm happy to
announce the February 2013 release of Rakudo Star, a useful and
usable distribution of Perl 6.  The tarball for the  February 2013
release is available from http://rakudo.org/downloads/star/.
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 2013.02.1 [0] of the
Rakudo Perl 6 compiler [1], version 4.10.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:

* Did you mean ... suggestions for symbol-not-found errors

* Compile-time optimization of some cases of junctions in boolean context

* IO::Socket.get now works again with non-ASCII characters

* constant folding for routines marked as 'is pure'

* natively typed variables and better error reporting in the REPL

* speed up eqv-comparison of Bufs

* warnings for useless use of (some) literals, variables and constant
  expressions in sink context


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 being removed
or changed as follows:

* .gist on a type object will return '(Typename)' instead of 'Typename()'.
  If you want to get the class name alone, continue to use $obj.^name

* 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 ?-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-compiler@perl.org
mailing list, or join us on IRC #perl6 on freenode.

[0] https://github.com/rakudo/rakudo/blob/nom/docs/announce/2013.01
[1] http://github.com/rakudo/rakudo
[2] http://parrot.org/


Re: Temporal / delta spec

2013-02-19 Thread Moritz Lenz

Hi Carl,

On 02/19/2013 02:03 PM, Carl Franks wrote:

S32/Temporal says a DateTime object can be maniplated like so:
 $dt.delta(44, minutes);

Rakudo's core/Temporal.pm contains this:

 my enum TimeUnit (
 :second(1), :seconds(2),
 :minute(3), :minutes(4),
 [snip]
 );

which is used in the signature of both DateTime and Date's delta methods:
 method delta($amount, TimeUnit $unit) {
which I think means delta() can't be called outside of the scope of
the Temporal.pm file.


TimeUnit is accessible outside of this file, because it is part of the 
setting, and the setting forms the outer lexical scope for all 
user-space programs.



If I try running the synopsis example, I get the following error:
 Undeclared routine: minutes used at line 1


Works fine here:

mlenz@mlenz-workstation:~/p6/rakudo$ ./perl6 -e 'say 
~DateTime.now.delta(4, hours)'

2013-02-19T18:20:34Z


The test files
S32-temporal/Date.t and
S32-temporal/DateTime.t
both die on the delta tests.


They work fine here. The only explanation that I can find for this 
discrepancy between our systems is that your build of Rakudo might be 
too old.


What version of Rakudo are you using? (try running perl6 --version)


Rather than export those 14 keys into the global namespace, would it
make more sense for the spec to be something more like this:
 $dt.delta( :minute(44) );
using the same argument conventions as DateTime.new() ?


I belive Carl Mäsak is better qualified to answer this question, since 
he changed the specs (there used to be a .truncated-to( :minutes ) or 
so), but here are two interesting points:


1) while every user-facing program does see those constants, they can 
easily redefined in any inner scope, so namespace pollution isn't too 
much of a problem


2) Adding deltas of time onto a given point of time is not commutative. 
For example First adding a month and then a day can be give you a 
different result than first adding a day and then a month. But named 
arguments are unordered by nature, which makes them a poor fit for 
non-commutative operations.


Cheers,
Moritz


Re: [perl #116196] min does not work properly on array of array

2012-12-28 Thread Moritz Lenz
On 12/27/2012 10:22 PM, Patrick R. Michaud wrote:
 On Mon, Dec 24, 2012 at 09:16:28PM -0800, Tin Y Pang wrote:
 in rakudo 2012.11, min is not functioning properly with Z
 
 ./perl6 -e 'my @a = ([0, -20, 0], [0, -19, -1], [-1,
 -18, 0], [0, -17, 1], [1, -16, 0], [0, -15, -1],
 [0, -14, 1], [1, -13, 0]); say [Zmin] @a'
 
 gives -1 -13 -1
 expect -1 -20 -1
 
 
 Note that -13 min -20  is -13:
 
  say -13 min -20
 -13
  say -13 min -20
 -20
 
 I'm not sure I'm understanding the example above, but at first glance
 it looks to me as though Rakudo is correct here.

It is. If you want numeric comparison, feed numbers, not strings, to min
(or Zmin).

Cheers,
Moritz


[perl #77856] [BUG] LTA error message for mistaken uses of '.' for concatenation in Rakudo

2012-12-13 Thread Moritz Lenz via RT
Thanks, I've applied your patch, with a small modification:

instead of
+token infix:sym.{ '.' [\]\)\},:\s\$']  
I've used sym, as all the other operators do:
+token infix:sym.{ sym [\]\)\},:\s\$']  

 I'm wondering, if a testcase should be written to check for a helpful 
 error message? Would this kind of thing go in t/spec somehow?

I've added one to t/spec/S32-exceptions/misc.t that checks for X::Obsolete.

As for the other one, the proper way to test it is to change it to a
typed exception, and check for the type.

Cheers,
Moritz


Rakudo Star 2012.11 released

2012-11-28 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm happy to
announce the November 2012 release of Rakudo Star, a useful and
usable distribution of Perl 6.  The tarball for the November 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.11 [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:

* heredocs

* quote adverbs (like q:w//)

* implemented precedence related traits (equiv, looser, tighter, assoc)

* Perl 6 grammar NFAs are pre-computed, saving some work on each
  invocation; this shaved around 10% off the time needed to run the
spectests

* regexes and quotes have better support for user-selected delimiters

* FIRST/NEXT/LAST can now be used in all types of loop (previously
  limited to for)

* several fixes related to module precompilation. This should make working
  with larger code bases much less painful.

This release also contains a range of performance improvements, 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 being removed
or changed as follows:

* at present, a reference to an foo that does not exist evalutes to Nil.
  This will become a CHECK-time failure, in line with STD.

* Unary hyper ops currently descend into nested arrays and hashes.
  This will change to make them equivalent to a one-level map.

* ~/.perl6/lib will go away from the default include path (@*INC).
  Instead %*CUSTOM_LIB now holds paths to four library locations:
  perlRakudo installs its core modules here
  vendor  OS-level package managers should install their modules here
  sitefor local module installations (e.g. with panda or ufo)
  homelike site, but always under the user's home directory.
  fallback if site isn't writable.

* 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 ?-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-compiler@perl.org
mailing list, or join us on IRC #perl6 on freenode.

[0] https://github.com/rakudo/rakudo/blob/nom/docs/announce/2012.11
[1] http://github.com/rakudo/rakudo
[2] http://parrot.org/


Announce: Rakudo Perl 6 compiler development release #55 (Frankfurt)

2012-08-23 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm glad to announce the
August 2012 release of Rakudo Perl #55 Frankfurt. Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
http://www.parrot.org). The tarball for this release
is available from http://github.com/rakudo/rakudo/downloads.

Please note: This announcement is not for the Rakudo Star
distribution[*] -- it's announcing a new release of the compiler only.
For the latest Rakudo Star release, see
http://github.com/rakudo/star/downloads.

The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group. The August 2012 release is
code-named after Frankfurt.pm, the group that hosted this year's
YAPC::Europe conference in Frankfurt am Mein.

This release brings a massive amount of changes; some of them are
outlined below:

- Memory usage of build stage is reduced by 35% - 40%
- Sigilless variables in signatures (prefixed by | or \)
- Blocks that declare variables don't turn into hash constuctors anymore
- Better error reporting for traits
- -- ReturnType in signatures and prefix type constraints of routine
  return types are now honored
- Circularities in module loading are now detected
- Improvements in inliner, which allow it to inline a wider
  range of routines

Some features have been deprecated:

- Parameters preceeded by a | or \ may not have a sigil anymore.
  sub f(\$x) { say $x }
  must be changed to
  sub f(\x) { say x }
  Usage of \$x will unconditionally warn in 2012.09 and be removed in
2012.10

- 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 in 2012.09

- The LAZY statement prefix will be removed in 2012.09. It was a non-specced
  experiment and did not work out well.

This is only a small peek at the changes in this release. For a more
detailed list, see docs/ChangeLog.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Jonathan Worthington, Moritz Lenz, Arne Skjærholt, Geoffrey Broadwell,
Will Coke Coleda, Tadeusz Sośnierz, Patrick R. Michaud, Felix Herrmann,
Carl Mäsak, kboga, thou, Brian Gernhardt, Stefan O'Rear, GlitchMr,
ChoHag, Larry Wall and lumi_

If you would like to contribute, see http://rakudo.org/how-to-help,
ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6
on freenode.

The next release of Rakudo (#56) is scheduled for September 20, 2012. A
list of the other planned release dates and code names for 2012 is
available in the docs/release_guide.pod file. In general, Rakudo
development releases are scheduled to occur soon after each Parrot
monthly release. Parrot releases the third Tuesday of each month.

On behalf of the development team, I encourage you to try the new release,
to live life to its fullest, to cherish each moment, and to have fun.

[*] What's the difference between the Rakudo compiler and the Rakudo
Star distribution?

The Rakudo compiler is a compiler for the Perl 6 language.
Nothing else.

The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, the most recent incarnation of the Using
Perl 6 book, and other software that can be used with the Rakudo
compiler to enhance its utility.  Rakudo Star is meant for early
adopters who wish to explore what's possible with Rakudo Perl 6 and
provide feedback on what works, what doesn't, and what else they
would like to see included in the distribution.


Re: [perl #114388] LAT error when using s[] = rea

2012-08-04 Thread Moritz Lenz


On 08/04/2012 10:38 AM, Jimmy Zhuo (via RT) wrote:
 # New Ticket Created by  Jimmy Zhuo 
 # Please include the string:  [perl #114388]
 # in the subject line of all future correspondence about this issue. 
 # URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114388 
 
 
 JimmyZ_   r: s[ea] = rea; .say
 p6evalrakudo 1f662c: OUTPUT«No such method 'subst' for invocant of 
 type 'Any'␤ in block at /tmp/htGuR5us8T:1␤␤»

What would you expect?
The spec says that s[] desugars to a call to 'subst', so I consider it
correct. We could improve the error, but what should it say?

 JimmyZ_   r: $_ = ; s[ ] = rea; .say
 p6evalrakudo 1f662c: OUTPUT«rea␤»
 JimmyZ_   r: $_ = ; s[] = rea; .say
 p6evalrakudo 1f662c: OUTPUT«===SORRY!===␤Unrecognized regex 
 metacharacter ] (must be quoted to match literally) at line 2, near  = 
 \rea\; ␤»
 JimmyZ_   std: $_ = ; s[ ] = rea; .say
 p6evalstd f43a358: OUTPUT«===SORRY!===␤Null pattern not allowed at 
 /tmp/VK1jegzuR7 line 1:␤-- $_ = ; s[ ⏏] = rea; .say␤ expecting 
 quantifier␤Parse failed␤FAILED 00:00 43m␤»

I'm pretty sure we have a separate ticket for that.

Cheers,
Moritz


Re: adding line numbers to Test.pm failures

2012-07-22 Thread Moritz Lenz
Hi Gabor,

On 07/22/2012 10:44 PM, Gabor Szabo wrote:
 when something fails Test::More of Perl 5 can tell me which line in
 the test file it was called.
 
 I see the Backtrace module could supply this information.
 The question if it would be ok if I tried to add this to the Test.pm module?

I'd appreciate that.

However note that Backtrace gives you an unfiltered, low-level backtrace
-- probably not what you want. (The reason is simply that filtering the
backtrace is rather error-prone, so we need to make the raw data
available somehow. In retrospect I could have found a better design for
that...)

Anyway, a filtered, much nicer backtrace is being calculated in method
nice in src/core/Backtrace.pm just before 'return @frames.join' in the
@frames variables -- it's just not exposed to the user space. Feel free
to factor that into a separate method, so that method nice reduces to
self.filtered.join or so.

You might or might not want to check $frame.code.package to see if
you're still in Test.pm -- I don't know what's the best way to make this
work for test functions not from Test.pm (for example Test::Util in the
roast repo has additional test functions; but catering to the core test
functions would already be a big plus).

Cheers,
Moritz


Re: a method with the name of an attribute creates infinite loop

2012-07-13 Thread Moritz Lenz

Am 13.07.2012 09:07, schrieb Gabor Szabo:

Oh, once I found the problem, I just renamed my method. That's ok.
The thing is that it would be nice if Rakudo caught this and told me about it
as I think I am not the last one to make this error.


Well, the ability to create custom accessors is a feature too.

I think a big part of the problem is how we teach this stuff.
Starting from 'has $.x; makes a public attribute' is wrong. The better 
approach is 'has $!x; makes a private attribute, and has $.x; gives you 
the private attribute *and* the accessor'.


I'll try to write some sensible class/object documentation for p6doc.

Cheers,
Moritz


Re: accepting incorrect syntax?

2012-07-11 Thread Moritz Lenz

Am 11.07.2012 09:55, schrieb Gabor Szabo:

I wonder if the first one is a bug:


use v6;
my @x = (
{ a = 1}
{b = 2 }
);
say @x.perl;

prints  Array.new({b = 2})


This is actually correct. It parses as

my @x = ( {a = 1}; {b = 2} );

Which is roughly the same as

my @x = ( do {  {a = 1}; {b = 2} });

In general, a semicolon can be omitted after a closing bracket before 
the end of the line. That's why you don't need a semicolon after


if $condition {
   say 'something';
}



Almost the same code:

use v6;
my @x = (
{ a = 1} {b = 2 }
);
say @x.perl;

===SORRY!===
Malformed initializer


Niezca has a better error message:

Unexpected block in infix position (two terms in a row, or previous 
statement missing semicolon?)



Cheers,
Moritz


Re: no ICU lib loaded - rakudo and parrot issue

2012-06-28 Thread Moritz Lenz

Am 28.06.2012 14:31, schrieb Gabor Szabo:

The following script generates an exception

use v6;

my %count;
my $s = 'שלום';
%count{$s} = 1;
say $s;
say %count.perl;


no ICU lib loaded
  in method perl at src/gen/CORE.setting:3892
   in method perl at src/gen/CORE.setting:5921
   in method perl at src/gen/CORE.setting:6115
   in block anon at code/count.pl6:7

The crash is in calling .perl on the hash I think, printing the scalar worked.

As I read from the IRC log http://irclog.perlgeek.de/perl6/2012-03-16
I need to install libicu-dev and rebuild parrot and rakudo to solve this issue.
It indeed solved it.

I am still wondering what is the issue there? Having

$s = 'Gábor'

does not yet trigger the crash but the Hebrew letters do.


The difference is that á fits into Latin-1, and there's some support for 
characters in the Latin-1 range hardcoded into parrot/nqp/rakudo (dunno 
which part exactly) which works even in the absence of ICU.


Cheers,
Moritz



Rakudo Star 2012.05 released

2012-05-23 Thread Moritz Lenz
Announce: 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 May 2012 release of Rakudo Star, a useful and
usable distribution of Perl 6.  The tarball for the May 2012
release is available from http://github.com/rakudo/star/downloads.

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.05 [0] of the
Rakudo Perl 6 compiler [1], version 4.4 of the Parrot Virtual
Machine [2], and various modules, documentation, and other
resources collected from the Perl 6 community.

Here are some of the major improvements in this release over the
previous distribution release.

* -I and -M command-line options
* support for non-Int enums
* 'use' now accepts positional arguments and is able to import by tag name
* 'import' now works
* basic support for Version literals
* %*ENV now propagates into subprocesses
* basic implementation of pack and unpack
* fff flip-flop operator is now implemented, ff has been improved
* various new regex features and improvements

Rakudo now also includes the lib.pm module.

This release also contains a range of bug fixes, improvements to error
reporting and better failure modes. More exceptions are thrown
as typed exceptions.

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 a new online resource at http://perl6.org/compilers/features
that lists the known implemented and missing features of Rakudo Star
2012.05 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.
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-compiler@perl.org
mailing list, or join us on IRC #perl6 on freenode.

[0] https://github.com/rakudo/rakudo/blob/nom/docs/announce/2012.05
[1] http://github.com/rakudo/rakudo
[2] http://parrot.org/


Re: sound distribution practices

2012-04-09 Thread Moritz Lenz
On 04/09/2012 09:10 PM, Alessandro Ghedini wrote:
 On Sun, Apr 08, 2012 at 08:42:21PM +0200, Moritz Lenz wrote:
 On 04/08/2012 06:53 PM, Alessandro Ghedini wrote:
  On Sun, Apr 08, 2012 at 11:09:30AM -0500, Patrick R. Michaud wrote:
  On Sun, Apr 08, 2012 at 03:23:26PM +0200, Alessandro Ghedini wrote:
   On Sat, Apr 07, 2012 at 09:08:21PM -0400, Andrew Whitworth wrote: 
   Btw, this also applies to NQP bundling full source of
   libtommath and dyncall.
  
  We'll work on removing the libtomath and dyncall sources from NQP 
  tarballs, or make it very easy for NQP to ignore those sources.
  
  Thanks. As far as I'm concerned something simple as a Configure.pl option 
  (say,
  --use-system-libraries) or an environment variable would do
 
 Unfortunately from our point of view it's not that simple, because we
 have some patches to those libs; we'll try to push them upstream, but
 it'll take some time to do that and to get them all accepted.
 
 What kind of patches?

For dyncall mostly build fixes for cygwin and windows.
For libtommath a few additional features: conversion from and to double
precision floats, and extraction of machine-size integers.

One of the libtommath developers has expressed mild interest in the
float conversion routines, I just have to polish them to the standard of
the upstream maintainers.

 We may try to get those included in the Debian packages
 for the two libraries if they are not too excessive.
 
 Also, I was wondering why did you choose libtommath and dynacall, instead of,
 say, GMP and FFI? (I'm just curious).

Because both GMP and FFI are both quite hard to build on Windows.
Yes, I know, Debian maintainers usually don't worry about that :-), but
we need to consider a big part of our potential user base.


Re: sound distribution practices

2012-04-08 Thread Moritz Lenz
On 04/08/2012 06:53 PM, Alessandro Ghedini wrote:
 On Sun, Apr 08, 2012 at 11:09:30AM -0500, Patrick R. Michaud wrote:
 On Sun, Apr 08, 2012 at 03:23:26PM +0200, Alessandro Ghedini wrote:
  On Sat, Apr 07, 2012 at 09:08:21PM -0400, Andrew Whitworth wrote: 
  Btw, this also applies to NQP bundling full source of
  libtommath and dyncall.
 
 We'll work on removing the libtomath and dyncall sources from NQP 
 tarballs, or make it very easy for NQP to ignore those sources.
 
 Thanks. As far as I'm concerned something simple as a Configure.pl option 
 (say,
 --use-system-libraries) or an environment variable would do

Unfortunately from our point of view it's not that simple, because we
have some patches to those libs; we'll try to push them upstream, but
it'll take some time to do that and to get them all accepted.

Cheers,
Moritz


Re: Not Quite Perl

2012-04-03 Thread Moritz Lenz

(follow-up to perl6-compil...@perl.org)

Am 03.04.2012 10:02, schrieb Daniel Carrera:

I've been reading a little about NQP (Not Quite Perl). I was wondering
if NQP is part of the Parrot project, or if it is an independent spec.


NQP exists in several versions. The earliest version lived in the parrot 
repository. The next iteration, called NQP-rx, was developed outside of 
parrot, and its compiled form (compiled to PIR, that is) was bundled 
with Parrot.
The current version (called NQP again) is developed outside of parrot 
(in github.com/perl6/nqp/ repository), and not (yet?) bundled with parrot.


NQP is intended to be a subset of Perl 6, use for bootstrapping the 
Rakudo compiler (and of use to other compiler writers as well).

It doesn't have a separate spec.


I'm wondering if a program written in NQP will be faster in general,
or faster under Rakudo/Parrot, or not fast at all.


Since NQP mostly(*) just implements stuff that maps well to parrot, it 
is usually much faster than Rakudo, but of course it also does much less.


(*) current NQP also implements 6model, a lightweight object storage 
system that is flexible enough for Perl 6.


Cheers,
Moritz


Re: Not Quite Perl

2012-04-03 Thread Moritz Lenz



Am 03.04.2012 11:24, schrieb Daniel Carrera:

Ok. I just scanned the Wikibook on NQP. Indeed, it is quite limited.
It lacks basic things like list context:

@a := (1,2,3,4);   #  Wrong.

It's a shame because lists is precisely what I wanted to work with.


But this works:

@a := [1, 2, 3, 4]

Note that this will store a ResizablePMCArray in @a, so if you want to 
know what kind of methods you can call on it, you have to consult 
parrot's documentation of the ResizablePMCArray. You also get the 
stringification behavior of a ResizablePMCArray etc.


If that's not what you want, use Rakudo.


Reading up on Parrot I stumbled on this bit of information:

Native Library Support

Parrot has a robust system for interfacing with external native code
libraries, such as those commonly written in C, C++, Fortran and other
compiled languages.


*cough*
Parrot has some limited out-of-the-box support for calling C functions, 
and if you have libffi installed (which doesn't work out of the box on 
Windows), you get decent support for calling C functions.


I haven't seen a robust way to call C++ and Fortran functions yet, 
mainly because both use non-standard name mangling schemes at the 
bytecode level (I believe that newer Fortran versions have such a 
standard, but the scientific computing world seems to be stuck with F77).



Where previously every interpreter would need to
maintain its own bindings and interfaces to libraries, Parrot enables
developers to write library bindings once and use them seamlessly from
any language executing on Parrot. Want to use Tcl's Tk libraries,
along with Python's image manipulation libraries in a program you are
writing in Perl? Parrot supports that.


Does that mean what I think it means? That I could, for example, get
super-fast matrix operations using LAPACK simply because Rakudo talks
to Parrot and Parrot talks to Fortran?



That's the theory.
In practice, it doesn't work like that. In practice, you have two 
options when crossing a language boundary.


The first is to promote or wrap objects to types of the host language 
(ie a parrot integer becoming a Perl 6 Int), which means it can't be 
automated in the general case, and you get some performance penalty.


The second is to simply leave the objects as-is, but you can't really 
call that seamlessly. It means for example that your Perl 6 Int object 
has a method called sqrt, but the Parrot integer does not.


The cross-language interoperability advertised in the parrot 
documentation is mostly fiction. All attempts to get cross-language 
interoperation to work have bitrotted, and I'm not aware of any working, 
non-contrieved examples.



There are a lot of powerful
numerical libraries in C and especially Fortran, but last time I
checked I think I was told that getting Rakudo to talk to Fortran
would be very difficult.


NQP (and thus Rakudo) has its own mechanism for calling C libraries. In 
Rakudo, this is available through NativeCall.pm in 
https://github.com/jnthn/zavolaj/


(Note that currently NativeCall doesn't work together with precompiled 
modules; should still work in the latest Rakudo Star release though).


Cheers,
Moritz


Re: [perl #112216] slicing a string with inifinite ranges gives LTA error message

2012-04-03 Thread Moritz Lenz
On 04/03/2012 06:44 PM, Patrick R. Michaud via RT wrote:
 On Tue Apr 03 01:24:47 2012, moritz wrote:
 10:23  timotimo r: say foo[1..*]
 10:23 +p6eval rakudo 8ead1e: OUTPUT«Method 'gimme' not found for 
 invocant of
  class 'Str'␤  in method postcircumfix:[ ] at
  src/gen/CORE.setting:1147␤  in block anon at
  /tmp/1ZiRf7yMZW:1␤␤»
 
 
 Now fixed in 1bbf9eb, needs spectests to close ticket.

Now we have foo[2] fail(), but foo[2..*] returns the empty Parcel.
Is that the intended behavior?

Cheers,
Moritz


Re: [perl #112216] slicing a string with inifinite ranges gives LTA error message

2012-04-03 Thread Moritz Lenz


On 04/03/2012 11:16 PM, Patrick R. Michaud wrote:
 On Tue, Apr 03, 2012 at 09:22:11PM +0200, Moritz Lenz wrote:
 On 04/03/2012 06:44 PM, Patrick R. Michaud via RT wrote:
  On Tue Apr 03 01:24:47 2012, moritz wrote:
  10:23  timotimo r: say foo[1..*]
  10:23 +p6eval rakudo 8ead1e: OUTPUT«Method 'gimme' not found for 
  invocant of
   class 'Str'␤  in method postcircumfix:[ ] at
   src/gen/CORE.setting:1147␤  in block anon at
   /tmp/1ZiRf7yMZW:1␤␤»
  
  
  Now fixed in 1bbf9eb, needs spectests to close ticket.
 
 Now we have foo[2] fail(), but foo[2..*] returns the empty Parcel.
 Is that the intended behavior?
 
 Since foo acts like a list of one element,

My point is that it currently doesn't really.

Compare:

say foo.list.[2]  # Nil

with

say foo.[2] # Index out of range. Is: 2, should be in 0..0

which is why I'm complaining about inconsistencies.

 I suspect that .[2..*]
 should act the same as when used on an array of one element, which
 results in an empty Parcel:
 
 my @array = foo;
 say @array[2..*].elems;   # 0
 say foo[2..*].elems;   # 0
 
 If that's wrong, we need better spectests to get the correct
 behavior.

No, first we need agreement on what the right behavior is. Thinking
about spectests before we're positive on the right behavior is taking
things out of order.


Re: [perl #111704] try BLOCK messes up $_ when used in statement-modifying contextualizers

2012-03-13 Thread Moritz Lenz

Now tested in S04-statements/try.t

Cheers,
Moritz

Am 13.03.2012 10:55, schrieb Moritz Lenz (via RT):

# New Ticket Created by  Moritz Lenz
# Please include the string:  [perl #111704]
# in the subject line of all future correspondence about this issue.
#URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111704


10:53  moritz  r: try { say $_ } for1 2
10:53+p6eval  rakudo bd6742: OUTPUT«Any()␤Any()␤»

should be 1\n2\n

10:53  moritz  r: try say $_  for1 2
10:53+p6eval  rakudo bd6742: OUTPUT«1␤2␤»
10:53  moritz  ok, only the block case

Same with given:

10:55  moritz  r: try { say $_ } given 2
10:55+p6eval  rakudo bd6742: OUTPUT«Any()␤»


Re: [perl #111646] infix~ reports an arity of 2 even though it accepts 2

2012-03-09 Thread Moritz Lenz

Golfed even further:

09:44  moritz nom: multi a($, $) { }; say a.arity
09:44 +p6eval rakudo 4235df: OUTPUT«1␤»

Seems the arity calculation is generally a bit off

Am 09.03.2012 09:41, schrieb Moritz Lenz (via RT):

# New Ticket Created by  Moritz Lenz
# Please include the string:  [perl #111646]
# in the subject line of all future correspondence about this issue.
#URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111646


09:38  moritz  nom: sayinfix:~.arity
09:38+p6eval  rakudo 4235df: OUTPUT«1␤»
09:38  moritz  nom: sayinfix:~.count
09:38+p6eval  rakudo 4235df: OUTPUT«1␤»
09:38  moritz  ah, that's wrong
09:39  moritz  nom: sayinfix:~(2, 3)
09:39+p6eval  rakudo 4235df: OUTPUT«23␤»

This leads to @list.reduce(infix:~) failing, because reduce thinks it
got an unary operator.


Re: [perl #111646] infix~ reports an arity of 2 even though it accepts 2

2012-03-09 Thread Moritz Lenz
Further analysis: the problem is that Signature.count counts the (|$) 
from the proto as a single positional.


The obvious fix from http://moritz.faui2k3.org/tmp/arity.patch doesn't 
work, because List.munch then gets a Num argument, which blows up during 
unboxing.


Re: [perl #111492] [BUG] LTA error message when a 'sub foo' declaration is not succeeded by block curlies

2012-03-02 Thread Moritz Lenz
FWIW my commit 6588dd39 is to blame; now trying to find out why...

On 03/02/2012 08:09 PM, Carl MXXsak (via RT) wrote:
 # New Ticket Created by  Carl Mäsak 
 # Please include the string:  [perl #111492]
 # in the subject line of all future correspondence about this issue. 
 # URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111492 
 
 
 moritz std: sub foo; foo()
 p6eval std 9c3ef6d: OUTPUT«===SORRY!===␤Malformed block at
 /tmp/tJ4MC1rBfe line 1:␤-- sub foo⏏; foo() [...] Parse
 failed␤FAILED 00:01 107m␤»
 moritz nom: sub foo; foo()
 p6eval nom b6c09b: OUTPUT«===SORRY!===␤Method 'ast' not found for
 invocant of class 'Undef'␤»
 masak moritz: can I submit a rakudobug for the LTA error message on
 'sub foo;'?
 moritz masak: sure
 * masak submits rakudobug


Announce: Rakudo Perl 6 compiler development release #48 (Toronto)

2012-01-22 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm happy to announce the
January 2012 release of Rakudo Perl #48 Toronto.  Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
http://www.parrot.org). The tarball for this release
is available from http://github.com/rakudo/rakudo/downloads.

Please note: This announcement is not for the Rakudo Star
distribution[*] -- it's announcing a new release of the compiler only.
For the latest Rakudo Star release, see
http://github.com/rakudo/star/downloads.

The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group.  The January 2012 release is
code named after the Toronto Perl Mongers, organizers of YAPC::NA 2005,
which featured a Perl 6 hackathon.


Some of the specific changes and improvements occurring with this
release include:

* regex backtracking into subrules and captures now works
* -c (compilation check) command line option works again
* better parameter introspection
* many bugfixes

We are still regressed on a few features compared to the 2011.07 release of
Rakudo, the most notable of which is autovivification.
These regressions should be rectified in coming releases.

For a more detailed list of changes, see docs/ChangeLog.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Jonathan Worthington, Moritz Lenz, Kris Shannon, Tadeusz Sośnierz,
kboga, Carl Masak, Bruce Gray, Solomon Foster, Geoffrey Broadwell,
not_gerd, wollmers.


If you would like to contribute, see http://rakudo.org/how-to-help,
ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6
on freenode.

The next release of Rakudo (#49) is scheduled for February 23, 2012. A
list of the other planned release dates and code names for 2012 is
available in the docs/release_guide.pod file.  In general, Rakudo
development releases are scheduled to occur soon after each Parrot
monthly release.  Parrot releases the third Tuesday of each month.

Have a great deal of fun!


[*] What's the difference between the Rakudo compiler and the Rakudo
Star distribution?

The Rakudo compiler is a compiler for the Perl 6 language.
Nothing else.

The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, the most recent incarnation of the Using
Perl 6 book, and other software that can be used with the Rakudo
compiler to enhance its utility.  Rakudo Star is meant for early
adopters who wish to explore what's possible with Rakudo Perl 6 and
provide feedback on what works, what doesn't, and what else they
would like to see included in the distribution.


-- 
Moritz Lenz
http://perlgeek.de/ |  http://perl-6.de/ | http://sudokugarden.de/


Re: [perl #74654] [BUG] '$b()' is parsed wrongly by Rakudo

2012-01-13 Thread Moritz Lenz



Am 11.01.2012 16:46, schrieb Will Coleda via RT:

On Tue Aug 17 21:54:31 2010, coke wrote:

On Sun Apr 25 07:22:56 2010, masak wrote:

JimmyZ  masak: alpha is diferent from rakudo
JimmyZ  masak: which one is right?
JimmyZ  alpha: my $b =time; say$b();
p6eval  alpha 30e0ed: OUTPUT«1272203938.46735␤»
JimmyZ  rakudo: my $b =time; say$b();
p6eval  rakudo e393c7: OUTPUT«␤»
masak  rakudo: my $b =time; say $b();
p6eval  rakudo e393c7: OUTPUT«1272203984.27821␤»
masak  JimmyZ: viv seems to indicate that alpha was right there.
masak  i.e. that$b() should be parsed as ($b).()
* masak submits rakudobug


Error has changed:

00:53[Coke]  rakudo: my $b =time; say$b();
00:53p6eval  rakudo 67778a: OUTPUT«===SORRY!===␤Non-declarative

sigil is

missing its name at line 22, near $b();␤»



And again:

10:45  [Coke]  rakudo: my $b =time; say$b();
10:46+p6eval  rakudo 38165a: OUTPUT«===SORRY!===␤Symbol 'time' not
 predeclared inanonymous  (/tmp/rmvYisn_Ne:1)␤»



The problem here is just that 'time' is implemented as a term, not as a 
subroutine in the setting. If I do the same thing with something that's 
actually a subroutine, it works fine:


09:46  moritz nom: sub f { 6 }; my $b = f; say $b()
09:46 +p6eval nom 47540c: OUTPUT«6␤»

likewise if I reference 'time' correctly:

09:47 +p6eval nom 47540c: OUTPUT«1326441971␤»
09:47  moritz nom: my $b = term:time; $b()

Can be closed with tests.

Cheers,
Moritz


Re: [perl #108160] [BUG] Null PMC access when binding hash slice in Rakudo

2012-01-13 Thread Moritz Lenz

Fixed now, and tested in S03-operators/binding-hashes.t


Am 13.01.2012 15:50, schrieb Carl MXXsak (via RT):

# New Ticket Created by  Carl Mäsak
# Please include the string:  [perl #108160]
# in the subject line of all future correspondence about this issue.
#URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=108160


kboga  nom: my %hash = Crow =  'bar', Bar =  'crow'; %hash{Crow Bar} := 
'a';
p6eval  nom 45c44b: OUTPUT«Null PMC access in get_pmc_keyed_str()␤
in method postcircumfix:{ }  [...]
kboga  I believe this needs another way to die? :)
moritz  it does
kboga  https://github.com/rakudo/rakudo/commit/f133a3bab3
kboga  there's a ! in front of BIND, that shouldn't be there i believe
moritz  yes, looks like it
moritz  I'll fix that after I'm done with some other tests
moritz  ERAKUDOCOMPILETOOSLOW
* masak submits rakudobug


Re: [perl #106832] [BUG] Failure objects don't expose their underlying exceptions, except by re-throwing them

2011-12-22 Thread Moritz Lenz
Now fixed, and tested in t/spec/S04-exceptions/fail.t

On 12/22/2011 04:13 PM, Carl MXXsak (via RT) wrote:
 # New Ticket Created by  Carl Mäsak 
 # Please include the string:  [perl #106832]
 # in the subject line of all future correspondence about this issue. 
 # URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=106832 
 
 
 moritz wow, it seems that nom's Failure doesn't expose the
 underlying exception, except by re-throwing it :/
 masak that's... a regression.
 masak b: sub foo { fail ooh! }; say foo().exception.payload
 p6eval b 1b7dd1: OUTPUT«ooh!␤»
 masak nom: sub foo { fail ooh! }; say foo().exception.payload
 p6eval nom 7a1925: OUTPUT«ooh!␤  in method anon at
 src/gen/CORE.setting:6930 [...]
 moritz aye, I'm going to chain that
 * masak submits rakudobug
 moritz masak: would be .exception.Str on nom
 moritz and will be
 masak nom: sub foo { fail ooh! }; say foo().exception.Str
 p6eval nom 7a1925: OUTPUT«ooh!␤  in method anon at
 src/gen/CORE.setting:6930 [...]


Announce: Rakudo Perl 6 compiler development release #47 (Columbus)

2011-12-22 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm happy to announce the
November 2011 release of Rakudo Perl #47 Columbus.  Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
http://www.parrot.org). The tarball for this release
is available from http://github.com/rakudo/rakudo/downloads.

Please note: This announcement is not for the Rakudo Star
distribution[*] -- it's announcing a new release of the compiler only.
For the latest Rakudo Star release, see
http://github.com/rakudo/star/downloads.

The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group.  The December 2011 release is
code named after the Columbus Perl Mongers, organizers of YAPC::NA 2010,
which featured a Perl 6 track and hackathon.


Some of the specific changes and improvements occurring with this
release include:

* Many regex improvements, including escapes in character classes
  look-around assertions and many bug fixes
* Several performance improvements
* Defining new operators, flip flop operators, and the Proxy class
  are now supported

We are still regressed on a few features compared to the 2011.07 release
of Rakudo, the most notable of which is autovivification.
These regressions should be rectified in coming releases.

For a more detailed list of changes, see docs/ChangeLog.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Jonathan Worthington, Moritz Lenz, Will Coke Coleda, Michael
Schroeder, Tadeusz Sośnierz, Solomon Foster, Zohar Kelrich, diakopter,
JimmyZ, Jonathan Scott Duff, Geoffrey Broadwell, Woodi

If you would like to contribute, see http://rakudo.org/how-to-help,
ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6
on freenode.

The next release of Rakudo (#48) is scheduled for January 19, 2012. A
list of the other planned release dates and code names for 2012 is
available in the docs/release_guide.pod file.  In general, Rakudo
development releases are scheduled to occur soon after each Parrot
monthly release.  Parrot releases the third Tuesday of each month.

Have a great deal of fun!


[*] What's the difference between the Rakudo compiler and the Rakudo
Star distribution?

The Rakudo compiler is a compiler for the Perl 6 language.
Nothing else.

The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, the most recent incarnation of the Using
Perl 6 book, and other software that can be used with the Rakudo
compiler to enchance its utility.  Rakudo Star is meant for early
adopters who wish to explore what's possible with Rakudo Perl 6 and
provide feedback on what works, what doesn't, and what else they
would like to see included in the distribution.



Re: very long perl6 step

2011-10-20 Thread Moritz Lenz

Am 19.10.2011 16:03, schrieb Richard Hainsworth:

The update stalled (I thought) at the step using per6 to build the
setting. Turned out just to be a VERY slow step.

I suggest a notification is included in the make file saying the step is
slow.


I can do that, but I'd like to wait until after today's Rakudo release, 
in order not to break things.


Cheers,
Moritz


Re: [perl #78626] Patch: support higher arity in reduce()

2011-10-13 Thread Moritz Lenz

Am 13.10.2011 06:01, schrieb smos...@loveandhotsauce.net:

That's fine, I think it was already shot down owing to the supposedly
dubious utility of supporting higher arities in .reduce()

By the way, I submitted the patch because the error message had (and
still has) the for now wording when you try any other arity. But after
I submitted the patch I was asked to defend non-binary reduce. After
scratching my head I might have replied with some mumblings about
continued fractions or something, but I don't understand why I was asked
while that particular wording is still in place—either it's binary only
or it isn't, or perhaps it's just not specced.

I can appreciate the added complication in checking when a non-binary
reduce should actually terminate, and other concerns. If I knew that the
functionality was desired, I'd be happy to submit another patch. At the
moment a change in the wording in src/core/List.pm might be advisable,
line 296: fail('can only reduce with arity 2 for now'), dropping the
for now if the functionality is not in fact desired.


Let me provide some context for the for now here. I'm not defending 
that phrase (and will remove it), just want to provide some food for 
thought.


Back when you wrote the patch, we did find higher arity reduce 
desirable, and I think some of us are still emotionally attached to the 
idea.


The problem is that the complexity of signatures makes it basically 
impossible to figure out which candidate to call if the reducer is a 
multi, and thus to decide how many arguments to pass.


The idea back then was to somhow specific a mechanism for supplying a 
(possibly lazy) stream of arguments to a set of multi candidates, and 
have the call eat up an apropriate amount of arguments. Such a mechansim 
would be useful in other places as well (such as 'for' and 'map' with 
blocks of higher arity), and it would be a very nice anaolgy to regexes. 
And like the famous longest token matching [1] in regexes, we'd expect 
such a mechanism to be mostly greedy, ie the candidate that binds the 
most arguments wins, unless other circumstances prevent that from 
happening (you see, it's rather vague).


I have no idea how feasible such a mechanism is, and if it will be 
included in Perl 6 at all. But I'm sure that if it will be defined, it 
will be on a much lower level than reduce -- probably in the multi 
dispatcher directly.


Up to now such a spec hasn't happened, but the idea keeps simmering in 
the back of the minds of several Perl 6 hackers.


Cheers,
Moritz


Announce: Rakudo Perl 6 compiler development release #43 (Beijing)

2011-07-21 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm happy to announce the
July 2011 release of Rakudo Perl #43 Beijing.  Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
http://www.parrot.org). The tarball for the July 2011 release
is available from http://github.com/rakudo/rakudo/downloads.

Please note: This announcement is not for the Rakudo Star distribution --
it's announcing a new release of the compiler only.  For the latest
Rakudo Star release, see http://github.com/rakudo/star/downloads.

The Rakudo Perl compiler follows a monthly release cycle, with each release
named after a Perl Mongers group. The July 2011 release is code named
Beijing after the host of the Beijing Perl Workshop 2011, which featured
several Perl 6 related talks.

This will be the last compiler release made from the current master
branch of Rakudo.  For the past several months, Rakudo compiler
development has primarily occurred in the nom branch of the
Rakudo repository (over 1200 commits since the 2011.05 release).
Shortly after this release, the nom branch will become the new
master branch and will be the source for future releases,
including the 2011.08 release.  We expect there will be several
releases in the near future -- watch http://rakudo.org/ for
details.

Some of the specific changes and improvements occurring in the
master branch with this release include:

* Fix bug in exponentation of negative numbers
* Fix build on systems with little RAM

For a more detailed list of changes, see docs/ChangeLog.

The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Moritz Lenz, Patrick R. Michaud, atrodo, Solomon Foster, bacek and others.

If you would like to contribute, see http://rakudo.org/how-to-help, ask on
the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode.

Rakudo has traditionally released two days after each Parrot
monthly release.  Because the new version of the compiler has
additional dependencies beyond Parrot, starting in August 2011
we will make releases sometime in the week following each monthly
Parrot release.  (Parrot releases occur on the third Tuesday of
each month.) Thus the next regular release of Rakudo will occur
sometime before August 23, 2011.  We also expect to have additional
pre-release versions of Rakudo and Rakudo Star prior to that date.

A list of the other planned release dates and code names for 2011
is available in the docs/release_guide.pod file.



Re: rakudo :sigspace interpretation, [ |a] vs [a| ]

2011-05-06 Thread Moritz Lenz
On 05/06/2011 02:10 PM, Carl Mäsak wrote:
 Patrik ():
 Your link seems to specifiy how empty patterns are illegal. However,
 reading the :sigspace definition, I assume that rule {[ |a]+} is
 eqivalent to token {[.ws|a]+}, which not contains any empty pattern.
 
 I find nothing in the spec that addresses this case specifically.
 (Though I might have simply missed it.)
 
 However, I expect *any* alternations on the form /[ |a]/ to simplify
 to just /[a]/,

Agreed.

 so I don't agree with your equivalence above. More
 generally, nowhere in Perl 6 regexes does a regex (or alternation
 alternative, or capture, or group, etc) containing *only* whitespace
 correspond to .ws -- instead, it's illegal.

Much to my surprise std disagrees:

14:24  moritz std: m/ /
14:24 +p6eval std 9f27365: OUTPUT«===SORRY!===␤Null pattern not
allowed at  /tmp/Ablb1Ce4Mi line 1:␤-- m/ ⏏/␤expecting
quantifier␤Parse failed␤FAILED 00:01 113m␤»
14:24  moritz std: m:s/ /
14:24 +p6eval std 9f27365: OUTPUT«ok 00:01 113m␤»

And also in the aforementioned case:

14:07  moritz std: m:s/[a| ]/
14:08 +p6eval std 9f27365: OUTPUT«ok 00:01 113m␤»
14:08  moritz std: m/[a| ]/
14:08 +p6eval std 9f27365: OUTPUT«===SORRY!===␤Null pattern not
allowed at /tmp/VBaNc7c86G line 1:␤-- m/[a| ⏏]/␤expecting any
of:␤   quantifier␤ regex atom␤Parse failed␤FAILED 00:01
113m␤»

If that's intentional (and I'd find it very surprising if such a feature
slipped in accidentally), it needs explicit speccing.

Cheers,
Moritz


Re: [perl #86906] Parser not panicking in Grammar.pm

2011-03-24 Thread Moritz Lenz

Am 24.03.2011 05:00, schrieb Timothy Bollman (via RT):

Location of Error:
Grammar.pm line 2158 (as of ~5:00 AM UTC on March 23):
if +@parts != 2 {
 self.panic(Unable to find starter and stopper from '$opname');
}


Short description of error:
self.panic isn't... panicking.


Thanks for the report. I've committed a partial fix: 
https://github.com/rakudo/rakudo/commit/792e8602e8f9fa4f95463a54ea33467630d22d17




I was happily making a program that needed a floor operator.  So I
figured I would define a circumfix floor operator using the unicode
symbols.  But I didn't put a space between the two ends (having never
created one before I was guessing on how to write it).  Alas, I got
Null PMC access in get_integer thrown in my face.  Once I had

 traced it down to that space, I declared ah! That's an easy enough

thing to check for.  Easy patch.  A short grep later, I found the
gen_op function in Grammar.pm and lo and behold, it was already checking
for this error.  I put in  a debug say and it's getting to the check,
so the logical conclusion is that the panic method isn't functioning
like the developer expected (like perhaps it's not leaving the function).


The problem with method gen_op is that it has a rather indirect call 
chain, which seems to lose the context information. So when the .panic 
call tries to include the current location, it gets a Null PMC instead 
of the index into the string that is being parsed.


I don't understand the call mechanism sufficiently well to fix it, so 
I've just added a pir::die. So now you get the correct message, but no 
file and line number.


Cheers,
Moritz


Re: [perl #86338] [BUG] Proper type checking not done in generic method signatures in Rakudo

2011-03-17 Thread Moritz Lenz

Am 16.03.2011 21:58, schrieb Carl MXXsak (via RT):

masak  rakudo: role R[::T] { multi method foo(::T $x) { say $x } };
class C does R[Str] does R[Int] {}; C.new.foo(5.5) # should fail,
right?


Note that T would be the type, ::T is a type capture - it (hopefully 
lexically) rebinds T to the type of $x, it's not a type constraint.


Cheers,
Moritz


Re: [perl #83866] IO::Socket::INET Couldn't create socket.

2011-03-17 Thread Moritz Lenz
Today I pushed a completely new socket implementation, which is much
closer to p5's IO::Socket::INET, and IMHO has a much saner interface.

For a client, write

my $c = IO::Socket::INET.new(:host('http://rakudo.org/'), :port(80));
# no separate .open call necessary.

For a server, write

my $s = IO::Socket::INET.new(
   :localhost('127.0.0.1'),
   :localport(1024),
   :listen
);
# no separate calls to .bind or .listen necessary.

I hope this also addresses your problem. I've just pushed a patch for
LWP::Simple that adopts this new socket usage, and passes all tests.

Cheers,
Moritz


Re: [perl #83498] [PATCH] for #82142:

2011-02-07 Thread Moritz Lenz

And as an actual patch:

--- a/src/Perl6/Grammar.pm
+++ b/src/Perl6/Grammar.pm
@@ -1477,6 +1477,7 @@ token quote:syms {
 }
 .setup_quotepairs
 [
+| '/' \s* '/' .panic: Null regex in substitution not allowed
 | '/' p6regex=.LANG('Regex','nibbler') ?[/] quote_EXPR: 
':qq' .old_rx_mods?

 | '[' p6regex=.LANG('Regex','nibbler') ']'
   .ws [ '=' || .panic: Missing assignment operator ]

But I fear this is the wrong approach. Instead of doing a separate null 
pattern check in every quoting construct, the check should be done in 
the regex parsing code once, as STD.pm6 does it.


But I'll leave the final say to pmichaud or jnthn.

Cheers,
Moritz


Re: [perl #83356] [BUG] exporting infix:+ fails from simple class

2011-02-05 Thread Moritz Lenz
On 02/04/2011 08:51 PM, Solomon Foster wrote:
 On Fri, Feb 4, 2011 at 7:29 AM, Moritz Lenz via RT
 perl6-bugs-follo...@perl.org wrote:
 Am 04.02.2011 05:04, schrieb Solomon Foster (via RT):
 # New Ticket Created by  Solomon Foster
 # Please include the string:  [perl #83356]
 # in the subject line of all future correspondence about this issue.
 #URL: http://rt.perl.org/rt3/Ticket/Display.html?id=83356


 If I have this:

  class A {
  multi sub infix:+(A $a, A $b) is export { say hello }
  }

  my A $a .= new;
  say ($a + $a).perl;

 I get

 Can't take numeric value for object of type A
in 'Any::Numeric' at line 1456:CORE.setting
in 'infix:+' at line 7454:CORE.setting
in main program body at line 8:frip.pl

 That's correct behaviour. Multis are lexical by default (just like
 ordinary only-subs), so the availability of the new infix:+ outside
 the class would be a bug.
 
 But is export means it is available outside the class anywhere this
 file is used.

More precisely, everywhere where this multi is imported. 'use A;' by
default imports all the 'is export' and 'is export(:DEFAULT)' routines.

The is export doesn't magically make it available in an outer scope of
the same file.

  Is it really intended that it is available outside
 the class everywhere except the file it is defined in?

Yes. If not imported, normal lexical scoping applies.

  And if so, how
 should it be defined so that the multi is visible elsewhere in that
 file?

Just define it in the scope where you want it to be visible.

Or import it (NYI in rakudo):

class A {
   multi infix:+($a, $b) is export { ... }
}

import A;
# use it here.


Re: [perl #83356] [BUG] exporting infix:+ fails from simple class

2011-02-04 Thread Moritz Lenz

Am 04.02.2011 05:04, schrieb Solomon Foster (via RT):

# New Ticket Created by  Solomon Foster
# Please include the string:  [perl #83356]
# in the subject line of all future correspondence about this issue.
#URL: http://rt.perl.org/rt3/Ticket/Display.html?id=83356


If I have this:

 class A {
 multi sub infix:+(A $a, A $b) is export { say hello }
 }

 my A $a .= new;
 say ($a + $a).perl;

I get

Can't take numeric value for object of type A
   in 'Any::Numeric' at line 1456:CORE.setting
   in 'infix:+' at line 7454:CORE.setting
   in main program body at line 8:frip.pl


That's correct behaviour. Multis are lexical by default (just like 
ordinary only-subs), so the availability of the new infix:+ outside 
the class would be a bug.


Cheers,
Moritz


Re: [perl #83280] [BUG] Hyper += works incorrectly on an uninitialised array

2011-02-03 Thread Moritz Lenz


Am 03.02.2011 03:30, schrieb S. Schulze (via RT):

When using a hyper += to fill in values in an array, you get different
behaviours depending on whether the array has been initialised or not.


Since hyper operators are generally sensitive to the shape of the data 
structures they work on, I don't think the mere fact that initialization 
matters is a bug. It might still be a bug in this specific case though.


Cheers,
Moritz


Re: [perl #82638] statement after nested if breaks fails to parse without newlines

2011-01-24 Thread Moritz Lenz

Am 23.01.2011 07:48, schrieb Stephen Simmons (via RT):

# New Ticket Created by  Stephen Simmons
# Please include the string:  [perl #82638]
# in the subject line of all future correspondence about this issue.
#URL: http://rt.perl.org/rt3/Ticket/Display.html?id=82638


I've attached two programs, which differ only in whitespace;


And both are invalid Perl 6 - $x= is parsed as a subscript (like in 
%hashkey), which isn't closed. The error message isn't good, and 
rakudo should barf on both.


Cheers,
Moritz


Re: [perl #82638] statement after nested if breaks fails to parse without newlines

2011-01-24 Thread Moritz Lenz
On 01/24/2011 02:22 PM, Stephen Simmons wrote:
 So = needs to be surrounded by whitespace?

Yes.

 Is that true of all infix operators?

Only for those that could be parsed as postfixes or postcircumfixes. But
in general it's a good idea to use whitespace around all infix operators.

Cheers,
Moritz


Re: [perl #82312] [PATCH] optimized Range for getting its size if its a numeric range

2011-01-17 Thread Moritz Lenz
On 01/16/2011 07:47 PM, Gilbert R. Roehrbein (via RT) wrote:
 fixes the problem which you encounter when you try to evaluate
 +(23..23)

... and creates others. Consider

(0..^3.3).Numeric

Where you patch makes it return 3, but 4 is the correct answer.

Maybe checking for ~~ Int instead of ~~ Numeric helps, but we also need
to more tests.

Cheers,
Moritz


Re: Error on parrot build: gmake: *** [runtime/parrot/include/config.fpmc] Error -1073741819

2011-01-16 Thread Moritz Lenz
I'm forwarding this to the parrot folks in the hopes that they have a
better idea of what might be going on.

Cheers,
Moritz

On 01/16/2011 12:02 AM, Peter Schwenn wrote:
 Perl 6'rs
 
 I'm gmake'ing parrot under Windows 7 64-bit, preparatory to building rakudo.
 
 I'm using the latest parrot and rakudo via git.
 
 My perl is latest stawberry/vanilla perl.
 
 parrot: perl Configure.plruns fine, but
 
 parrot: gmake   runs on quite awhile without problems but finishes with:
 
 
  C:/rakudo/parrot\libparrot.dll  -lmoldname -lkernel32 -luser32 -lgdi32
 -lwins
 pool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
 -lws2_
 32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lgmp
 if exist .\miniparrot.exe.manifest mt.exe -nologo -manifest
 .\miniparrot.exe.man
 ifest -outputresource:.\miniparrot.exe;1
 .\miniparrot.exe -Iruntime/parrot/include config_lib.pir 
 runtime/parrot/includ
 e/config.fpmc
 gmake: *** [runtime/parrot/include/config.fpmc] Error -1073741819
 
 
 There is a slight difference (at the same point of failure) if I run,
 instead:
 
 rakudo: perl Configure.pl --gen-parrot , namely the added diagnostic
 phrase   config.fpmc is truncated; remove it and re-run make - but doing
 that changes nothing.
 
 
 Any ideas?
 nn
 Peter Schwe
 


Re: Method 'Bool' not found for invocant of class 'Integer'

2011-01-04 Thread Moritz Lenz



Am 04.01.2011 03:05, schrieb Nathaniel:

OK: I get this message when running a .pir file from an embedded
parrot interpreter, but not when I actually call parrot from a command
line.  My guess is that there is perhaps a .pbc file missing from the
area where I have set up a runtime directory structure mimicking the
rakudo release,


I have a different guess: Bool is a Perl 6 method, and Integer a parrot 
type (it's Int in Perl 6).
So most likely a parrot integer is leaking into a Rakudo program without 
being reblessed into Int (which is a subclass of the parrot Integer class).


Cheers,
Moritz


Re: Error right at the end of a Rakudo Star build

2010-12-11 Thread Moritz Lenz
Hi Peter,

On 12/11/2010 10:40 PM, Peter Schwenn wrote:
  2 [main] parrot 3756 C:\rakudo\parrot\parrot.exe: *** fatal error -
 unable to remap \\?\C:\rakudo\parrot\runtime\parrot\dynext\os.dll to same
 address as parent: 0x32 != 0x34

That looks like a general cygwin problem, if
http://www.mylifestartingup.com/2009/04/fatal-error-unable-to-remap-to-same.html
can be believed. That blog entry also has some instruction on how to fix it.

Cheers,
Moritz


Re: [PATCH] typo fix for spec S05

2010-11-22 Thread Moritz Lenz



Am 22.11.2010 08:39, schrieb Hongwen Qiu:


 -argument vary faster than the left.  In other words, C and C|| 
establish
 +argument very faster than the left.  In other words, C and C|| 
establish


Although it looks like a typo, to vary is indeed the correct verb here 
(means as much as changes or oscillates).


Cheers,
Moritz


Re: Unable to build Rakudo - make fails on perl6-grammar.pir with 'Killed'

2010-11-19 Thread Moritz Lenz

Hi,

thanks for your report

Am 19.11.2010 09:24, schrieb Ian Kent:

I've been trying to build Rakudo from source using Ubuntu Server 10.10. 
Configure.pl ran successfully but running make always ends with the following 
error:
make: *** [src/gen/perl6-grammar.pir] Killed

Am I doing something wrong or am I just missing some library or other?


I'd guess that you ran into some sort of resource limit: either the 
memory was exhausted, or there's a CPU time limit or something.


Could you please check that? let a program like top or htop running 
while you're compiling, and see if the current process uses up all 
memory. Also check the output of 'ulimit -a' (or post it here if you 
don't know how to read it.


Cheers,
Moritz


Re: Naive implementation of Str.samespace

2010-10-14 Thread Moritz Lenz
Hi,

thank you very much for the submission, it is greatly appreciated.

We received a second one by IRC, and I plan to compare the two (and
maybe benchmark), and then take the better and/or faster.

Cheers,
Moritz

On 10/09/2010 11:58 AM, Karthik wrote:
 This is my first try at coding in perl6. I did not understand the part
 in the spec that talks about random splicing of common whitespace chars.
 
 augment class Str {
 method samespace($other as Str) {
 my @self_ws = self.comb(/s+/);
 my @other_ws = $other.comb(/s+/);
 my @self_nws = self.split(/s+/);
 if (@self_nws.elems = @other_ws.elems) {
 (@self_nws Z (@other_ws, @self_...@other_ws.elems..(@self_ws.elems-1)],
 )).join();
 } else {
 (@self_nws Z (@other_ws[0..(@self_nws.elems-2)]), ).join();
 }
 }
 }
 
 
 --
 Karb
 http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline@middle?
 


feather.perl6.nl temporarily down

2010-09-30 Thread Moritz Lenz
Hi,

in a data center in the beautiful Netherlands, a power supply unit
decided to end its existence in a cloud of smoke.

Thus it's my sad duty to announce that feather.perl6.nl, the Perl 6
development server, is currently down. Two of the virtual hosts (which
among other things host the perl6.org homepage) will be back in a few
hours, when the raid is rebuilt.

feather1, the most user visible box, will take longer to recover, either
from backup or from a damaged hard disc.

Credits go to Juerd for hosting feather, and doing the recovery work.

Cheers,
Moritz


Announce: Rakudo Perl 6 compiler development release #33 (Milan)

2010-09-23 Thread Moritz Lenz
On behalf of the Rakudo development team, I'm happy to announce the
August 2010 release of Rakudo Perl #33 Milan.  Rakudo is an
implementation of Perl 6 on the Parrot Virtual Machine (see
http://www.parrot.org). The tarball for the September 2010 release
is available from http://github.com/rakudo/rakudo/downloads.

Please note: This announcement is not for the Rakudo Star distribution
-- it's announcing a new release of the compiler only.  For the latest
Rakudo Star release, see http://github.com/rakudo/star/downloads.

The Rakudo Perl compiler follows a monthly release cycle, with each
release named after a Perl Mongers group. The September 2010 release is
code named Milan, because the release manager happens to like the name :-)

Some of the specific changes and improvements occurring with this
release include:

* The specification for temporal objects (DateTime, Date, Instant and
  Duration) is now completely implemented in Rakudo

* Several performance improvements were implemented, most notably in
  slurp() and reverse() functions

* The series operator has been refactored, and updated to the current
  specification

* Enumeration objects now conform much closer to the current specification

* 'now' and 'time' are now terms (and not functions anymore). This means
you can now write 'time - 1' and do what you mean, but 'time()' does not
work anymore

For a more detailed list of changes see docs/ChangeLog.


Deprecation notice:

* Currently True and False evaluate as '1' and '0' in string context.
  The specification has changed, and in the next release they will
  evaluate to 'Bool::True' and 'Bool::False' in string context.
  To get the old behaviour, use ~+True or ~+False.


The development team thanks all of our contributors and sponsors for
making Rakudo Perl possible, as well as those people who worked on
Parrot, the Perl 6 test suite and the specification.

The following people contributed to this release:

Moritz Lenz, Patrick R. Michaud, Carl Masak, Patrick Abi Salloum,
Solomon Foster, Kodi Arfer, chromatic, Kyle Hasselbacher, Bruce Gray,
Martin Berends, Stephane Payrard, Tyler Curtis, Shlomi Fish, Nick
Wellnhofer,
Nuno  Carvalho, Tadeusz Sośnierz, TiMBuS, NotFound, mathw

If you would like to contribute, see http://rakudo.org/how-to-help,
ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on
freenode.

The next release of Rakudo (#34) is scheduled for October 21, 2010.
A list of the other planned release dates and code names 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!


Rakudo smoke reports

2010-09-16 Thread Moritz Lenz

Hi,

thanks to Jonathan Leto and the awesome OSUOSL folks, we have a smoke 
server again. At your convenience, please update to the newest Rakudo 
HEAD, reconfigure and then run


 $ make spectest_smolder

The reports can be inspected at 
http://smolder.parrot.org/app/projects/smoke_reports/5


Cheers,
Moritz


Re: Rakudo series operator interaction with +

2010-09-08 Thread Moritz Lenz

Hi,

Am 07.09.2010 21:36, schrieb Aaron Sherman:

Oddly, these two expressions have the same output:

for 0 ...^ (3+4) -  $i { say $i }
for 0 ...^ 7 -  $i { say $i }

But this one prints the numbers 0 through 7 instead of leaving off the last
number:

for 0 ...^ 3+4 -  $i { say $i }


Please compile the latest Rakudo from source, and try again :-)
patrickas++

Moritz


Re: Could not find sub !UNIT_OUTER

2010-08-27 Thread Moritz Lenz
Hi a b,

a b wrote:
 # perl6 --target=pir test.p6  test.pir
 # parrot prog.pir
 error:imcc:syntax error, unexpected PREG, expecting '(' ('$P67')
   in file 'prog.pir' line 36

Patrick Michaud fixed this at YAPC::EU, a bare week after the Rakudo
Star 2010.07 got released. An incentive for upgrading!

http://rakudo.org/announce/rakudo-star/2010.08

Cheers,
Moritz


  1   2   3   >