grondilu / libdigest-raku

Raku implementation of various digests
Artistic License 2.0
27 stars 42 forks source link

Issue with σ in expressions #7

Closed nsharrok closed 9 years ago

nsharrok commented 9 years ago

C:\Users\nsharrok\Documents>panda install Digest ==> Fetching Digest ==> Building Digest Compiling lib\Digest.pm to pir Compiling lib\Digest\RIPEMD.pm to pir Compiling lib\Digest\SHA.pm to pir ===SORRY!=== Error while compiling lib\Digest\SHA.pm Two terms in a row at lib\Digest\SHA.pm:94 ------> my $⏏σ0 = [+^] map { rotr @h[0], $_ }, 2, 13, expecting any of: scoped declarator constraint postfix infix stopper infix or meta-infix statement end statement modifier statement modifier loop build stage failed for Digest: Failed building lib\Digest\SHA.pm in method install at C:/rakudo/lib/parrot/6.10.0/languages/perl6/lib/Panda.pm:138 in method resolve at C:/rakudo/lib/parrot/6.10.0/languages/perl6/lib/Panda.pm:193 in sub MAIN at C:\rakudo\bin\panda:21 in sub MAIN at C:\rakudo\bin\panda:21 in block at C:\rakudo\bin\panda:77

Failure Summary

Digest *build stage failed for Digest: Failed building lib\Digest\SHA.pm

Its the use of σ in lines 94, to 97 on a Windows 8 box

        my $σ0 = [+^] map { rotr @h[0], $_ }, 2, 13, 22;
        my $σ1 = [+^] map { rotr @h[4], $_ }, 6, 11, 25;
        my $t1 = [⊕] @h[7], $σ1, $ch, $K[$j], @w[$j];
        my $t2 = $σ0 ⊕ $maj;

Changed to o $o0 and $o1 from $σ0 and $σ1 and it compiles without issue.

Noel

grondilu commented 9 years ago

Can't reproduce this on Linux MoarVM. Not sure what to do about it : it's not specific to the library but appears to be a rakudo bug. I suggest trying to find a minimal code reproducing the error and post it at rakudobug@perl.org

What does the following line does?

perl6 --target=mbc --output=test.mbc -e 'my $σ = rand;'
nsharrok commented 9 years ago

my $σ0;

This reproduces the error on windows 8

C:\Users\nsharrok\Documents>perl6.p6 ===SORRY!=== Error while compiling C:\Users\nsharrok\Documents\perl6.p6 Two terms in a row at C:\Users\nsharrok\Documents\perl6.p6:1 ------> my $⏏σ0; expecting any of: scoped declarator constraint postfix infix stopper infix or meta-infix statement end statement modifier statement modifier loop

On 19 March 2015 at 16:08, grondilu notifications@github.com wrote:

Can't reproduce this on Linux MoarVM. Not sure what to do about it : it's not specific to the library but appears to be a rakudo bug. I suggest trying to find a minimal code reproducing the error and post it at rakudobug@perl.org

— Reply to this email directly or view it on GitHub https://github.com/grondilu/libdigest-perl6/issues/7#issuecomment-83323892 .

grondilu commented 9 years ago

Please run 'perl6 --version'

ugexe commented 9 years ago

This all works fine for me on windows 7 on jvm: http://testers.p6c.org/reports/35961.html

My JVM reports fail, but thats on both linux and windows. However, the examples posted here worked fine. http://testers.p6c.org/reports/35205.html

ugexe commented 9 years ago

parrot is not a supported backend for now, so you may want to try a newer distro

FROGGS commented 9 years ago

I'd recommend http://rakudo.org/downloads/star/rakudo-star-2015.02.msi on Windows until the 2015.03 will be available, which will happen in a week or two.

nsharrok commented 9 years ago

http://rakudo.org/downloads/star/rakudo-star-2015.02.msi is the the distro I am using

On 20 March 2015 at 18:53, Tobias Leich notifications@github.com wrote:

I'd recommend http://rakudo.org/downloads/star/rakudo-star-2015.02.msi on Windows until the 2015.03 will be available, which will happen in a week or two.

— Reply to this email directly or view it on GitHub https://github.com/grondilu/libdigest-perl6/issues/7#issuecomment-83944966 .

ugexe commented 9 years ago

http://rakudo.org/downloads/star/rakudo-star-2015.02.msi does not include the parrot backend (we can determine the backend being used by

Compiling lib\Digest.pm to pir
Compiling lib\Digest\RIPEMD.pm to pir
Compiling lib\Digest\SHA.pm to pir

I just installed that .msi myself and it did not install parrot. You may have an old rakudo install in your PATH.

Or depending on how the .msi works, the installer might be defaulting to parrot if its already installed even though its not currently supported (since it would bypasses the Configure.pl parrot support message). What does perl6 -v say? What are the contents of the perl6.bat file? Do you have a moar.exe?

nsharrok commented 9 years ago

Hi Ugexe, You are correct. I must not have uninstalled the old version o fPerl6 before installing the latest. C:\Users\nsharrok\Documents>perl6 -v This is perl6 version 2014.12 built on parrot 6.10.0 revision 0

install the new C:\Users\nsharrok\Documents>perl6 -v This is perl6 version 2015.02 built on MoarVM version 2015.02

No wonder I was having such a problem with all sorts of bits and pieces

Thanks Noel

On 21 March 2015 at 05:28, ugexe notifications@github.com wrote:

http://rakudo.org/downloads/star/rakudo-star-2015.02.msi does not include the parrot backend (we can determine the backend being used by

Compiling lib\Digest.pm to pir Compiling lib\Digest\RIPEMD.pm to pir Compiling lib\Digest\SHA.pm to pir

I just installed that .msi myself and it did not install parrot. You may have an old rakudo install in your PATH.

Or depending on how the .msi works, the installer will default to parrot if its already installed even though its not currently supported (since it would bypasses the Configure.pl parrot support message). What does perl6 -v say? What are the contents of the perl6.bat file? Do you have a moar.exe?

— Reply to this email directly or view it on GitHub https://github.com/grondilu/libdigest-perl6/issues/7#issuecomment-84094835 .

grondilu commented 9 years ago

Ok, closing.