Version 23 (modified by fbrito, 4 years ago)

There is already a sentence starting with "once again" later

New parrot image

Newcomers Welcome!

We're going to do our best to document the experiences of newcomers to Perl, Parrot and Open Source software development. Hopefully this will evolve into a road map for those who wish to contribute but are having trouble getting started.

Before you start

Before you download and compile Parrot, you may want to check you system to make sure you have the following packages installed.

Getting Parrot

If your going to become part of the development team, you'll need to check out a local copy of the source code. You can visit the  download page on the main Parrot web site for full details.

Assuming you've got Perl, perldoc and Git installed you'll be doing something like this.

~$ git clone git://github.com/parrot/parrot.git
~$ cd parrot
~$ perl Configure.pl
~$ make
~$ make test
~$ make html

One make target to avoid right now is install. Running make install is not currently recommended.

A guide on how to use Git to work on Parrot can be found on  docs/git_workflow.pod

Running Parrot

Make compiled a binary in the parrot build directory.

~$ ./parrot --version

You may want to create a symbolic link to this binary, somewhere in your path, so that you can run parrot from anywhere.

~$ ln -s ~/parrot/parrot /usr/bin/parrot
~$ parrot --version

Learning Parrot

You've downloaded, configured, compiled, tested and created the html documentation for Parrot. Now it's time to start reading. Parrot's source documentation is stored in  POD format. If you ran make html you can the view the documentation in any HTML browser. The file docs/html/index.html is the place to start. An alternative and more flexible method for viewing the documentation is to use  perldoc to view the actual pod files, formatted as man pages. It cannot be stressed enough how important it is to read the documentation for this project.

The bare minimum reading needed to get you off the ground is:

The directory docs/book/ contains a book on Parrot. This book has a finer details of various aspects of Parrot. However be aware that the book in not up to date.

After you read those, you'll want to run through all of the tutorials in examples/tutorial.

Next on your reading list should be the PDDs (Parrot Design Documents) in docs/ppds. You will learn much by reading these, so don't skimp.

You'll probably need to read some of Parrot's code.  This article will give you some tips on how to do so effectively.

Contributing

By now you've read the introductory documentation and reviewed the example/tutorial files. Now you have to decide what area of the project you'd like to contribute to.

Test Suite

Original Parrot tests were written in Perl. Those Perl tests can be ported to PIR test. This is a good place to earn your feathers and learn more PIR at the same time. ConvertTestsToParrot covers what you'll need to know about the format of a PIR test. If you're not familiar with the test suite functions, you'll want to review parrot/runtime/library/Test/More.pir. The functions section gives a description of the different testing functions, mainly: plan, diag, ok, nok, is, is_deeply, like, isa_ok, skip, isnt and todo. This is a good time to point out that POD can and usually is embedded in PIR files. So if you're in the root build directory, you can run the following to view the module documentation:

~$ perldoc runtime/parrot/library/Test/More.pir

You already know that make test runs the test suite, but when working on individual tests you'll want to run only the test you're concerned with. You can do this using Perl's  prove for a Perl test, or either prove or Parrot itself for PIR tests.

~$ prove t/oo/names.t
t/oo/names....ok                                                             
All tests successful.
Files=1, Tests=2,  0 wallclock secs ( 0.05 cusr +  0.01 csys =  0.06 CPU)

or

~$ parrot t/oo/names.t
1..2
ok 1 - HLL obj w/ name different than parrot obj created
ok 2 - HLL obj w/ same name as parrot obj not created

More information about the subject can be found on our docs/ folder. More precisely, here:  docs/tests.pod

Test Conversion

Here is the original Perl test.

 names.t.orig

Here is the same test after being converted to PIR:

 names.t

Submitting your work

Once again there is a POD covering this topic. Read  docs/submissions.pod for specific details on how to submit your work. In general you'll need to create a patch and then email that patch to perlbug.

~$ git status
~$ git diff > names_test_rewrite.patch
~$ diffstat names_test_rewrite.patch
 names.t |   63 +++++++++++++++++++++++++++++++++------------------------------
 1 file changed, 33 insertions(+), 30 deletions(-)

 names_test_rewrite.patch

This section is outdated, and refers to our old RT system; it should be updated to refer to trac. (Or just removed in favor of updating the POD in the repo.

Then you'll need to send an email, with the patch as an attachment, to Parrotbug. It should look something like this.

from	Your Name <your.name at gmail.com>
to	parrotbug at parrotcode.org
subject	[PATCH] rewrite of names.t to PIR
	
This is a rewrite of t/oo/names.t from a perl test to a PIR test

 names.t |   63 +++++++++++++++++++++++++++++++++------------------------------
 1 file changed, 33 insertions(+), 30 deletions(-)

--

Parrotbug will autoreply to your submission with an RT Ticket Id. Here's an example of a typical response.

Greetings,

This message has been automatically generated in response to the
creation of a parrotbug regarding:
       "[PATCH] rewrite of names.t to PIR"

There is no need to reply to this message right now.  Your ticket has been
assigned an ID of [perl #60512].

Please include the string:
        [perl #60512]
In the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

                       Thank you,
                         parrotbug

http://rt.perl.org/rt3/Ticket/Display.html?id=60512

It's that simple.

Attachments