<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title><![CDATA[Perl 6: Roadmap to helping with Development]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?roadmap_to_helping_with_development</link>
<description></description>
<pubDate>Mon, 08 Mar 2010 02:18:15 -0000</pubDate>
<webMaster>synedra@gmail.com</webMaster>
<generator>Socialtext Workspace v2.14.7.2</generator>

<item>
<title><![CDATA[Roadmap to helping with Development]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?roadmap_to_helping_with_development</link>
<description><![CDATA[<div class="wiki">
<div class="nlw_phrase"><table class='toc'><tr><td><div class="wiki">
<h3 id="contents">Contents: []</h3>
<ul>
<li><span class="nlw_phrase"><a title="section link" href="#perl_6_roadmap_to_helping_with_development">Perl 6 Roadmap to helping with Development</a><!-- wiki: {link: [] Perl 6 Roadmap to helping with Development} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="#background_things_you_need">Background: Things you need</a><!-- wiki: {link: [] Background: Things you need} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="#installing_subversion">Installing Subversion</a><!-- wiki: {link: [] Installing Subversion} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#installing_git">Installing git</a><!-- wiki: {link: [] Installing git} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#installing_mingw_gcc_compiler">Installing MinGW (gcc compiler)</a><!-- wiki: {link: [] Installing MinGW (gcc compiler)} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#installing_msys_windows_versions_of_bash_etc">Installing MSYS (windows versions of bash, etc)</a><!-- wiki: {link: [] Installing MSYS (windows versions of bash, etc)} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#installing_haskell">Installing Haskell</a><!-- wiki: {link: [] Installing Haskell} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#installing_perl_5">Installing Perl 5</a><!-- wiki: {link: [] Installing Perl 5} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#installing_iis">Installing IIS</a><!-- wiki: {link: [] Installing IIS} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#installing_apache">Installing Apache</a><!-- wiki: {link: [] Installing Apache} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#getting_pugs_source">Getting Pugs source</a><!-- wiki: {link: [] Getting Pugs source} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#building_pugs">Building Pugs</a><!-- wiki: {link: [] Building Pugs} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#getting_rakudo_source">Getting Rakudo source</a><!-- wiki: {link: [] Getting Rakudo source} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#building_rakudo">Building Rakudo</a><!-- wiki: {link: [] Building Rakudo} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#building_parrot">Building Parrot</a><!-- wiki: {link: [] Building Parrot} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#getting_perl_5_source">Getting Perl 5 source</a><!-- wiki: {link: [] Getting Perl 5 source} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#setting_up_pugs_with_apache_through_cgi">Setting up Pugs with Apache through CGI</a><!-- wiki: {link: [] Setting up Pugs with Apache through CGI} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#setting_up_rakudo_with_apache_through_cgi">Setting up Rakudo with Apache through CGI</a><!-- wiki: {link: [] Setting up Rakudo with Apache through CGI} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#setting_up_pugs_with_iis_through_cgi">Setting up Pugs with IIS through CGI</a><!-- wiki: {link: [] Setting up Pugs with IIS through CGI} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#setting_up_rakudo_with_iis_through_cgi">Setting up Rakudo with IIS through CGI</a><!-- wiki: {link: [] Setting up Rakudo with IIS through CGI} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#reviewing_existing_synopses">Reviewing existing synopses</a><!-- wiki: {link: [] Reviewing existing synopses} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#reviewing_existing_spectests">Reviewing existing spectests</a><!-- wiki: {link: [] Reviewing existing spectests} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#writing_spec_for_a_new_feature">Writing Spec for a new feature</a><!-- wiki: {link: [] Writing Spec for a new feature} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#writing_spec_tests">Writing Spec tests</a><!-- wiki: {link: [] Writing Spec tests} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#submitting_bug_reports_for_rakudo">Submitting BUG reports for Rakudo</a><!-- wiki: {link: [] Submitting BUG reports for Rakudo} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#writing_a_new_feature_for_rakudo">Writing a new feature for Rakudo</a><!-- wiki: {link: [] Writing a new feature for Rakudo} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#submitting_bug_reports_for_parrot">Submitting BUG reports for Parrot</a><!-- wiki: {link: [] Submitting BUG reports for Parrot} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#learning_parrot">Learning Parrot</a><!-- wiki: {link: [] Learning Parrot} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#learning_perl_6">Learning Perl 6</a><!-- wiki: {link: [] Learning Perl 6} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#learning_c">Learning C</a><!-- wiki: {link: [] Learning C} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="#learning_haskell">Learning Haskell</a><!-- wiki: {link: [] Learning Haskell} --></span></li>
</ul></ul></ul>
</div>
</td></tr></table><!-- wiki: {toc: } --></div><br /><br /><h1 id="perl_6_roadmap_to_helping_with_development">Perl 6 Roadmap to helping with Development</h1>
<p>
Note: This guide is a draft work in progress. I myself develop locally on my Vista laptop and desktops and publish to my Linux servers. So this guide describes how to do things on Vista. It would be good if someone could supplement the guide with Linux examples.</p>
<p>
When I decided to help with Perl 6 development I didn't know where to begin. I thought it'd be useful to other people if I documented the things I learned along the way into a guide.</p>
<h2 id="background_things_you_need">Background: Things you need</h2>
<p>
The two main Perl 6 implementations are Pugs and Rakudo.</p>
<p>
Pugs (Perl 6 users golfing system) is built on Haskell</p>
<p>
Rakudo is build on parrot, the VM that was designed for it and any scripting language</p>
<p>
Pugs site is at:-<br />
<a target="_blank" title="(external link)" href="http://www.pugscode.org/">http://www.pugscode.org/</a></p>
<p>
The latest development code is in a subversion repository at:-<br />
<a target="_blank" title="(external link)" href="http://svn.pugscode.org/pugs/">http://svn.pugscode.org/pugs/</a></p>
<p>
Rakudo is at:-<br />
<a target="_blank" title="(external link)" href="http://www.rakudo.org">http://www.rakudo.org</a></p>
<p>
The latest development code is in a github repository at:-<br />
<a target="_blank" title="(external link)" href="http://github.com/rakudo/rakudo/tree/master">http://github.com/rakudo/rakudo/tree/master</a></p>
<p>
Pugs came about well before Rakudo while Parrot was in initial development<br />
Due to this, and Rakudo not wanting to duplicate things, the main specification test, documents, etc are in the Pugs repository only.</p>
<p>
So you are going to need both subversion (SVN) and git so you can easily keep up to date with the latest development release. Both programs have lots of features and functionality. I'm only going to cover the bits you need.</p>
<h3 id="installing_subversion">Installing Subversion</h3>
<p>
SVN is available from <a target="_blank" title="(external link)" href="http://subversion.tigris.org/">http://subversion.tigris.org/</a></p>
<p>
I'm running Vista so I downloaded (depending on how old this guide is, the version number you see might be a lot newer):-</p>
<p>
svn-win32-1.6.0.zip<br />
svn-win32-1.6.0_dev.zip<br />
svn-win32-1.6.0_pl.zip<br />
from:-<br />
<a target="_blank" title="(external link)" href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100">http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100</a></p>
<p>
And unzipped them all to:-<br />
C:\Program Files\svn<br />
Which created the folder<br />
C:\Program Files\svn\svn-win32-1.6.0</p>
<p>
I then added C:\Program Files\svn\svn-win32-1.6.0\bin to my PATH. <br />
(Update your path environment variable to include this folder on the end. In Vista32 in go Start-&gt;(Right click on)Computer-&gt;Properties-&gt;Advanced System Settings, then click the Advanced tab at the top of the window, then the Environment Variables button near the bottom. Finally under 'System Variables' scroll to find Path, select then click the edit button. Scroll to the end of the list and add &quot;;C:\Program Files\svn\svn-win32-1.6.0\bin&quot;. Click Ok and Ok again. You may need to reboot for this to take full effect.)</p>
<h3 id="installing_git">Installing git</h3>
<p>
You'll want a github account. Visit <a target="_blank" title="(external link)" href="http://www.github.com">http://www.github.com</a> to signup for free.</p>
<p>
Github provides a guide for installing and using git on windows<br />
<a target="_blank" title="(external link)" href="http://github.com/guides/using-git-and-github-for-the-windows-for-newbies">http://github.com/guides/using-git-and-github-for-the-windows-for-newbies</a></p>
<p>
You can follow that or my version is here. For windows there is a version called msysgit available from<br />
<a target="_blank" title="(external link)" href="http://code.google.com/p/msysgit/downloads/list">http://code.google.com/p/msysgit/downloads/list</a><br />
At this time all versions are beta, so I grabbed the latest Git-1.6.2.2-preview20090408.exe<br />
I ran the installer, selecting 'C:\Program Files\git', 'Use Git Bash only' and 'Unix style line endings'.</p>
<p>
Rather than using the command prompt like with SVN, this version of Git will install a separate Linux style Bash to use.</p>
<p>
Git wants you to have your own SSH-key. Open Git (Start-&gt;All Programs-&gt;Git-&gt;Git Bash). type:-<br />
ssh-keygen -C &quot;<a href="mailto:your@email.com">your@email.com</a>&quot; -t rsa<br />
Swapping <a href="mailto:your@email.com">your@email.com</a> for your email address. It'll prompt you to 'Enter file in which to save the key ...' Just hit enter for the default. Then it'll ask for a password and confirmation.<br />
To be able to push your changes back onto github you'll need to save your public ssh key in your github settings. Login to github, click on 'account' (top right). There is a box titled &quot;SSH Public Keys&quot;, click on add. Now you need to copy and paste the key you created into the box. Open the file C:\Users\YOURUSERNAME\.ssh\id_rsa.pub with a text editor (notepad), select all, copy and then paste it into github. I called mine main key. Then click 'Add Key'.</p>
<p>
You'll also what git to remember who you are. To do this you need to set some global config with:-<br />
git config --global user.name &quot;YOURUSERNAME&quot;<br />
git config --global user.email &quot;<a href="mailto:your@emailaddress.com">your@emailaddress.com</a>&quot;</p>
<h3 id="installing_mingw_gcc_compiler">Installing MinGW (gcc compiler)</h3>
<p>
You'll need to be able to compile parrot which is in c. On Linux your probably already have gcc installed, if not you can grab a package from your distro. On windows gcc is packaged as MinGW and available from:-<br />
<a target="_blank" title="(external link)" href="http://www.mingw.org/wiki/MinGW">http://www.mingw.org/wiki/MinGW</a></p>
<p>
I downloaded the Automated MinGW Installer and ran it selecting a full install to c:\MinGW.<br />
<a target="_blank" title="(external link)" href="http://sourceforge.net/project/showfiles.php?group_id=2435">http://sourceforge.net/project/showfiles.php?group_id=2435</a></p>
<p>
Then update your PATH to include c:\MinGW\bin (same process as we did for SVN).</p>
<p>
It's probably a good idea to also download the GNU Source-Level Debugger from MinGW's downloads page. I grabbed gdb-6.8-mingw-3.tar.bz2 and extracted to c:\MinGW with winrar.</p>
<h3 id="installing_msys_windows_versions_of_bash_etc">Installing MSYS (windows versions of bash, etc)</h3>
<p>
MSYS is part of the MingGW project and can be downloaded from their site:-<br />
<a target="_blank" title="(external link)" href="http://sourceforge.net/project/showfiles.php?group_id=2435">http://sourceforge.net/project/showfiles.php?group_id=2435</a><br />
I found the download options a bit confusing. You need to click on &quot;MSYS Base System&quot;, then msysCORE-1.0.11-20080826.tar.gz.</p>
<p>
Extract to C:\msys<br />
The from command prompt run<br />
cd \msys\postinstall<br />
pi.bat</p>
<p>
This runs the postinstall script that ties MSYS in with MinGW. The options I gave were:-<br />
y<br />
c:/mingw</p>
<p>
I updated my Windows path to include c:\msys</p>
<h3 id="installing_haskell">Installing Haskell</h3>
<p>
Pugs is built in Haskell, so you'll need the Haskell compiler to build it.<br />
<a target="_blank" title="(external link)" href="http://www.haskell.org/ghc/download.html">http://www.haskell.org/ghc/download.html</a><br />
Note: At time of writing there is an issue with Haskell v 6.10.x (<a target="_blank" title="(external link)" href="http://hackage.haskell.org/trac/ghc/ticket/3162">http://hackage.haskell.org/trac/ghc/ticket/3162</a>), I had to redo my whole pugs build with Haskell 6.8.3 from<br />
<a target="_blank" title="(external link)" href="http://www.haskell.org/ghc/dist/6.8.3/ghc-6.8.3-i386-windows.exe">http://www.haskell.org/ghc/dist/6.8.3/ghc-6.8.3-i386-windows.exe</a></p>
<p>
I ran the installer and installed to C:\ghc\ghc-6.8.3</p>
<h3 id="installing_perl_5">Installing Perl 5</h3>
<p>
You'll need Perl 5 but I'll assume you have that already. I'm using ActivePerl 5.10</p>
<h3 id="installing_iis">Installing IIS</h3>
<p>
Not all copies on Windows come with IIS, if yours doesn't then skip to installing Apache.</p>
<p>
<em>Vista home premium and above</em></p>
<p>
From the Control Panel select &quot;Programs and Features&quot;. On the left there is a link to &quot;Turn Windows features on or off&quot;. Check the box for &quot;Internet Information Services&quot;, if you get a blue square rather than a tick, expand the option and manually select all the sub options. Click on ok, you may need your Vista CD to complete this operation.</p>
<p>
Once installed you can test by opening your browser and typing the address &quot;localhost&quot;.</p>
<h3 id="installing_apache">Installing Apache</h3>
<p>
Download the latest Apache from:-<br />
<a target="_blank" title="(external link)" href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a></p>
<p>
For me this was Apache 2.2.11, I grabbed the windows installer with openssl apache_2.2.11-win32-x86-openssl-0.9.8i.msi</p>
<p>
I installed to the default place as a service on port 80, which conflicted with IIS, but I'll changed that in the config after. I'm also going to move the htdocs and cgi-bin folders and enable cgi scripts in all folders.<br />
Open C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf<br />
Change the lines:-<br />
<em>Listen 80</em><br />
to <em>Listen 8080</em><br />
<em>DocumentRoot &quot;C:/Program Files/Apache Software Foundation/Apache2.2/htdocs&quot;</em><br />
to <em>DocumentRoot &quot;C:/htdocs&quot;</em><br />
<em>&lt;Directory &quot;C:/Program Files/Apache Software Foundation/Apache2.2/htdocs&quot;&gt;</em><br />
to <em>&lt;Directory &quot;C:/htdocs&quot;&gt;</em><br />
<em>Options None</em><br />
to <em>Options Indexes Includes FollowSymLinks ExecCGI</em><br />
<em>&lt;Directory &quot;C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin&quot;&gt;</em><br />
to <em>&lt;Directory &quot;C:/htdocs/cgi-bin&quot;&gt;</em><br />
<em>#AddHandler cgi-script .cgi</em><br />
to <em>AddHandler cgi-script .cgi .pl</em></p>
<p>
Move the folder C:\Program Files\Apache Software Foundation\Apache2.2\htdocs to C:\htdocs and C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin to C:\htdocs\cgi-bin</p>
<p>
Restart/Start Apache (you should have a icon for this in your system tray).<br />
You can test in your browser by opening <a target="_blank" title="(external link)" href="http://localhost:8080/">http://localhost:8080/</a></p>
<h3 id="getting_pugs_source">Getting Pugs source</h3>
<p>
The Pugs repo contains the latest spec and tests. So even if you don't plan on building pugs you'll still want to keep an updated copy of the latest source.</p>
<p>
Open a command prompt, I'm downloading pugs to c:\temp so I ran:-</p>
<p>
cd \<br />
mkdir temp<br />
cd temp<br />
svn co <a target="_blank" title="(external link)" href="http://svn.pugscode.org/pugs/">http://svn.pugscode.org/pugs/</a> pugs</p>
<p>
That last command called SVN and tells it to grab the latest version of Pugs and put it in a sub folder called pugs. It'll probably take a while.</p>
<p>
From then on you can just update your local copy with<br />
cd \temp\pugs<br />
svn update</p>
<h3 id="building_pugs">Building Pugs</h3>
<p>
This guide is based on pugs Pugs-6.2.13.14 and Vista32. In the end I didn't actually manage to get it to build. If you do manage it please let me know.</p>
<p>
If you are happy with a working Pugs that is a bit older, then you a download a pre-built binary from:-<br />
<a target="_blank" title="(external link)" href="http://jnthn.net/perl6/">http://jnthn.net/perl6/</a><br />
I installed that to c:\temp\pugs_bin</p>
<p>
There is a program for Haskell called Cabal. It's the recommended way to build Pugs so we'll have to grab that.<br />
Grab the Cabal source Package from the bottom of:-<br />
<a target="_blank" title="(external link)" href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Cabal">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Cabal</a><br />
Extract to C:\ghc<br />
Then in a command prompt:-<br />
cd \ghc\Cabal-1.6.0.3\<br />
ghc --make Setup<br />
Setup configure --user --prefix=&quot;c:\ghc\cabal&quot;<br />
Setup build<br />
Setup install</p>
<p>
We need to do the same for 3 other packages:-<br />
<a target="_blank" title="(external link)" href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP</a><br />
Extract to C:\ghc<br />
Then in a command prompt:-<br />
cd \ghc\HTTP-4000.0.5\<br />
ghc --make Setup<br />
Setup configure --user --prefix=&quot;c:\ghc\http&quot;<br />
Setup build<br />
Setup install</p>
<p>
<a target="_blank" title="(external link)" href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib</a><br />
Extract to C:\ghc<br />
Then in a command prompt:-<br />
cd \ghc\zlib-0.5.0.0\<br />
ghc --make Setup<br />
Setup configure --user --prefix=&quot;c:\ghc\zlib&quot;<br />
Setup build<br />
Setup install</p>
<p>
<a target="_blank" title="(external link)" href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cabal-install">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cabal-install</a><br />
Extract to C:\ghc<br />
Then in a command prompt:-<br />
cd \ghc\cabal-install-0.6.2\<br />
ghc --make Setup<br />
Setup configure --user --prefix=&quot;c:\ghc\cabal-install&quot;<br />
Setup build<br />
Setup install</p>
<p>
This creates a new executable called cabal.exe in c:\ghc\cabal-install\bin. I'm adding this to my sessions path to make calling it easier:-</p>
<p>
set path=%path%;c:\ghc\cabal-install\bin</p>
<p>
Now to build pugs run:-</p>
<p>
cabal update<br />
cabal install pugs</p>
<p>
NOTE: This didn't work for me. Some of the packages failed to install due to regex-pcre-builtin. So I built it manually like the previous packages:-</p>
<p>
<a target="_blank" title="(external link)" href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/regex-pcre-builtin">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/regex-pcre-builtin</a><br />
Extract to C:\ghc<br />
Then in a command prompt:-<br />
cd \ghc\regex-pcre-builtin-0.94.2.0.7.7\<br />
ghc --make Setup<br />
Setup configure --user --prefix=&quot;c:\ghc\pcre&quot;</p>
<p>
This failed. After a lot of testing and installing different versions of pcre. I found the line in regex-pcre-builtin.cabal causing the problem was <br />
&quot;Includes: pcre&quot;<br />
If I changed this to <br />
&quot;Includes: pcre/pcre.h&quot;<br />
it would build, but I don't think this is the proper solution...</p>
<p>
Setup configure --user --prefix=&quot;c:\ghc\pcre&quot;<br />
Setup build<br />
Setup install</p>
<p>
cabal install pugs</p>
<p>
Still gave me an error on perl5/p5embed.h, i got past this by doing</p>
<p>
cabal install pugs --extra-include-dirs=/perl/lib<br />
/CORE --extra-lib-dirs=/perl/lib/CORE</p>
<p>
But was then hit by a slough of errors. Much kudos to anyone who gets this to build natively on windows (not under cygwin).</p>
<h3 id="getting_rakudo_source">Getting Rakudo source</h3>
<p>
Open Git Bash, I'm downloading Rakudo to c:\temp so I ran (note slashes are other way around):-</p>
<p>
cd /c<br />
mkdir temp<br />
cd temp<br />
git clone git://github.com/rakudo/rakudo.git</p>
<p>
(for some reason if you cd / then ls it doesn't show c, but it's there, just try to cd to it)</p>
<p>
From then on you can just update your local copy with<br />
cd /c/temp/rakudo<br />
git pull</p>
<h3 id="building_rakudo">Building Rakudo</h3>
<p>
Open a command prompt, navigate to your Rakudo source:-<br />
cd \temp\rakudo<br />
perl Configure.pl --gen-parrot<br />
mingw32-make</p>
<p>
This will also download and build the appropriate version of parrot to \temp\rakudo\parrot. It'll probably take a while. Then the mingw32-make will build you a working perl6.exe</p>
<p>
Save this as hello.p6<br />
<em>say 'hello it works';</em></p>
<p>
Test it by running<br />
cd \temp\rakudo<br />
perl6 hello.p6</p>
<h3 id="building_parrot">Building Parrot</h3>
<p>
Parrot gets built as part of the Rakudo install. However this isn't usually the most up to date parrot available, just the one that has been tested to work well with the latest Rakudo. You may want to update your copy of parrot. <br />
However be warned that this may break the Rakudo build.<br />
Open a command prompt:-<br />
cd \temp\rakudo\parrot<br />
svn update<br />
mingw32-make realclean<br />
perl Makefile.PL<br />
mingw32-make</p>
<p>
If you want Rakudo to link against this newer version of Parrot, you'll need to rebuild it by:-<br />
cd \temp\rakudo<br />
mingw32-make realclean<br />
perl Configure.pl<br />
mingw32-make</p>
<p>
If either of those do fail. Then try doing a realclean before building again:-<br />
mingw32-make realclean<br />
perl Configure.pl<br />
mingw32-make</p>
<h3 id="getting_perl_5_source">Getting Perl 5 source</h3>
<p>
It's worth grabbing the Perl 5 source even if you aren't going to build it. When you get to writing spec tests it can be useful to look at what the Perl 5 tests are doing. Open Git Bash, then:-<br />
cd /c/temp/<br />
git clone git://perl5.git.perl.org/perl.git perl5</p>
<h3 id="setting_up_pugs_with_apache_through_cgi">Setting up Pugs with Apache through CGI</h3>
<p>
By default Apache will act like Linux and check the top of each cgi script for the path to it's interpreter. So simply saving your pugs file as .cgi and having the correct shebang should be enough. Although to keep things clearer, I updated my Apache config to treat .pugs files as .cgi also. Do this by editing the line:-<br />
AddHandler cgi-script .cgi .pl<br />
and adding .pugs to the end:-<br />
AddHandler cgi-script .cgi .pl .pugs<br />
You'll need to restart Apache for this change to take effect. A simple Perl 6 CGI hello world script is (your path to pugs might be different):-</p>
<p>
_#!c:/temp/pugs_bin/pugs.exe_<br />
<em>print &quot;Content-Type: text/html\r\n\r\n&quot;;</em><br />
<em>print 'hello it works';</em></p>
<p>
Save that as hello.pugs and put in your Apache cgi-bin (such as c:\htdocs\cgi-bin). Then open it in your browser <a target="_blank" title="(external link)" href="http://localhost:8080/cgi-bin/hello.pugs">http://localhost:8080/cgi-bin/hello.pugs</a></p>
<h3 id="setting_up_rakudo_with_apache_through_cgi">Setting up Rakudo with Apache through CGI</h3>
<p>
By default Apache will act like Linux and check the top of each cgi script for the path to it's interpreter. So simply saving your rakudo file as .cgi and having the correct shebang should be enough. Although to keep things clearer, I updated my Apache config to treat .p6 files as .cgi also. Do this by editing the line:-<br />
AddHandler cgi-script .cgi .pl .pugs<br />
and adding .p6 to the end:-<br />
AddHandler cgi-script .cgi .pl .pugs .p6<br />
You'll need to restart Apache for this change to take effect. A simple Perl 6 CGI hello world script is (your path to Rakudo might be different):-</p>
<p>
<em>#!c:/temp/rakudo/perl6.exe</em><br />
<em>print &quot;Content-Type: text/html\r\n\r\n&quot;;</em><br />
<em>print 'hello it works';</em></p>
<p>
Save that as hello.p6 and put in your Apache cgi-bin (such as c:\htdocs\cgi-bin). Then open it in your browser <a target="_blank" title="(external link)" href="http://localhost:8080/cgi-bin/hello.p6">http://localhost:8080/cgi-bin/hello.p6</a></p>
<h3 id="setting_up_pugs_with_iis_through_cgi">Setting up Pugs with IIS through CGI</h3>
<p>
Open up IIS7 services manager. Then select the website from the left panel (for me it's under COMPNAME-&gt;Sites-&gt;Default Website). In the center panel there is a link for 'handler mappings', double click. Top right click on 'Add script map' and fill in:-<br />
Request Path: *.pugs<br />
Executable: C:\temp\pugs_bin\pugs.exe &quot;%s&quot; %s<br />
Name: Pugs</p>
<p>
When I clicked OK a message popped up asking &quot;Do you want to allow this ISAPI extention?&quot; I clicked Yes.</p>
<p>
A simple Perl 6 CGI hello world script is (the shebang doesn't matter on IIS):-</p>
<p>
<em>#!pugs</em><br />
<em>print &quot;Content-Type: text/html\r\n\r\n&quot;;</em><br />
<em>print 'hello it works';</em></p>
<p>
Save that as hello.pugs and put in your inetpub cgi-bin (such as c:\inetpub\wwwroot\cgi-bin). Then open it in your browser <a target="_blank" title="(external link)" href="http://localhost/cgi-bin/hello.pugs">http://localhost/cgi-bin/hello.pugs</a></p>
<h3 id="setting_up_rakudo_with_iis_through_cgi">Setting up Rakudo with IIS through CGI</h3>
<p>
Open up IIS7 services manager. Then select the website from the left panel (for me it's under COMPNAME-&gt;Sites-&gt;Default Website). In the center panel there is a link for 'handler mappings', double click.<br />
Top right click on 'Add script map' and fill in:-<br />
Request Path: *.p6<br />
Executable: C:\temp\rakudo\perl6.exe &quot;%s&quot; %s<br />
Name: Rakudo</p>
<p>
When I clicked OK a message popped up asking &quot;Do you want to allow this ISAPI extention?&quot; I clicked Yes.</p>
<p>
A simple Perl 6 CGI hello world script is (the shebang doesn't matter on IIS):-</p>
<p>
<em>#!perl6</em><br />
<em>print &quot;Content-Type: text/html\r\n\r\n&quot;;</em><br />
<em>print 'hello it works';</em></p>
<p>
Save that as hello.p6 and put in your inetpub cgi-bin (such as c:\inetpub\wwwroot\cgi-bin). Then open it in your browser <a target="_blank" title="(external link)" href="http://localhost/cgi-bin/hello.p6">http://localhost/cgi-bin/hello.p6</a></p>
<h3 id="reviewing_existing_synopses">Reviewing existing synopses</h3>
<p>
When we grabbed to Pugs source we got the latest synopses files. If you put them in the same place as me then you'll find them in C:\temp\pugs\docs\Perl6\Spec. Each file is in the POD format you'll be accustomed to from Perl 5. The easiest way to view these files is with perldoc, open a command prompt:-<br />
cd \temp\pugs\docs\Perl6\Spec<br />
perldoc S01-overview.pod</p>
<p>
If you prefer viewing things in html you can do<br />
pod2html S01-overview.pod &gt; S01-overview.html<br />
Then open in your browser.</p>
<p>
You can also view the files online directly from the Pugs SVN repo. <br />
<a target="_blank" title="(external link)" href="http://svn.pugscode.org/pugs/docs/Perl6/Spec/">http://svn.pugscode.org/pugs/docs/Perl6/Spec/</a></p>
<p>
Or online in HTML format at:-<br />
<a target="_blank" title="(external link)" href="http://perlcabal.org/syn/">http://perlcabal.org/syn/</a></p>
<h3 id="reviewing_existing_spectests">Reviewing existing spectests</h3>
<p>
TODO</p>
<h3 id="writing_spec_for_a_new_feature">Writing Spec for a new feature</h3>
<p>
You may find (like I did) that a feature you need is currently missing from Perl 6. I asked about it on the #perl6 IRC channel, they suggested that I write the spec for it. When I asked what to do pmichaud (Dr. Patrick Michaud the Perl 6 pumpking) told me:-<br />
<em>Review existing synopses and spectests to see if the feature has already been worked on if yes, then see if it makes sense and point the developers at it.</em><br />
<em>&quot;point the developers&quot; generally means &quot;file a ticket&quot; if there's nothing existing for the feature, then draft what you think chdir should look like. To draft it, look at other functions in S32 or other places to see how they've been documented.</em></p>
<p>
<em>Also, we don't completely ignore Perl 5 -- so look at Perl 5's documentation and see if you think it makes sense for Perl 6 and just try to adapt it to a Perl 6 sort of idea</em></p>
<p>
The first function I wrote a bit of spec for was chdir. I edited the S32-setting-library\IO.pod file to add in a definition. Now that I'd made changes I needed to use SVN to commit them to the main Pugs repo. First I went onto IRC #perl6 and was given commitbit access (thanks particle). Next I opened a command prompt:-<br />
cd \temp\pugs\docs\Perl6\Spec\S32-setting-library<br />
svn commit -m &quot;added spec for chdir&quot; --username=YOURUSERNAME</p>
<p>
This prompted me for a password and then committed my changes.</p>
<p>
If I'd added a new file rather than just updating an old one, I would have to of added it to the repo first with<br />
svn add filename<br />
And then done the commit.</p>
<h3 id="writing_spec_tests">Writing Spec tests</h3>
<p>
Perl 6 tests work much the same way as Perl 5 tests. If you want to add tests for a new feature, or just to fill out what's already there, you'll need to make sure you have the latest Pugs checked out. In a command prompt:-<br />
cd \temp\pugs<br />
svn update</p>
<p>
Spec tests can be found in t\Spec\</p>
<p>
A very useful tool you can use to see what is already there is ack. If you haven't already installed ack from CPAN you can download it with:-<br />
ppm install ack</p>
<p>
From then on you can do fast grep like searches. Such as (looking for spec tests that involve chdir):-<br />
cd \temp\pugs<br />
ack chdir t/spec</p>
<p>
Which will return a list of files and lines that contain the phrase 'chdir'. There might also be some older tests written for Pugs that have not yet been updated into the spec, so it's worth also running:-<br />
cd \temp\pugs<br />
ack chdir t/</p>
<p>
If nothing comes up you can search on similar features to see what their tests are like. Also if you downloaded the Perl 5 source it's worth seeing how they did it:-<br />
cd \temp\perl5<br />
ack chdir t/</p>
<p>
To write tests for chdir, I realized that I'd need to know the current working directory. So the first tests I wrote were actually for $*CWD:-</p>
<p>
<em>use v6;</em></p>
<p>
<em>use Test;</em></p>
<p>
<em>plan 2;</em></p>
<p>
<em># $*CWD is currently just a string</em></p>
<p>
<em>ok( defined($*CWD), 'we have something in our $CWD');</em></p>
<p>
<em>### Get CWD from parrot</em></p>
<p>
<em>my $cwd = Q:PIR {</em><br />
_ $P0 = new <a href="http://www.perlfoundation.org/perl6/index.cgi?'OS'" title="[click to create page]" class="incipient">'OS'</a>_<br />
_ $S0 = $P0.'cwd'()_<br />
_ %r = box $S0_<br />
<em>};</em><br />
<em>is($*CWD, $cwd, 'matches CWD from parrot');</em></p>
<p>
Test.pm in Perl 6 it like Test::More in Perl 5. I also used Q:PIR to do some inline Parrot. This was saved to t/Spec/S28-named-variables/cwd.t. To upload the new test I opened a command prompt:-</p>
<p>
cd \temp\pugs<br />
svn update<br />
svn status</p>
<p>
The output from svn status gave me a list of files starting with a ? which means they exist in my local folder, but aren't actually a part of the local svn repo. One of them was t/Spec/S28-named-variables/cwd.t, so I added it to the repo with:-</p>
<p>
svn add t/Spec/S28-named-variables/cwd.t</p>
<p>
And then uploaded with:-</p>
<p>
svn commit -m &quot;added spec test for $*CWD&quot; --username=YOURUSERNAME</p>
<h3 id="submitting_bug_reports_for_rakudo">Submitting BUG reports for Rakudo</h3>
<p>
Are you on the latest Rakudo? Rakudo get's updated frequently as it's developed, before submitting your bug make sure it hasn't been fixed in the latest release. See the section Getting Rakudo Source and Building Rakudo for instructions on how to update your copy to the latest release.</p>
<p>
If you're sure you've found a bug, then first you need to check if it's already been submitted. You can do this by searching the Perl 6 RT (Request Tracker) at <a target="_blank" title="(external link)" href="http://rt.perl.org/rt3">http://rt.perl.org/rt3</a>.</p>
<p>
If the bug isn't in there already, you can submit it by emailing <a href="mailto:rakudobug@perl.org">rakudobug@perl.org</a>. Make sure your subject begins with <span class="nlw_phrase">[BUG]<!-- wiki: {{[BUG]}} --></span> so that it gets picked up properly by RT and that you send in plain text not html. Your report should include:-<br />
Rakudo commit version<br />
 Get this by opening git bash, navigating to <br />
 /c/temp/rakudo<br />
 and typing <br />
 git log<br />
 The first commit hash you see in the form<br />
 commit long_alpha_number<br />
 is the one you want<br />
Parrot revision number<br />
 Get this by opening a command prompt, navigating to<br />
 cd \temp\rakudo\parrot<br />
 and typing<br />
 svn info<br />
A description of the bug<br />
Error messages<br />
Your environment (OS, etc)<br />
Example code</p>
<p>
Depending on what kind of bug you've found, consider writing a test for it. Tests make the bug easier to fix and help prevent it reocurring in the future.</p>
<h3 id="writing_a_new_feature_for_rakudo">Writing a new feature for Rakudo</h3>
<p>
To write code for Rakudo you need to know Parrot (see learning Parrot below). For me, while trying to figure out how to write spec tests for chdir, I found out how to do chdir in Parrot. Therefor I knew most of what was needed to add this feature to Rakudo. After looking through the Rakudo source, and comparing to the synopsis (don't always expect these to match) I came across 'unlink' in src/builtins/io.pir. The synopsis put chdir and unlink in the same boat, so I guessed this was the best place to put it. After checking with the people on IRC the feeling was generally 'if you aren't sure, add the feature... someone else can always move it later down the line'.<br />
 I added chdir, and after and few rebuilds and tests I got it working. Now I just needed to get it commited to the main Rakudo github. On IRC Masak was good enough to give me the options:-<br />
&quot;you could submit a patch to rakudobug.&quot;<br />
&quot;or you could fork on github, push your patch to your forked repo, and do a pull request.&quot;</p>
<p>
The easiest way is to email the patch to <a href="mailto:rakudobug@perl.org">rakudobug@perl.org</a> with the subject &quot;<span class="nlw_phrase">[PATCH]<!-- wiki: {{[PATCH]}} --></span> Description&quot;. Git has a couple of options for creating patches. First, make sure you have commited your changes. Open Git Bash and:-</p>
<p>
git commit -a -m &quot;Your commit message&quot;</p>
<p>
Now you can either run a diff and save it as a patch:-</p>
<p>
git diff origin &gt; name.patch</p>
<p>
Or use git's format-patch command which maintains your commit message:-</p>
<p>
git format-patch origin</p>
<p>
Then email the patch and your done :)</p>
<p>
To do a fork and pull request visit:- <a target="_blank" title="(external link)" href="http://github.com/cosmicnet/rakudo/tree/master">http://github.com/cosmicnet/rakudo/tree/master</a>, login and click on 'fork'. This created a fork in my github account, I opened git bash to create a local branch of it:-<br />
cd /c/temp/rakudo<br />
git remote add cosmicnet git://github.com/cosmicnet/rakudo.git<br />
git checkout b cosmicnet<br />
git pull cosmicnet master<br />
cosmicnet is my github username, for you the above lines will contain your username instead. I now had a local copy of the fork in the branch cosmicnet. As the fork was from the main repo I had to merge in my local changes, and then push them back up to my fork. First I needed to commit the changed files in the master branch:-<br />
git checkout master<br />
git commit -a -m &quot;Your commit message&quot;<br />
Then merge with the new branch:<br />
git checkout cosmicnet<br />
git merge master</p>
<p>
Then finally push back to github:-<br />
git push <a href="mailto:git@github.com">git@github.com</a>:cosmicnet/rakudo.git</p>
<p>
From there I was able to do a pull request to the main rakudo repo.</p>
<h3 id="submitting_bug_reports_for_parrot">Submitting BUG reports for Parrot</h3>
<p>
Parrot no longer uses RT to track bugs. Instead they use trac. You'll need to <a target="_blank" title="(external link)" href="https://trac.parrot.org/parrot/register">register for an account<!-- wiki-renamed-hyperlink "register for an account"<https://trac.parrot.org/parrot/register> --></a> first, but it very simple. Here is the process I use to submit a bug:-<br />
1) Update to the latest Parrot<br />
cd \temp\rakudo\parrot<br />
svn update<br />
2) Make changes then commit them</p>
<p>
<a target="_blank" title="(external link)" href="https://trac.parrot.org/parrot/newticket">https://trac.parrot.org/parrot/newticket</a></p>
<h3 id="learning_parrot">Learning Parrot</h3>
<p>
docs.parrot.org<br />
mingw32-make html<br />
TODO</p>
<h3 id="learning_perl_6">Learning Perl 6</h3>
<p>
TODO</p>
<h3 id="learning_c">Learning C</h3>
<p>
TODO</p>
<h3 id="learning_haskell">Learning Haskell</h3>
<p>
TODO</p>
<p>
Lyle Hopkins</p>
</div>
]]></description>
<author>quester.pm@hidden</author>
<guid isPermaLink="true">http://www.perlfoundation.org/perl6/index.cgi?roadmap_to_helping_with_development</guid>
<pubDate>Mon, 08 Mar 2010 02:18:15 -0000</pubDate>
</item>

</channel>
</rss>