llancet has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks!
I'm trying to play with rakudo Perl 6, and got several problems:

1: I installed rakudo and parrot using fedora's yum utility, and I found there are many parrot libs(in pbc or pir format) already installed with the parrot binary. How can I use those libs inside Perl 6 code?

2: There is a website called cpan6, but has nothing inside. I found another manager called proto, it installs perl6 packages in ~/.perl6/lib. Does Perl 6's @INC includes this path by default, or I have to add that path to my script everytime?

3: As Perl 5 is written in C, it can interact with binary libraries through XS mechanism. How does rakudo implement this function?

Moreover: How can I see the formatted documents???

Thanks!

Replies are listed 'Best First'.
Re: Questions about rakudo and parrot
by FalseVinylShrub (Chaplain) on Jun 13, 2010 at 05:28 UTC

    Hi

    I'm just a newbie at Perl 6, but here's my views:

    You should check what version has been installed by yum, as you may want to download the latest version from rakudo.org. This includes the option to download and build the correct version of parrot as part of the build.

    I'm not sure about cpan6, but I know proto is a Perl6 library tool. My perl6, built from the latest source, seems to include ~/perl6/lib by default. Here's how to find out:

    perl6 -e 'say @*INC.perl'

    I've no idea about your parrot library or C library questions... Sorry.

    I'm also looking for the best place to find programmer-level documents for Perl 6 / Rakudo.

    Cheers

    FalseVinylShrub

    Disclaimer: Please review and test code, and use at your own risk... If I answer a question, I would like to hear if and how you solved your problem.

      I have checked the version, and changed proto configuration file properly (at least some options). Libs installed by proto seems working properly. Thanks!
Re: Questions about rakudo and parrot
by moritz (Cardinal) on Jun 13, 2010 at 10:54 UTC
    1: I installed rakudo and parrot using fedora's yum utility, and I found there are many parrot libs(in pbc or pir format) already installed with the parrot binary. How can I use those libs inside Perl 6 code?

    To use such libraries, in general you need to resort to PIR blocks - here's a discussion on how to use the MD5 library in Perl 6 that's shipped with parrot.

    Does Perl 6's @INC includes this path by default, or I have to add that path to my script everytime?

    It is included by default:

    ./perl6 -e '.say for @*INC' /home/moritz/.perl6/lib /home/moritz/rakudo/parrot_install/lib/2.4.0-devel/languages/perl6/lib .
    3: As Perl 5 is written in C, it can interact with binary libraries through XS mechanism. How does rakudo implement this function?

    Parrot has a native call interface (NCI), and for Rakudo there's zavolaj, which allows you to access the NCI via Perl 6 signatures.

    Moreover: How can I see the formatted documents???

    Which documents?

    Perl 6 - links to (nearly) everything that is Perl 6.

      Which documents?

      Those documents written in new POD format.

        With Perl6::Perldoc::Parser (though it's not quite up-to-date with the current Pod spec).
        Perl 6 - links to (nearly) everything that is Perl 6.