Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl; Shutting Down Indefinitely

posted by pudge on 2010.09.08 15:51   Printer-friendly
As I am leaving my current job at Geeknet -- which has generously hosted use Perl; for all these years, since the site began in 2000 -- I am temporarily shutting down use Perl; tomorrow, Thursday, Sept. 8. I plan to leave the site "static" for now, and then perhaps have it reappear elsewhere.

News: Pittsburgh Perl Workshop CFP ends Mond.ay Sept 6th

posted by davorg on 2010.09.06 9:17   Printer-friendly
rblackwe writes "The Pittsburgh Perl Workshop 2010 will be Saturday October 9 and Sunday 10 at the Gates Center at CMU.

Don't miss your chance to speak at this years Workshop. The Call For Papers ends Monday Sept 6.

Submit your talk."

News: Rakudo Perl 6 development release #29

posted by brian_d_foy on 2010.05.23 6:50   Printer-friendly
colomon writes "On behalf of the Rakudo development team, I'm pleased to announce theMay 2010 development release of Rakudo Perl #29 "Erlangen". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org./ The tarball for the May 2010 release is available from http://github.com/rakudo/rakudo/downloads .

Rakudo Perl follows a monthly release cycle, with each release named after a Perl Mongers group. The May 2010 release is code named "Erlangen" in recognition of Erlangen.pm and the Perl 6 talk that Moritz Lenz, one of our core developers, gave this month.

Some of the specific changes and improvements occurring with this release include:

* Lexical classes and roles were implemented. Additionally, anonymous classes which were never quite right in alpha are now implemented more correctly, and anonymous roles are also supported.

* Basic support for named enumerations of the form 'enum Weekday ' has been restored.

* First cut of use Foo:from and eval('foo', :lang); needs Blizkost[1] to be installed to work.

* Numeric / Real roles much closer to the spec now.

* As always, many additional small features and bug fixes make working with Rakudo more pleasant.

* Rakudo now passes 32,347 spectests. We estimate that there are about 39,500 tests in the test suite, so Rakudo passes about 82% of all tests.

For a more detailed list of changes see "docs/ChangeLog".

The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on parrot, the Perl 6 test suite and the specification.

The following people contributed to this release: Solomon Foster, Moritz Lenz, Jonathan Worthington, Martin Berends, chromatic, Carl Masak, snarkyboojum, Stefan O'Rear, Reini Urban, Jonathan Scott Duff, takadonet, Christoph Otto, isBEKaml, ash_, bubaflub, Jimmy Zhuo, Peter Lobsinger and Patrick Abi Salloum

If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode.

The next release of Rakudo (#30) is scheduled for June 17, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month.

Have fun!

[1] http://github.com/jnthn/blizkost"

Ctypes for Perl: Intro and API spec

Journal written by doubi (9222) and posted by brian_d_foy on 2010.05.23 6:50   Printer-friendly
Hello, good evening and welcome.

For the next few months I will be using this blog to help document and publicise my "Ctypes for Perl" project. The project is being carried out for TPF under the auspices of the Google Summer of Code programme, and mentored by Reini Urban.

What's a ctypes?

'ctypes' is the Foreign Function Interface (FFI) library distributed with the Python core. It basically allows native C libraries to be called easily from Python; for module authors, it allows the wrapping of C libraries in pure Python.

This is obviously a powerful concept. Imagine a world where Perl module authors didn't need to use XS, and module consumers don't need to have a correctly configured compiler set up on their system. This is the purpose of the project: to create an easy, cross-platform, pure-Perl interface to native C libraries.

Implementations

ctypes is based on libffi. It's small, supports a wide range of systems, and has a very liberal license. It's been distributed with GCC for a number of years, used by gcj for interfacing between interpreted and compiled code.

From what I can gather, Python set the trend in dynamic languages using libffi. Looking at the success of the Python module, developers at Mozilla chose libffi to develop ctypes.jsm. Ruby-FFI uses it too, so there's plenty of prior art which will hopefully help me out.

The FFI problem hasn't been ignored in the Perl world. There's FFI.pm, the biggest disadvantage of which in my view is being built on libffcall, a library analogous to libffi but under the GPL (I don't think libffi was around at the time FFI.pm was written). It also sets out to provide a 'low-level' interface. P5NCI, on the other hand, is all about the lovely interfaces, but only allows up to four arguments passed to C functions, and doesn't yet support passing in pointers. C::Dynalib provides similar functionality to the other two modules; click here for the latest updates on its development. It's worth pointing out that none of these modules worked out of the box on Strawberry 5.10.1.

My proposed API rolls in features of several of the above implementations, particularly P5NCI and FFI.pm. I have indeed copied and pasted swathes from their POD pages (So what? Wanna fight about it?). I plan to also mimic C::DynaLib's acceptance of both positional & named parameters; examples are omitted below for succinctness.

1. Functional

use Ptypes;
# FFI.pm's interface of Absolute Freedom...
my $addr = (address of a C function)
my $signature = (function signature)
my $ret = Ptypes::call($addr, $signature, ...);

# Keeping things where you can see them...
my $library_path = Ptypes::find_lib( 'mathtastic' );
my $library = Ptypes::load_lib( $library_path );
my $double_func = Ptypes::load_func( $library, 'double_double', 'dd' );
my $ret = $double_func->( 1.0 );

# Supplying a Perl callback...
$ret = Ptypes::call($addr, $signature, $subref, ...)

2. Objectionable

use Ptypes;
my $lib = Ptypes->new( library => 'mathtastic' [, package => 'MyPackage' ] );
my $double_func = $lib->load_function( 'double_double', 'dd' );
my $ret = $double_func->( 1.0 );

# Exposing funcs directly in Perl namespaces...
$lib->install_function( 'double_int', 'ii' [, 'perl_sub_name', 'AnotherPackage' ] );
my $ret = AnotherPackage::double_int( 1 );

# or simply...
package AnotherPackage;
my $ret = double_int( 3 );

All fairly self-explanatory, perhaps apart from arguments like 'ii' or 'dd' - these strings describe return values and arguments for C functions in the same notation used by pack. In addition to the above, the module may provide mechanisms for manipulating C data types directly from Perl ($c = new Ptypes::char). To start off with though there'll be a fairly straight-forward / 'stupid' translation based on seeing what kind of data's in your SV*, for initial experimentation.

There's also some exciting stuff to do with GCC::TranslationUnit to tell you about, but details of that will wait till later. For now, I have some questions for you, the community:

  • How d'you like the API proposal above? Anything you'd add? Take out?
  • How does 'Ptypes' take you as a name for this malarky? Y'know, like ctypes, but for Perl. 'FFI' is already taken after all...

Don't want to gush here, but I'm so chuffed* to be working on this. I'm already learning loads, and I think it will save a lot of blood, sweat & tears for module authors and users in the future. I want to thank rurban for his guidance & help so far, and dukeleto and others for organising the The Perl Foundation's participation in GSoC and letting me participate!

I like to work log, so follow @doubious_code on Twitter to get far more information than you want about this project. I hope to be blogging pretty regularly too.

* For American-speakers, 'chuffed' is kinda equivalent to 'stoked'

News: Perl 5.12.1 now available

posted by jesse on 2010.05.18 10:52   Printer-friendly

"Now suppose," chortled Dr. Breed, enjoying himself, "that there were many possible ways in which water could crystallize, could freeze. Suppose that the sort of ice we skate upon and put into highballs what we might call ice-oneis only one of several types of ice. Suppose water always froze as ice-one on Earth because it had never had a seed to teach it how to form ice-two, ice-three, ice-four ... And suppose," he rapped on his desk with his old hand again, "that there were one form, which we will call ice-ninea crystal as hard as this deskwith a melting point of, let us say, one-hundred degrees Fahrenheit, or, better still, a melting point of one-hundred- and-thirty degrees."

                                                                           -- Kurt Vonnegut, Cat's Cradle

It gives me great pleasure to announce Perl 5.12.1, the second stable release of Perl 5.12.

You can download Perl 5.12.1 from your favorite CPAN mirror or from: http://search.cpan.org/~jesse/perl-5.12.1/

SHA1 digests for this release are: 75a8a17cec15d68c6bb959b0aa9879d2ded6f90d perl-5.12.1.tar.bz2 83b99f08379782dc06594a85eeb279edc5b0ca44 perl-5.12.1.tar.gz

This release contains minor bug fixes and updates of several core modules, as well as minor documentation updates. It should be fully backward compatible with Perl 5.12.0.

Perl 5.12.1 is a recommended upgrade for all users of Perl 5.12.

You can find a full list of changes in the file "perl5121delta.pod" located in the "pod" directory inside the release and on the web at: http://search.cpan.org/~jesse/perl-5.12.1/pod/perl5121delta.pod

Perl 5.12.1 represents approximately four weeks of development since Perl 5.12.0 and contains approximately 4,000 lines of changes across 142 files from 28 authors.

Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.12.1:

Ævar Arnfjörð Bjarmason, Chris Williams, chromatic, Craig A. Berry, David Golden, Father Chrysostomos, Florian Ragwitz, Frank Wiegand, Gene Sullivan, Goro Fuji, H.Merijn Brand, James E Keenan, Jan Dubois, Jesse Vincent, Josh ben Jore, Karl Williamson, Leon Brocard, Michael Schwern, Nga Tang Chan, Nicholas Clark, Niko Tyni, Philippe Bruhat, Rafael Garcia-Suarez, Ricardo Signes, Steffen Mueller, Todd Rinaldo, Vincent Pit and Zefram.

We expect to release Perl 5.12.2 in mid-August 2010, followed by Perl 5.12.3 in mid-November. The next major release of Perl 5, 5.14.0 should appear in spring 2011.

Yesterday's News  >