Results tagged “perl” from dukeleto.pl

I'm excited to announce that Parrot Foundation and The Perl Foundation have been accepted as organizations in Google Code-In 2010!

Google Code-In is a contest, similar to Google Summer of Code, where Google pays students aged 13-18 to do tasks designed by open source communities, while learning about open source. Google pays for the work to be done, and we get new members to our communities, while students learn useful skills. It is a big win for everyone.

In 2010, Google Summer of Code was a great success for Perl and Parrot. We got amazing new features in Parrot, Perl 5 and Perl 6 . In 2009, we had similarly spectacular results.

For the students, the benefits are huge. They get mentored by some of the best minds in open source and get "street cred" in the community. This contest also acts as a stepping stone for Google Summer of Code, so students that excel at Code-In will most likely be sought after for future Google Summer of Code involvement. It's also fantastic experience to put on a résumé. I see many Google Summer of Code students get snapped up by respected companies, or accepted to prestigious academic institutions.

The more well-documented tasks we have before that, the more students we will have the potential to attract. I can attest that these kind of contests attract some of the smartest students in the world, so the Perl and Parrot communities have much to gain by being involved.

I expect great results for Code-In as well, but we need your help. The Google Code-In contest opens up for students on:

  • November 22, 2010 at 12:00 AM Pacific Time / 08:00 UTC.

How Can You Get Involved?

  • Add a task to our task list There is a template that you can copy and paste, as well as many examples. Any task related to Perl 5, Perl 6 or Parrot is fair game.
  • Improve the description of an existing task. The more specific a task and the more documentation and links you provide, the easier it is for a student to choose and complete a task.
  • Volunteer to mentor a student on a task. You apply to be a mentor here. Please join the tpf-gsoc-students mailing list and introduce yourself. Provide a brief description of why you are interested when you sign up, so we know you aren't a bot :) Please also join the #gci channel on irc.perl.org.
  • Tell potential students about Google Code-In and how we are involved. Here is a link to the timeline and FAQ that you can send them, as well as flyers to post.

GSoC 2010 Mentor Summit and Git Together Wrap Up

|

So many amazing things happened at the Google Summer of Code Mentor summit 2010! I will try to jot a few of them down, before they leave for warmer climates. For those that just want to read all the session notes, you can find them here. Also, if you haven't yet read about how The Perl Foundation and Parrot Foundation fared this summer, you can read about it on the Google Open Source Blog.

It began by arriving a bit early to work with some awesome people on improving the GSoC Mentor Manual by adding a chapter for Organization Admins (there is actually documentation now!) and writing a GSoC Student Manual. This "book sprint" was facilitated by Adam Hyde of FLOSSManuals, and they were written with a completely open source software stack, as well as being released under a Creative Commons license. They are free for anyone to read online and are easily exportable to many formats. Read the Student Manual or the Mentor+Org Admin Manual online now! We even bound 60 copies of the books and handed them out to mentors attending the summit.

Parrot on RTEMS hacking with Chris Johns and Ralf from RTEMS. We used Centos 5 RPMS on Ubuntu 10.04 with rpm2cpio piped to cpio, which was a trick to get around the fact that RTEMS does not have debian packages. It worked remarkably well. I had a cross-compilation environment setup after a few minutes. I think they will be adding these intructions to their wiki. Now that I have the RTEMS toolchain on my netbook, I will be much more productive with regard to Parrot on RTEMS.

Chromatic, Chris Johns and I sat in a room and talked shop about how Parrot and RTEMS can play nicely together. There are still some feature voids on the Parrot side to fill: Parrot calls exit() in various places, which reboots RTEMS i.e. a syntax error reboots the OS. Not Fun. Parrot also needs a C probe to detect RTEMS, which already has a ticket in our bug tracker. A real-time garbage collector will be needed for long-running processes, but for short-lived applications, disabling the GC with the -G command line argument to Parrot will work.

I gave a session with Selena Deckelmann and Bart Massey introducing Troll University, which aims to educate organizations, corporations and open source communities about what motivations and principles trolls use and how to protect against them. We are working on some Trollcasts, so stay tuned!

I also gave a session called Dynamic Language Interoperability, which has been held for the last few years, to my knowledge. The consensus seemed to be that every dynamic language has the same interop problems, and Parrot VM seems to be the only project working hard to solve these complex issues in a general manner. This gives me a lot of hope that people will soon realize that Parrot is full of WIN.

It also came to my attention during the conference that Github hired the student that mentored under them this year to work on libgit2. This is one example of the amazing opportunities that students have after completing a Google Summer of Code. The sky really is the limit. And just in case you think this is an isolated incident, it isn't.

As if writing some books and going the Mentor Summit wasn't enough to totally drain me, I am currently attending the last day of the GIT Together 2010, which is the yearly Git developer and user meetup/unconferencey thing. I have learned so much that I can't even begin to describe it, but if you want to look at session notes, you can find them here.

Google Summer of Code 2010 Final Summary

|

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!

|

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 !

Google Summer of Code 2010

|
I am working on the application for The Perl Foundation and Parrot
Foundation
to participate in Google Summer of Code 2010. GSoC is a
program where Google funds eligible students to hack on open source
projects for a summer. It is a great opportunity for the students and
the communities that mentor them. You also may be interested in this
summary of our involvement last year . Our application will be
submitted by the end of this week.

Please join us in getting prepared for this year. There is a page for
possible mentors to volunteer as well as a page for 
project ideas . If you would like to help with the wiki, our 
main GSoC page is the best place to start. You are also invited to join 
our mailing list  and come ask questions in #soc-help on irc.perl.org .

Blizkost is passing 102 tests!

|
Blizkost, Perl 5 on Parrot, is really starting to pick up speed. I just imported the base Perl 5 tests (the ones that live in t/base) and Blizkost passes every file except lex.t and one TODO test about implementing the -l command line argument. If you can make lex.t work, you get super-cool ninja points. It is probably the use of the package keyword in lex.t that borks the test. If you feel like porting other tests from the Perl 5 Test Suite, they live in t/spec in the Blizkost repo.

Currently, Blizkost cannot load XS modules, such as Data::Dumper. You get an error like:

Can't load '/usr/lib/perl/5.10/auto/Data/Dumper/Dumper.so' for module Data::Dumper: /usr/lib/perl/5.10/auto/Data/Dumper/Dumper.so: undefined symbol: Perl_sv_cmp at /usr/lib/perl/5.10/XSLoader.pm line 64.
 at /usr/lib/perl/5.10/Data/Dumper.pm line 36


If you can help get enough XS-loading machinery to work so that Data::Dumper works, that would really help development and testing. If you can try out Blizkost on your system and make sure that it compiles and the test suite passes, we would greatly appreciate it. Feel free to open an issue on github if you find a bug.

Google Summer of Code Updates

|
If all the dates and timelines of Google Summer of Code have you confused, this nice color-coded visualization of each part of the summer may help make it more sense.

Next week is the super-cool-with-extra-awesomesauce conference Open Source Bridge, which is all about being an "open source citizen." ( I recently had to explain to someone that it was not an "Open Sores Conference". Much hilarity ensued) . There will be many open source folk from around to globe, including many GSoC mentors, students and the program manager, Leslie Hawthorn. This prompted me to create a Bird of Feather session for GSoC people. This is for anybody that has every been part of GSoC or is interested in participating in the future. Come on by and hang out!

As always, you can find us in #soc-help on irc.perl.org if you want to get involved.





The Perl Foundation GSoC2009 Roundup

|
So much has been going on this summer of code! As a recap, TPF got nine student slots this year, which means we have nine mentors and nine students working on various things this summer. Here is a sample of what has been going on recently.

Pascal Gaudette describes his love for debugging tricky HTTP/1.1 issues in Mojo
and has even added a "featurette."  Devin Austin has been talking about
eviscerating Catalyst::Helper and Daniel Arbelo Arrocha has thoughtfully
detailed the difference between bonding and bondage. My student, Robert Kuo,
has been busy reading the mathematical paper and example C implementation  of
the Strong Lucas Pseudoprime primality test for Math::Primality . While installing Math::GMPz, which we use to access the GNU Multiprecision Library (GMP), he found a small issue which caused some test failures and submitted a bug report.

Math::Primality also very recently gained a working is_prime() method, which
works for arbitrary sized integers, due mostly to Robert Kuo's implementation
of is_strong_lucas_psuedoprime() being finished. Now you can test for prime numbers in Perl without installing Math::Pari! More about this in a separate post!

Ryan Jendoubi is working on a Perl interface for wxWebkit and Hinrik Örn Sigurðsson
is working on the command line utility to read Perl 6 documentation called grok.
Justin Hunter has been hacking on his blogging software so that he can blog about
his work on SQL::Translator. Sometimes it's a vicious cycle...

Back to hacking on some code!


Why would you ever store a reference to a Perl string?

|
To use less memory! You may think that

my $x = 'foo'; my $y = $x;

would store the string 'foo' in one place, and then when $y gets changed, use the new string. It doesn't. To see this, we can use Devel::Peek from the perl debugger. We start it up with

perl -de0

which I have aliased to p in vim, because yes, I am that lazy and I loves me some debugger. Once we are in the debugger you have to use the module. Note that the debugger output is bolded.

 DB<1> use Devel::Peek

Then define a variable

 DB<2> $x = 'foo'

PROTIP: You can't use my $x in the interactive debugger because each line of input to the debugger gets wrapped in it's own lexical scope, a lexical variable (i.e one defined with my) will not exist outside of this inner scope.

Now we use the "x" debugger command, which prints out the result of executing some Perl code. We give it the code Dump $x, which calls Devel::Peek's Dump method on $x, which prints out low-level information about the internal properites of a variable.

 DB<3> x Dump $x
SV = PV(0x9542ca4) at 0x9565924
 REFCNT = 1
 FLAGS = (POK,pPOK)
 PV = 0x95731b8 "foo"\0
 CUR = 3
 LEN = 4
 empty array


SV is Perl-internals-speak for "scalar value" and the PV means that it is a string. The reference count is 1, which means only one thing, itself, points to itself. When a variable goes out of scope, the REFCNT goes to 0 and the Perl garbage collector recycles it. The FLAGS containing POK tells us that is a valid string. Take note that the PV line shows us the memory address that the string is stored at, as well as it's value and that it is null-terminated.

Now let's set a new variable equal to $x.

 DB<4> $y = $x

Now let's take a look at it:

 DB<5> x Dump $y
SV = PV(0x9542c2c) at 0x958ab70
 REFCNT = 1
 FLAGS = (POK,pPOK)
 PV = 0x958b968 "foo"\0
 CUR = 3
 LEN = 4
 empty array

The PV line is the most interesting. If you compare it to above, you will see that it is a different memory address! Not just the overhead of each Perl variable is being stored, but the string 'foo' is being stored in two different places!

Now imagine that our string is a few hundred megabytes, and you are manipulating it. You are really going to notice having a few extra copies of it around, aren't you! If you know that you have a lot of data structures that have the same string in them, use a reference to save memory. If you are running up against "perl Out of memory!", this could be a trick that gets you out of that bind without buying more RAM.

Let's check out the memory savings with Devel::Size, a nice module which can tell you how much memory your Perl variables are using.
 
DB<1> use Devel::Size qw/size total_size/              

Next we create a longish string.

DB<2> $x = 'i like eating memory' x 1000                                

We can use the size() function to see how much memory it is using:

DB<3> x size($x)                                                                                           
0  20036

Now let us dump a hash which has this string repeated as two values. We use the total_size() function, which follows references:

DB<4> x total_size( { a => "foo", b => $x, c => $x } )                             
0  40253

Now we do the same, but we store references to the strings:

DB<5> x total_size( { a => "foo", b => \$x, c => \$x } )                    
0  20249

Roughly half the size!

And that is why you would use references to Perl strings. Why else would you?
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.


Students, The Application Deadline for GSoC is Close!

|
  • Why Google Summer of Code Should Matter To You
If you are a student, many of the great opportunities that GSoC opens up are described in this video, Code Conversations #3 with Leslie Hawthorn. She goes into many success stories of previous students and talks about how there is room for all skill levels, not just experts. There is also a Youtube video made by Joshua McAdams about The Perl Foundation and Google Summer of Code.

  • Deadline
The deadline is this Friday 3 April 2009, 17:00 UTC/12 Noon PDT, so now is the time to submit your application! There is the project ideas page for you to see what there is to hack on and the application template to hammer your ideas into a plan. We have a  google group for students to ask questions and there are always some helpful people in #soc-help on irc.perl.org to ask. For up-to-the minutes status updates, follow me on twitter and/or search for the "#gsoc" tag on your favorite aggregator.

  • Project Ideas
Some really good ideas that don't have application yet are:

  • Work on the Perl 6 Test suite, (really important!)
    • Object system (multi method dispatch, object creation, role mixin), introspection
    • Regexes/grammars: inheritance, action methods for grammars, structure of Match objects; built-in rules; modifiers.
    • built-in types, especially container types (like KeySet, see S02)
    • Exceptions, control exceptions, catch-blocks
  • Advanced primality testing for Perl, necessary for testing native cryptography
  • YAML parser as a PGE grammar wrapped by Perl 6 module
  • Port Crypt::Random to Rakudo
  • Work on IO subsystem in Rakudo
  • Add Callgrind output to Parrot
  • GSL bindings to Parrot via NCI
  • November, a Perl 6 wiki engine
  • POE (Perl Object Environment)
Students, submit your application now and get feedback from the community on the GSoC webapp, Melange! Now is the best time to get involved in the open source project that you have always dreamed of working on and get paid to do it

Perl Monger Parallelism

|
I have a modest proposal for making GSOC2009 the best and most productive year so far for The Perl Foundation.

There are currently 340 Perl Monger groups worldwide. If 10% of the Perl Monger groups world-wide could agree to find just one student application each, we would have 34 student applicants for 2009, more than double that of last year! Last year we had way more mentors than students, which was obviously a problem of getting the word out to prospective students.

Also, the community didn't "parallelize" and much of the burden of making GSOC2008 happen fell on the shoulders of Eric Wilhelm of PDX.pm, who herded cats and walked on tight-ropes to make everything happen. Thank You, Eric.

This year we need to harness the vast energy that is the global Perl community and focus our energy on things that strengthen us, not divide us. This year is gearing up to be a very exciting year for the Perl (and Parrot!) communities, the first full implementation of Perl 6, Rakudo, is getting ever closer.

Finding great students is the first step to a successful GSOC2009 and the 10% of .pm groups that help the Perl community find them will very much catalyze the process and ensure a happy and healthy Perlsphere.

Who's up for it?

PROTIP:
See what people are talking about right now with this #gsoc tag aggregator and start networking in the community with Twitter or Identi.ca with the #perl tag.
Clicky Web Analytics 42