Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Get Involved With Pugs

by Limbic~Region (Chancellor)
on May 11, 2005 at 13:18 UTC ( #455979=perlmeditation: print w/ replies, xml ) Need Help??

All,
In case you have been hiding under a rock since before February, the Pugs project is giving us the ability to write Perl6 today. After only 100 short days of development, audreyt and her gang of minions already have preliminary OO Support.

The initial vision of the project has been usurped several times and it now has taken on a life of its own. Many people are afraid to get involved because they have heard that it is written in Haskell. Contributing to the code base is obviously a great thing, but remember that there is more than one way to help!

  • Advocacy - Pugs, Parrot, Ponie, Perl6
  • Ask for a feature. Sometimes people with time and knowledge don't know what to implement next
  • Share your thoughts and ideas. Sometimes all you do is plant the seed, others water and care, and everyone enjoys the harvest
  • Volunteer to write documentation
  • Write p6 tests - even simple ones or for features that don't exist yet
  • Port p5 code to p6 to help flesh out bugs, identify missing features, and provide examples.
  • Do I need go on? Like any project, every little bit helps!

Some people may be wondering where they can find out more information. Besides the links I have already provided, you might want to consider:

Cheers - L~R

Comment on Get Involved With Pugs
Re: Get Involved With Pugs
by Juerd (Abbot) on May 11, 2005 at 13:33 UTC

    A short guide to adding tests is in order, because if you report a bug, the standard reply will be "write a test for it".

    There's currently a bug in Pugs that makes array references flatten in list context. A bug test is simple: write what you did and what you expected first:

    # What I did my @foo; push @foo, []; # What I expected @foo.elems == 1 # But I got @foo.elems == 0
    Then, rewrite the expectation as a test:
    ok(@foo.elems == 1, "\@foo has 1 element");
    If you're dealing with comparison, it's better to use is() instead of ok(), because you then get extra debugging output:
    is(@foo.elems, 1, "\@foo has 1 element");
    Add enough stuff to make it a script (the "plan" is the number of tests in the test script), and make sure you're loading the Test module:
    #!/usr/bin/pugs use v6; use Test; plan 1; my @foo; push @foo, []; is(@foo.elems, 1, "\@foo has 1 element");
    And then report your bug-report-test to a pugs developer, so that it can be included in the test suite. It'll remain there for a long time, to make sure that the bug, once fixed, won't come back (regress).

    If you have write access in the repository, commit the test as pugs/t/pugsbugs/foo.t, where foo is descriptive (in this case, the test is in flattening.t). If you will be reporting multiple bugs, request committer access from Autrijus. Giving you access once is easier than copying and pasting every bug report test.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      Incidentally, less than 24 hours after the test case has been written, this issue has been addressed -- and raising an important corner case in Perl 6's design. :-)
Re: Get Involved With Pugs
by tphyahoo (Vicar) on May 11, 2005 at 16:32 UTC
    Who can get involved with PUGS is determined first, by what systems PUGS can be installed on. The Pugs Readme gives instructions on installing but doesn't say what systems PUGS is known/believed to be installable. Does such a list exist anywhere?

    Has anyone been able to get this to install on a windows box, which is what I have?

      tphyahoo,
      Pugs should work on every platform that GHC works on. There are a fair amount of binary packages to include Win32. More information can be found here.

      Cheers - L~R

        ghc is available as a rpm for Mandriva. This packaging has been contributed by Rafael Garcia-Suarez.

        -- stefp

      Thanks, Limbic~Region.

      PUGS on MS Windows looks like a good place to start if you want PUGS to play with Windows and ActiveState. Monastery post Hello Perl 6. Running pugs on Windows makes me pretty optimistic as well :)

      FWIW, the binary windows installer for GHC.

      Secondly, GHC Contributors indicates that GHC works with windows targetting mingw and cygwin. I seem to recall a chatterbox interaction the upshot of which was that getting PUGS to install on Cygwin was less than trivial, which come to think of it is what prompted me to ask whether PUGS could be installed on a windows box. Maybe this was a red herring though and I don't even need cygwin...

      I just downloaded GHC for windows and will see if I can get PUGS onto my win box today, without cygwin. If anyone else has light to shed about this, would be great :)

        The "GHC for cygwin" is a misnomer, as GHC is mostly a native Win32 application. I haven't seen which backend for code generation GHC actually uses, but I assume it is built-in. I don't know if there is a build of GHC with MSVC, but as GHC is a compiler itself, I assume that GHC is compiled with itself mostly.

        I am developing Pugs on Win32 without any problems, because the support of GHC for Win32 is really good and one can easily access the Win32 API from within GHC. There are some things that are different between Pugs/Win32 and Pugs/POSIX:

        • fork() will not happen, or it will be the ugly abomination that fork emulation is under Perl5
        • system() and built-in threading (async blocks) don't play together. This might be fixed by making GHC spawn OS threads when launching a system() command, so the rest of Pugs continues running.
        • select() on non-sockets - WaitForSingleObject cannot wait for winsock.dll objects, and the select call of winsock does not know about the other kernel objects.
Re: Get Involved With Pugs
by revdiablo (Prior) on May 11, 2005 at 17:30 UTC
    Ask for a feature ... Write p6 tests

    It might also be helpful to point out that in #perl6 land, these two ideas usually go hand in hand. As Juerd says, the standard reply to a bug report is usually, "where's the test?" The standard reply to a feature request is usually the same. I believe the succinct way to say it is that autrijus trades implementation for tests. :-)

      I believe the succinct way to say it is that autrijus trades implementation for tests. :-)

      That is such a nice way to talk about TDD. I will have to steal it :-)

Re: Get Involved With Pugs
by brian_d_foy (Abbot) on May 11, 2005 at 18:40 UTC

    On the advocacy side, I would love to have a regular Pugs column in The Perl Review, along with other articles about Pugs and Perl 6 or Parrot.

    Frank Antonsen has been writing about functional programming, and has another article on parsing in the next issue, too. They aren't directly about Pugs or Haskell, but they talk about the change in mindset and perspective, and how you do things such as creating Pugs. :)

    --
    brian d foy <brian@stonehenge.com>
Re: Get Involved With Pugs
by tphyahoo (Vicar) on May 12, 2005 at 11:05 UTC
    pugs -e "{ 'Hello, ', @^x }.('World!').say"
    :)

    It took me about two hours to track down, install, and run "hello world" on pugs on windows.

    Now what?

    Look for something to do?

    Or slink off and wait?

    :)

      tphyahoo,
      You could play a game or you could try and one of the suggestions I listed in the root thread.

      Cheers - L~R

      You working on Win32 or Cygwin? I haven't been able to get Pugs working for Cygwin yet (due to GHC/Cygwin limitations).

      If you're not Cygwin, how do you use Pugs? On the Win32 commandline?


      • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
      • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"
        Win32. All I've done is
        pugs -e "{ 'Hello, ', @^x }.('World!').say"
        and yep, that was on the win32 commandline.
        This node was taken out by the NodeReaper on Thu May 12 12:27:02 2005 (EST)
        Reason: [tphyahoo]: duplicate, please reap.

        For more information on this node visit: this

      Now what?

      Out of all the fine suggestions offered by Limbic~Region, the one I personally like the best is the 6th. That is, port some Perl5 code to Perl6. Try to run it on Pugs. Frequently, you'll run into small bugs that will either be Pugs Bugs, or Perl6 Gotchas. These are both good things to find at this stage in the game. In either case, you would be best to write a test case demonstrating what you discovered. It may sound suspiciously like work, but in my experience, it's a lot of fun! :-)

Re: Get Involved With Pugs
by polettix (Vicar) on May 18, 2005 at 10:07 UTC
    One of things I were afraid of was that I did not understand the entire architecture very well - Pugs, Parrot, Ponie, Perl6... any more?

    But that was the dark side of lazyness, so I decided it was time to rise and see what has to be done. At the moment, I've been able to install it inside a user-space directory, which doesn't "clutter" the pseudo-production system I live in. I thought that it could be good to share this with you all, even if it's something that applies only here-and-now; just to take people lazier than me on the boat :)

    My procedure in Linux (Slackware, so no rpm-s or similars):

    Haskell is the first step. As of yesterday, version 6.4 is the latest available, so I link it here for your convenience. I appreciated the possibility to make in-place and avoid installing the package in a different place.
    cd $HOME/src/ghc-6.4 ./configure make in-place PATH="$PATH:$HOME/src/ghc-6.4/bin/i386-unknown-linux"
    I actually added the last line to $HOME/.bashrc as well (I don't still plan to use it inside crontab jobs :)

    Pugs README says that you need an additional library to do something that's obscure for me at the moment. But I wanted all whistles and bells, so I installed it as well:

    cd $HOME/src/ghc-6.4/hs-plugins-20050501 ./configure --prefix="$HOME/src/ghc-6.4/hs-plugins" make make install make register
    The last line is quite important, because it registers the library inside Haskell. I presume.

    Time for Parrot now. For what I understood, it's the foundation floor for all the Perl 6 stuff, so I decided to install it before the other floors :)

    perl Configure.pl --prefix="$HOME/sviluppo/parrot-0.2.0" make make test # make install
    Yes, last line is commented out. Which basically makes the prefix quite unuseful. Why? I don't know exactly, but it seems that Pugs feels more comfortable with the source tree of Parrot instead of the installed version - I had to fight with various errors in Pugs installation process before the light switched on. Good for me that I paid my dues to the local energy company.
    export PUGS_EMBED=parrot #export PARROT_PATH="$HOME/sviluppo/parrot-0.2.0" export PARROT_PATH="$HOME/src/parrot-0.2.0"
    These variables are needed for the following Pugs installation process. I decided to report all my installation process, so I report one more commented line, just to stress that the following Pugs installation process expects the path to the Parrot compilation directory instead of the installation one.

    Pugs, at last! The previous setup (HS library, environment variables) gets rid of scary messages about being forced to do thing manually...

    PUGSINSTALL="$HOME/sviluppo/pugs-6.2.3" perl Makefile.PL PREFIX="$PUGSINSTALL" DESTDIR="$PUGSINSTALL" make make test make install PATH="$PATH:$PUGSINSTALL/bin"
    Yes, I admit my ignorance, I really don't know the difference between PREFIX and DESTDIR, but without the latter the installation inside my home directory tree did not work :)
    The whole process requires some compiling but should go quite smooth; in about 1 hour you'd have pugs at your fingertips and start playing with hangman (in $HOME/src/Perl6-Pugs-6.2.3/examples/games), at last!

    Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

    Don't fool yourself.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://455979]
Approved by dug
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-09-21 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls