Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
laziness, impatience, and hubris
 
PerlMonks  

Re: Getting Involved with Perl 6 - 2009

by crumbly (Sexton)
on Jun 16, 2009 at 04:43 UTC ( #771872=note: print w/ replies, xml ) Need Help??


in reply to Getting Involved with Perl 6 - 2009

I'm still a bit scared off by Perl 6 and haven't yet done much investigation. What would thaw the ice quite a bit is if there were a website that catalogued example code for doing basic things like,

  • opening a file, writing something to it, and closing it
  • reading in the list of files in a given directory
  • doing search/replace on a string
  • sorting and uniq'ing a list of strings
  • basics of using hashes
  • reading user input from stdin
  • writing a function
  • writing a simple class
  • accessing environment variables
  • etc.

My guess is that Perl 6 can do all sorts of amazing things, but I'd just like to see that it still makes easy things easy.


Comment on Re: Getting Involved with Perl 6 - 2009
Re^2: Getting Involved with Perl 6 - 2009
by citromatik (Curate) on Jun 16, 2009 at 06:30 UTC
    What would thaw the ice quite a bit is if there were a website that catalogued example code for doing basic things like,

    These examples may help you.

    citromatik

      This SVN repository now lives at http://svn.pugscode.org/pugs/, the one on svn.perl.org is quite outdated. Even in the newer repository not all of these examples have been kept up-to-date with spec changes, which is why I'd recommend to look at the Perl 6 examples project instead.

      Update: to avoid confusion the outdated repo on svn.perl.org has now been deleted.

        That examples project looks like a great start. If I knew how to use Git, and if I knew Perl 6, I'd add a directory to it called "the_basics", and put in the following files (to start):

        • scalars.pl
        • strings.pl
        • arrays.pl
        • hashes.pl
        • operators.pl
        • regex.pl
        • control_structures.pl
        • context.pl
        • references.pl
        • scope.pl
        • functions.pl
        • classes.pl
        • modules.pl
        • packages.pl
        • stdin_stdout.pl
        • environment_variables.pl
        • files.pl
        • tests.pl
        If anyone wants to beat me to it, please go ahead. Would make it a snap to get up to speed with Perl 6 in a hurry.

Re^2: Getting Involved with Perl 6 - 2009
by John M. Dlugosz (Monsignor) on Jun 16, 2009 at 15:18 UTC
    Why not try crafting those and posting the attempts? Others will happy point out mistakes. You can annotate the listing with pointers to the synopses or discussions of the language features.

    Some of those are squarely "library" and that's gotten much less attention than the core language.

    Some of those lead to very interesting discussions. E.g. "environment variables" are the default values of context variables, which have taken the place of global variables.

    "Perl 6 can do some amazing things" Indeed. here is one of my efforts along the lines of what I'm suggesting (which also shows reading of standard input, according to the latest decree).

    —John

      Why not try crafting those and posting the attempts?

      I'm not sure that answer makes sense here. If I was asking how to write something substantial, or even just something novel that requires a few lines of code, then it makes sense to ask me try things and post. But I'm just expressing a little curiosity about some rudimentary features of the language -- nearly trivial things to use as a reference point comparing how you'd do them in other languages. And also, making a thread about "Is this what an array looks like in Perl 6?" would probably not be of much general interest.

      Yeah, I guess I could start poring over the Synopses and figuring them out. But at that point I'd have invested some substantial time when all I really had been curious about was what the Perl 6 rudiments looked like.

      I guess I'm your typical "on the fence customer". If I can quickly see how easy things are easily done in Perl 6, then maybe I'll put in some time and give it a try. But at the moment, Perl 5 is working for me, and it's not easy to make free time, so I'll probably pass.

Re^2: Getting Involved with Perl 6 - 2009
by crumbly (Sexton) on Jun 17, 2009 at 02:15 UTC
Re^2: Getting Involved with Perl 6 - 2009
by moritz (Cardinal) on Jun 17, 2009 at 15:26 UTC
    It might please you to know that currently a student is being paid by Google's "Summer of Code" project to improve documentation infrastructure and documentation for Perl 6.

    Parts of his project description:

    Start writing a tutorial (see Details section above) covering basic language constructs. Write documentation about basic Perl 6 features (as specified by Synopses 2, 3, and 4), like Perl 5's perlsyn, perlop, perlfunc, and perldata. Draw on material from the relevant Apocalypses and Exegeses as well.

    That should be enough to get you started, and you expect it to land mid or end of August.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://771872]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-04-18 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (460 votes), past polls