Recently in rakudo Category

Google Summer of Code 2010 Final Summary

| | TrackBacks (0)

Google Summer of Code is a global program that offers student developers summer stipends to write code for various open source software projects. Google Summer of Code 2010 went by quickly, and much was accomplished. The Perl Foundation and Parrot Foundation took part this year, and we were lucky to get proposals from very bright and capable students. We started the summer with 10 students and had 8 students pass their final evaluations. The passing projects include:

Ryan Jendoubi -- Ctypes for Perl
Mentor: Reini Urban
Blog: http://blogs.perl.org/users/doubi/
Repo: http://gitorious.org/perl-ctypes/perl-ctypes

This project is exciting many Perl developers, because it would minimize the need to use XS, which will make many more pure-Perl modules possible. This improves portability, becaue XS-based modules are notorious for being fragile across operating systems and compiler versions. This adds up to a whole lot of WIN.

Nat Tuck -- Hybrid Threads for Parrot
Mentor: Andrew Whitworth
Blog: http://parrot.org/blog/836
Repo: http://github.com/parrot/parrot/tree/gsoc_threads

Threads allow a single program to use more than one CPU, which is becoming increasingly important these days. Even mobile phones are multicore! This work aimed at adding threading support to Parrot Virtual Machine. Much was accomplished, but this effort is still on-going. So-called "green threads" were implemented, which is a necessary step to get Hybrid threads working.

Tyler Curtis -- A PAST Optimization Framework for Parrot
Mentor: chromatic
Blog: http://parrot.org/blog/839
Repo: http://github.com/ekiru/tree-optimization

This project is about providing a framework for optimizing PASTs (Parrot Abstract Syntax Trees). This will be used by language implementors when optimizing their HLLs (High Level Languages). This framework allows all languages on Parrot to benefit from optimizations that are written once, instead of each language implementor writing their own optimizations.

Daniel Arbelo Arrocha -- NFG and single-representation strings for Parrot
Mentor: Allison Randal
Blog: https://www.parrot.org/darbelo
Repo: http://github.com/parrot/parrot/tree/gsoc_nfg

NFG stands for Normal Form Grapheme, and basically means having a standard internal representation of Unicode strings, so that very expensive conversions do not have to repeatedly take place. This makes string-heavy computations much faster and unifies a lot of code.

Carl Masak -- Add support for binary data in Rakudo
Mentor: Jonathan Worthington
Blog: http://use.perl.org/~masak/journal/
Repo: http://github.com/rakudo/rakudo

Rakudo Perl 6 now supports various binary data formats that were implemented as part of this project. Many relevant tests were also added to the Perl 6 Spec Test Suite as well as improvements and clarifications to the Perl 6 Specification.

Muhd Khairul Syamil Hashim -- Instrumentation Tool for Parrot
Mentor: Christoph Otto
Blog: http://www.parrot.org/blog/841
Repo: http://github.com/khairulsyamil/parrot-instrument

This instrumentation tool for Parrot allows one to dynamically peek into the execution of Parrot op-codes. This allows for writing profiling tools that can answer questions like "who calls functions X" and "how many Objects of type X were created."

John Harrison -- Improvements to NCI/LLVM Stack Frame Builder for Parrot
Mentor: Peter Lobsinger
Blog: http://www.parrot.org/ash
Repo: http://github.com/ashgti/parrot

This project is a prerequisite for a JIT (Just In Time compilation) framework, which is an important goal for the Parrot community, since Parrot decided that our old JIT subsystem was broken beyond repair and removed it. Parrot has decided to use the very popular LLVM project in our rewrite of our JIT, and this project brings us a step closer on our journey.

Pawel Murias -- Mildew and SMOP on CPAN
Mentor: Daniel Ruoso
Repo: http://github.com/perl6/mu

This project involved working on Mildew and SMOP. Mildew is a Perl 6 implementation, and SMOP is the library Mildew uses for meta-object programming. You can think of Mildew as a sister to Rakudo Perl 6. Having many implemenations of Perl 6 helps to better define the Perl 6 specification. Updated versions of SMOP and Mildew are now available on CPAN.

The failing projects were:

Justin Hunter -- Rework Catalyst framework instance initialization code
Mentor: Florian Ragwitz

Mirko Westermeier -- Bulletproofing the Mojolicious test suite
Mentor: Marcus Ramberg 

Both of these projects passed their midterms, but due to circumstances outside of the program, these students were not able to complete their goals for their final evaluation. Sometimes Real Life throws you a curve ball, like starting a new job, moving to a new city, having a baby and similar things. We wish these students the best of luck, and hope that they complete their projects outside the structure of GSoC.

I am very proud and humbled by all the students and mentors that I worked with this year. I am constantly reminded that there are very intelligent developers that are very young, and The Perl Foundation and Parrot Foundation is very lucky to attract them and have them in our communities. I firmly believe that the passing GSoC 2010 projects have made a large positive impact on our codebases and many people will benefit from them for years to come.

Rock on and keep spreading the Open Source love!

Rakudo Perl 6 in Your PostgreSQL Database!

| | TrackBacks (0)

It has been a very exciting few weeks in the Perl 6 world with regard to database access. mberends++ just wrote a nice blog post about how Perl 6 support for DBI is ramping up with work on MiniDBI (formerly FakeDBI). Multiple developers recently made great progress on PostgreSQL drivers and have been improving the Parrot interface to libpq, Pg.pir .

I have also been dutifully hacking on PL/Perl6, which embeds Rakudo Perl 6 into your PostgreSQL datbase via PL/Parrot, and just recently merged the plperl6 branch, which adds the first basic support for PL/Perl 6. Here is how it currently works:

  • You must first install a recent version of Parrot and Rakudo Perl 6. I develop with Parrot trunk and Rakudo master because I often need very recent changes/bugfixes
  • You will need a moderately recent version of PostgreSQL. PL/Parrot has been known to work with versions as old as 8.3.8, but I mostly develop on the master branch, so 9.x will probably work best
  • When you type "make install" for Rakudo Perl 6, you will see that it installs a file called "perl6.pbc" into the lib/$version/languages/perl6 directory of the Parrot installation that Rakudo was configured with.

To tell PL/Parrot that you would also like PL/Perl6, you set the environment variable PERL6PBC to the full path of perl6.pbc like so:

export PERL6PBC=/Users/leto/git/rakudo/parrot_install/lib/2.5.0-devel/languages/perl6/perl6.pbc

A PBC file is Parrot bytecode, and the perl6.pbc file basically bundles all of Rakudo Perl 6 into a single file. You can play around with the Rakudo Perl 6 REPL by running:

$ parrot $PERL6PBC

which is pretty much the exact same thing as running the perl6 binary in your $PATH.

When you compile PL/Parrot with the $PERL6PBC environment variable set, it automatically creates a separate Parrot interpreter with the perl6.pbc bytecode loaded, so that Perl 6 code can be executed.

To run PL/Parrot tests, you type "make test". You can also do this the PostgreSQL way with "make installcheck", which will run the tests and verify that the output matches a certain, known output. "make tests" just generates the TAP output.

Currently PL/Perl 6 tests are not run by default, they have their own Makefile target: test_plperl6 This is what the output of "make test_plperl6" looks like currently, on commit 44a985f123 of the perl6_args branch.

We run a total of 9 tests, 6 of which correctly run Perl 6 code and pass. You will notice that all the failing tests are relating to passing arguments into Rakudo from PostgreSQL, which is what I am currently trying to get to work. Currently I am passing a Parrot ResizablePMCArray of the arguments to a Rakudo function and executing it, but the function can't seem to see it. My guess is that Rakudo wants native datatypes and not Parrot datatypes. If you know how to create Rakudo datatypes from PIR, please let me know :) I promise you will -Ofun.

What does PL/Perl 6 look like? Here is a nice example of a PL/Perl6 function which calculates the sum of all Fibonacci numbers <= 100:

CREATE FUNCTION test_fibonacci_plperl6(integer) RETURNS int LANGUAGE plperl6 AS $$
[+] (1, 1, *+* ... 100)
$$;

You will notice three spiffy new Perl 6 operators in there, the summation operator [+], the new range operator ... (which used to be .. in Perl 5), and the *+* operator. What exactly is the *+* operator? pmichaud++ jokingly referred to it as the "cheerleading plus", but it is actually just a plain old infix "+" operator, sandwiched by two "*" (a.k.a Whatever) operands. It basically takes the previous two elements in a list, sums them together and returns the sum, which is exactly how the Fibonacci sequence is defined.

If you are interested in hacking on PL/Perl 6, PL/Parrot or anything related, come join us in #plparrot on freenode, join the mailing list and fork us on github !

PL/Parrot Flies

| | TrackBacks (0)
PL/Parrot recently started passing all tests and marshalling three basic data types of integers, floats and strings, between PostgreSQL and Parrot Virtual Machine.

One of the important next steps for PL/Parrot is to improve the security subsystem, which will require changes to Parrot core. Parrot has only a high-level Parrot Developer Doc (PDD) that describes how security should work, but still lacks an implementation. Thus, PL/Parrot finds itself in the situation of being able to drive the development of security features in Parrot. This is very exciting and I am researching various hardening solutions. Various ideas have been thrown around, but removing or replacing certain opcodes at the lowest level is the most secure solution. How to do this, properly at run-time, is the fun part.

I will be talking about PL/Parrot at PGCon 2010, which will be very exciting. I am hoping to meet many people in the PostgreSQL community and show some PostgreSQL internals hackers why hacking on PL/Parrot is so fun and so important.

PL/Parrot is so important because PL's are hard to write and maintain. My vision is that most of the hard work goes into PL/Parrot, and then languages built on top of Parrot (HLL's), will have a very simple time piggy-backing on top of that infrastructure. Currently, only PL/PIR exists. Stored procedures can be written in PIR. The next steps will be getting a HLL working on PL/Parrot, such as NotQuitePerl (NQP) or Rakudo Perl 6. If you want to get your favorite HLL working on PL/Parrot, I surely won't stop you.

There are also many benefits to writing stored procedures in PIR. PIR will have the closest possible speed to C than any HLL run on Parrot, so if speed is your main concern, you will want PL/PIR. Parrot has a garbage collector, so you don't have to do memory management in PL/PIR. This prevents crashing the server instance due to double-free errors and fun stuff like that. PIR is also platform-independent: no more need to figure out how to get your stored procedures written in C compiling on a new platform.

If you have tuits or ideas for implementing PL/NQP or PL/Rakudo or any other comments about PL/Parrot, I would love to hear them. Feel free to fork the github repo, join us in #plparrot on irc.freenode.net or on our mailing list. We also need a website and mascot. There are many ways to help, but patches are always welcome :)
Congratulations to the nine students who have been accepted into Google Summer of Code 2009 with The Perl Foundation! Initially TPF was given ten slots, but a duplicate accepted application was generated from other duplication resolutions (it's not a process that is guaranteed to terminate!). Andriy Kushnarov submitted two great applications to the TYPO3 organization as well as an application to TPF regarding plugins for the November wiki. It was decided to donate the slot to TYPO3, so here is our list of the nine accepted applications:









We have some very exciting applications for a wide variety of topics this year, ranging from Perl 5 CPAN modules, to Parrot internals and, of course, Perl 6. The students involved this year are poised to make a tremendous impact to the projects they work on. Now that pesky "implementation" phase begins! Not before a bit of community bonding, but I am sure that students will start coding before the actual, no-more-bonding-lets-code date of May 23rd.

Thank you to everyone involved, especially people in #soc-help on irc.perl.org and those on the tpf-gsoc-students list. You rock. Special thanks goes out to Joshua McAdams who made a cool TPF GSoC 2009 YouTube video!

Is it any coincidence that today is one of the hottest days of the year so far in Portland, OR? In any case, this summer of code is heatin' up.


Are you an eligble student that wants to participate in the Google Summer of Code 2009? Do you want to work on the exciting Rakudo or Parrot projects, or a CPAN module, or your favorite Perl application, or hack on Perl 5 internals? Then you want to apply to The Perl Foundation. Right now this means contacting me directly at jaleto at gmail dot com. Keeping in contact with Twitter is also good, the #gsoc tag is very useful.  You may also want to get some ideas from the 2008 projects.

Applying involves coming up with a well-written document that describes exactly what features you will add or create, along with a timeline with "milestones" of what will be accomplished each week of the summer. Of course this changes with circumstances, but having a good plan always helps. The community members of the project that you apply to should help you with this, as well as give you advice about what is possible in the allotted time and give advice as to what is possible with the current infrastructure of the code. The best ways to do this is to get on developer mailing lists, introduce yourself, perhaps fix a small bug, add a test or some documentation and most probably you will be given some kind of commit access.

If you want to hack on Perl 6 on Parrot aka Rakudo, then all you need is a free GitHub account and you can contribute patches directly. You do this by pressing the  "Fork" button. You should be presented with a page that says there is some "hardcore forking action" going on and then be redirected to your brand-new fresh personal fork of Rakudo. More on this in future posts.

One of the nice features of GitHub is the network-view of a project. For instance, here is the network view of rakudo.git with a base of my fork.  It allows you to visualize which branches have which features pretty quickly, which tells you which branches you should merge with. This has turned out to be immensely useful in all of the GitHub repos that I hack on.

I am interested in being a mentor for TPF this year as well, and some of the random projects that I would be interested in mentoring are:

Other projects that students may want to check out are:

  • November - A wiki engine written in Perl 6
  • Moose - A modern Perl 5 object system
  • Catalyst - A very popular Perl web framework
  • Mojo - A "next generation" web framework for the Perl programming language.
There are tons of other projects, if you are one of them, please let me know!

Students, start getting to know the developer community of the projects now, deadlines are fast approaching!

Rakudo has hash slices

| | Comments (1) | TrackBacks (0)
Patrick Michaud just pushed some changes in r33907 that made hash slices work, so I went rumaging around in S02 and unfudged about 20 passing TODO tests. I also added about 15 tests to S29-trig/trig.t relating to \sec{x} and hyperbolic trig functions.

Currently the test suite has 6969-1485=5484 passing tests, rock on!

All tests successful, 1485 subtests skipped.
Files=249, Tests=6969, 613 wallclock secs (498.93 cusr + 29.40 csys = 528.33 CPU)

Warning! PDX.pm December 2008 Wrap-Up

| | TrackBacks (0)
The "Getting Started With Rakudo (A Flavor of Perl 6)" hack session was a huge success, we actually implemented the "warn" keyword in Rakudo! I mentioned that I was fiddling with Rakudo and I was saddened that "warn" was not implemented and with the help of chromatic we had an initial prototype a few minutes later! Patrick Michaud was also a big help, answering questions about how to run individual tests in the test suite and explaining the fine points of exception handling.

This implementation does not yet bubble exceptions as per Perl 6 spec because some backend features are still needed in Parrot to make this work. I also committed a small fix to "unfudge" a passing CATCH test in Synopsis 04 in the pugs svn repo

Also, big props to Keith Lofstrom for making a DVI-to-VGA connector magically appear for the projector!
Anyone is welcome to come to the meeting to learn more about Perl 6 and how it is being developed. But if you would like to participate in the "hack session", please bring a laptop with:

Getting Involved with Rakudo (A Flavor of Perl 6)

| | TrackBacks (0)
The December 2008 PDX.pm meeting will be a a "hack session" where there will be a small "briefing" at the beginning of the meeting (like 5 minutes) then people start hacking away, working on what they want to. This is  a good time for people to put some ideas on the PDX.pm kwiki of what they want to learn about Rakudo or what they want to hack on.

What is Rakudo? Rakudo is the implementation of the Perl 6 spec on the Parrot virtual machine. I call Rakudo a "flavor" because any implementation of Perl 6 that passes the Perl 6 test suite can call itself Perl 6. Perl 5 spec and implementation were one and the same, which meant that any additional implementation that could have ever hoped to be written (which never happened) would have had to be bug-for-bug compatible with the original implementation of Perl 5, because that was the spec. Perl 6 does not repeat this mistake and actually is currently benefiting already from the principle. Pugs was an initial prototype of Perl 6 with the Haskell programming language, which is no longer actively maintained, but it's extensive test suite is currently being converted into the Perl 6 test suite. The pugs test directory is actually an svn external and lives at languages/perl6/t/spec in the Parrot svn repository. As you can see, Rakudo and the Perl 6 test suite still live inside the Parrot repository. This will probably change sometime next year as Parrot gets closer to 1.0 and Rakudo can be built on a fully functional Parrot.

This isn't supposed to make a lot of sense, but you can metaphorically think of Rakudo as the Fourier Transform of Perl5:

Ra\vec{k}udo = \iiint e^{ - 2 \pi \imath \vec{k} \cdot \vec{x} } Perl5 \left( \vec{ x } 
ight) d\vec{x}  

Ra\vec{k}udo will be a simpler-to-use representation of Perl5\left(\vec{x}
ight) which is a sum of smaller and simpler components. Yeah, I think I just wanted to show off my new \textrm{ \LaTeX } plugin.

About this Archive

This page is a archive of recent entries in the rakudo category.

postgres is the previous category.

rtems is the next category.

Find recent content on the main index or look in the archives to find all content.

Clicky Web Analytics 42