Saturday, April 12, 2008

Language design
True to the glue language roots of Perl, PDL borrows from several different modules for graphics and plotting support. NetPBM provides image file I/O (though FITS is supported natively). PLPlot, PGPLOT, and Karma modules are all supported for 2-D graphics and plotting applications, and an interface to GL is available for 3-D plotting and rendering.

Perl Data Language Graphics
PDL provides facilities to read and write many open data formats, including JPEG, PNG, GIF, PPM, MPEG, FITS, NetCDF, GRIB, raw binary files, and delimited ASCII tables. Because of legal threats from Kodak, the owners of IDL, PDL cannot read or write IDL data files.

perldl
The core of PDL is written in C. Most of the functionality is written in PP, a PDL-specific metalanguage that handles the vectorization of simple C snippets and interfaces them with the perl host language via Perl's XS compiler. Some modules are written in FORTRAN, with a C/PP interface layer. Many of the supplied functions are written in PDL itself. PP is available to the user to write C-language extensions to PDL.
The PDL API uses the basic Perl 5 object-oriented functionality: PDL defines a new type of perl scalar object (eponymously called a "PDL") that acts as a Perl scalar, but that contains a conventional typed array of numeric or character values. All of the standard Perl operators are overloaded so that they can be used on PDL objects transparently, and PDLs can be mixed-and-matched with normal Perl scalars. Several hundred object methods for operating on PDLs are supplied by the core modules.