opensource.google.com

Menu
Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts

Postini EZCommand Shell makes things even easier

Wednesday, December 15, 2010

Today, we are open sourcing the Postini EZCommand Shell, a Perl script allowing Postini administrators to issue EZCommands to Postini from a command line.

The script is useful in two ways. First, it allows Postini administrators to make Postini EZCommands from a terminal. Second, it provides sample code for developers. For years we’ve had the Postini EZCommand, but never out-of-the-box sample code that companies could use. This code gives developers a helpful guide to integrate EZCommand with their internal systems.

Postini EZCommand Shell version 1.0.0 supports the following EZCommands:

adduser
modifyuser
deleteuser
suspenduser
addalias
deletealias

For more information, see our site on Google Project Hosting.

By Jeff Pickhardt, Enterprise Sales Engineering Team

Perl and Parrot Spread Open Source Love

Saturday, October 23, 2010






The Perl Foundation and the Parrot Foundation took part in Google Summer of Code this year, and as the organization administrator, I am very proud of and humbled by all the students and mentors that I worked with. I am constantly reminded that there are very intelligent developers who are very young, and the Perl and Parrot Foundations are very lucky to attract them and have them in our communities. I firmly believe that the passing Google Summer of Code 2010 projects have had a large positive impact on our codebases and many people will benefit from them for years to come.

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 (Repo)
This project is exciting many Perl developers, because it minimizes the need to use XS, which makes many more pure-Perl modules possible. This improves portability, because 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 (Repo)
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 to add 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 (Repo)
This project is about providing a framework for optimizing PASTs (Parrot Abstract Syntax Trees). This will be used by language implementers 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 implementer writing their own optimizations.

Daniel Arbelo Arrocha -- NFG and single-representation strings for Parrot
Mentor: Allison Randal (Repo)
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
 (Repo)
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 (Repo)
This instrumentation tool for Parrot allows developers to dynamically peek into the execution of Parrot op-codes. This allows for 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 (Repo)
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)
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 implementations of Perl 6 helps to better define the Perl 6 specification. Updated versions of SMOP and Mildew are now available on CPAN.
The two projects that did not pass the final evaluations 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 or similar things. We wish these students the best of luck, and hope that they complete their projects outside the structure of Google Summer of Code.

To all that participated in Google Summer of Code - Rock on and keep spreading the open source love!

By Jonathan “Duke” Leto, Google Summer of Code Administrator for Parrot and Perl

Cross posted from dukeleto.pl, my personal blog about Perl 5, Perl 6, and Parrot Virtual Machine.

SWIG's Second Summer of Code

Monday, November 23, 2009

SWIG is a programmer's tool designed to make it easier to use C and C++ code from other popular programming languages such as Python, Perl, Ruby, PHP, Java, and C#. 2009 was SWIG's second Summer of Code, and this year we mentored five projects related to SWIG. All five students were very active over the summer period and produced some great new features. In no particular order:

Matevž Jekovec has been busy working at the coal face of SWIG to add support for C++0x, the forthcoming C++ standard. Matevž has managed to achieve close to full support for C++0x. The C++0x Wikipaedia article details the numerous planned new features and Matevž has put together a SWIG C++0x page documenting the new SWIG support for each of these. In summary the enhanced C++ language can now be parsed by SWIG, which in itself is a great step. There is much more than just this though, as most of the information parsed is used to create useful wrappers of C++0x code. The work can be tried out on the C++0x branch which should be merged fairly soon into a forthcoming release.

Miklos Vajna has been working on SWIG's PHP support to implement an advanced SWIG feature already supported for most other target languages, but not PHP. The feature is called "directors" and allows cross-language polymorphism - wrapped C++ classes can be subclassed in PHP and virtual method calls work in the natural way, whether they're made from PHP or C++ code. You can read more in the new PHP Director documentation. Miklos made such great progress that we were able to merge this support into SWIG 1.3.40, which was released even before the Summer of Code finished. Miklos also spent some time working on improving SWIG's test suite for PHP, and fixing bugs in the PHP support.

Ashish Sharma spent the summer adding support for Objective-C as a new target language. Objective-C is a major language on the Mac OS X platform. This means that now SWIG can be used to generate Objective-C wrappers over C++ code. In particular the wrappers include proxy classes, which preserve the class hierarchy from the C++ code. Ultimately this means that from the user's perspective, proxy objects look no different to objects originally written in Objective-C. Adding a new target language is quite a considerable task and Ashish is keen to add plenty more improvements over the coming months. Ashish's work is in Subversion and can be accessed in the ashishs99 branch.

Baozeng Ding has also added a new target language, in this case for the Scilab language, a free numerical computing package. He has coded up support for all the C features: variables, functions, constants, enums, structs, unions, pointers and arrays and also intends to develop it further in the near future. Documentation for SWIG and Scilab can be viewed online direct from Baozeng's Subversion branch.

Kosei Moriyama has been working on Perl bindings for the Xapian library using SWIG, to replace some existing bindings implemented by hand. He's achieved almost complete compatibility with the API of the existing bindings (the only real omission is callbacks which are waiting for completion of director support for Perl in SWIG). He has also wrapped features which weren't previously accessible from Perl. You can view Kosei's work online in his Subversion branch.

Finally, many thanks to Google for sponsoring the Summer of Code and a special thanks for all the hard work done by the students, mentors and Olly Betts, the co-administrator.

Perls of Wisdom: The Perl Foundation & Parrot's Google Summer of Code

Monday, October 5, 2009

Google Summer of Code™ 2009 (GSoC) was filled with fresh faces and exciting new projects for The Perl Foundation (TPF). As I write this, we are currently in the final stage of the summer where students submit evidence of their work in a zip/tar.gz file by uploading it to a publicly viewable repository. I very much like that now anyone on the 'net can download a file containing the entire summer of work by the student, and there is even a download count next to each file for each student!

We started the summer with nine students, but Kevin Tew was not able to work on "A prototype LLVM JIT runcore for Parrot" in the program due to external issues. He is still a core Parrot Virtual Machine developer and I hope that he can find time to work on this awesome project some time in the near future. Since Parrot is currently redesigning its JIT framework from the ground up, a project similar to this would be great for next year.

The other Parrot VM project was Daniel Arbelo Arrocha working on "Decimal Arithmetic: BigInt, BigNum and BigRat for parrot" with Christoph Otto as a mentor. Big Decimal Arithmetic basically means storing arbitrary large/arbitrary precision numbers internally in a decimal format rather than the binary format usually used. Doing this can prevent catastrophic rounding errors. If you can store numbers internally with exactly NO error, then obviously this is A Very Good Thing. Daniel worked on making dynamic PMC's (Polymorphic Parrot Classes, or Parrot Magic cookies, take your pick) which wrap the mature and extensive IBM's libdecnumber library. What this means is that Parrot can do arithmetic on arbitrarily large integers (BigInt's) or floating point numbers with arbitrary precision (BigNum's.) Financial people are very interested in these as well, since no one wants to be short-changed on their interest due to rounding error. Daniel has also been contributing patches to many other parts of Parrot and will probably be getting a commit bit soon, which is great news to hear.

Devin Austin worked on "Refactoring Catalyst helper modules", with Kieren Diment as a mentor. This involved some "Moosification", which means refactoring home-rolled object-oriented code to use Moose (the post-modern Perl 5 object system), i.e. less code to maintain and more features at your fingertips.

I am excited to talk about our next student, who worked on a Perl 6-related project. Carl Mäsak mentored Hinrik Örn Sigurðsson on "Perl 6 End-User Documentation Tools" (github repo) . Hinrik is working on the grok command, which is the Perl 6 relative of perldoc. With it, you can get documentation for Perl 6 functions from the spec, read the Synopses and Apocalypses, and occasionally attain temporary enlightenment. If you have a properly installed CPAN client on your computer, you can install it with cpan App::Grok.

Our other exciting Perl 6 project was Paweł Murias working on "Multimethods for SMOP", mentored by Daniel Ruoso, the lead developer of SMOP. SMOP stands for Simple Meta Object Programming (or Simple Matter of Programming, if you are feeling snarky) and it is an implementation of Perl 6, a sister of Rakudo. Multimethods, short for Multiple Method Dispatch, is a feature where a language can determine which variant of a set of functions to call, based on the type of their arguments. One way that this becomes very powerful is that you can use wildcard arguments when you declare your multimethod, so you can essentially write many functions at once. Less code to maintain is a big WIN ! Paweł's code is being directly merged into the mainline SMOP codebase and from what I hear, he is and will continue to be a core contributor. That is what GSoC is all about. That and free t-shirts.



State Transitions in Mojo::Pipeline

Pascal Gaudette worked on "HTTP/1.1 Compliance Testing and User-Agent Development for the Mojo Web Framework" with mentor Viacheslav Tykhanovskyi. This is important because Mojo, one of the newest and most exciting Perl Web frameworks did not have much testing for acting correctly according to HTTP/1.1 . Part of the work of this summer has become the CPAN module MojoX::UserAgent. He has a great blog post about "State Transitions in Mojo" wherein he explains how Mojo deals with state and generated some pretty cool transition diagrams by documenting when a state transition happens in the test suite and then feeding this data into Graph::Easy.

WebKit has become often-forked and very influential open source browser engine, so it is no surprise that Perl hackers want bindings to it. Ryan Jendoubi worked on "Cross-platform Perl Bindings for wxWebKit" with mentor Michael Peters, which allows WebKit and WxWigdets, a cross platform GUI library, to talk to each other via wxWebKit. I think this was one of the more difficult projects this year, not because of the programming/algorithms involved, but because it requires getting lots of cross-platform, constantly-changing and fickle pieces of software to get along with each other. This is often like inviting zebras and lions to the same party. Messy and dangerous. But Ryan prevailed and we give him much respect and hope that he continues to maintain and improve the Wx::WebKit bindings.

I had the pleasure of mentoring Robert (Bob) Kuo this summer on his work entitled "Implement BPSW algorithm as a Perl 5 CPAN module, Math::Primality with extensive test-suite." The Math::Primality module is already on CPAN and I am glad to announce that Bob is listed as co-maintainer and published the latest release. This module is important because the Perl 5 Cryptography CPAN modules (mostly in the Crypt::* namespace) have one, very large, very fragile dependency, called Math::Pari. Math::Pari is an amazing library that gives Perl access to the extensive state-of-the-art number theory library PARI, but to attain ultimate speed, Math::Pari pokes into undocumented internal-only Perl core internals, which means that changes to Perl internals that *shouldn't* have any effect on the outside world can cause the entire Crypt::* namespace to break. Also, most of the Crypt::* namespace require only 5-10 functions from Math::Pari, which provides an interface to thousands of functions. Math::Primality implements the few prime-checking (primality) functions that Crypt::* modules want from Math::Pari in a small, easy-to-maintain, pure-Perl CPAN module. Bob implemented the BPSW algorithm, a state of the art prime-number checking algorithm which allows you to check if an arbitrarily large number is prime in O( log(n) ) i.e. logarithmic running time. It is actually a combination of very different prime number checks, which weed out different types of non-prime numbers. So far, no one has found a counter-example to the BPSW algorithm (even though those pesky mathematicians say there probably are), so it is the best out there currently. It is estimated that because no one has seen this algorithm fail yet, and it being used extensively from within other algorithms, that the first counter-example must be at least 10,000 decimal digits long! Future steps for this module will be to work on its sister module, Math::Factoring, which implements the remaining factoring-related functions that Crypto modules want and then use both modules as new dependencies for the Crypt:: namespace, instead of Math::Pari.

Justin Hunter was mentored by Ash Berlin on the project "SQL::Translator Rewrite" (github repo). SQL::Translator is a very popular CPAN module for translating various "flavors" of SQL to and from each other, such as Postgres to MySQL. This involved more "Moosification", as described above. Justin also has some advice for hopeful GSoC students:
  • Get over yourself.

  • Understand there are people smarter than you or people better at some things than you.

  • Just the same, you're still needed.

  • Just Go Ahead and Do It and find your niche.

I wish someone had told me that about 10 years ago. I would not have wasted a lot of time worrying that people would think I was stupid and starting diving into Open Source projects much more earnestly.

In total, we had a success rate of 8/9 = 88.8%, just a bit above this year's all time high of 85%. Please join me in congratulating all these students and mentors for their top-notch work ! I can honestly say that I had much fun interacting with so many corners of the Perl community. This was my first year being an organization administrator, I learned a lot by my favorite method: sink or swim. I was handed over the magic rocket-powered surf board by Eric Wilhelm after successfully mentoring Thierry Moisan last year on the Math::GSL CPAN module. Organizing and communicating with people spread across a dozen time zones is definitely an art that I am still mastering. I think using as many mediums as possible to communication with people is key. I already use chat, email and IRC, but I wish I had done voice/skype and/or video chat with some of my students and mentors, so that everyone has a face to attach to a name.

I would also like to thank Jerry Gay for being The Perl Foundation co-pilot this year and welcoming me into the Parrot community. Your guidance in certain matters went a long way.

For anyone that would like to help/be involved in Google Summer of Code with The Perl Foundation next year, we cordially invite you to our IRC channel, #soc-help on irc.perl.org, and the mailing list.

.