Perl Data Language

Perl Data Language

PDL (short for Perl Data Language) is a set of array programming extensions to the Perl programming language.

PDL is an extension to Perl v5, intended for scientific and other data intensive programming tasks. Perl's data structures are intended for small to medium sized analysis tasks: they embody simple data structures and include considerable behind-the-scenes magic for type conversion, variable size, and the like. Numerical tasks such as image processing and computer modeling of physical systems require more structured data, and PDL supplies this need by including more traditional array constructs and additional syntax to describe vector processes. On a computer with both Perl and PDL installed, any Perl script can use the PDL functionality by declaring "use PDL;".

Like Perl, PDL is free software.

Language design

PDL is a vectorized array programming language: the expression syntax is a variation on standard mathematical vector notation, so that the user can combine and operate on large arrays with simple expressions. In this respect, PDL follows in the footsteps of the APL programming language, and it has been compared to commercial languages such as MATLAB and Interactive Data Language, and to other free languages such as NumPy and Octave. Unlike MATLAB and IDL, PDL allows great flexibility in indexing and vectorization: for example, if a subroutine normally operates on a 2-D matrix array, passing it a 3-D data cube will generally cause the same operation to happen to each 2-D layer of the cube.

PDL borrows from perl at least three basic types of program structure: imperative programming, functional programming, and pipeline programming forms may be combined. Subroutines may be loaded either via a built-in autoload mechanism or via the usual Perl module mechanism.

As of early 2005, PDL-like functionality is being included in the Perl 6 language design.

Graphics

True to the glue language roots of Perl, PDL borrows from several different modules for graphics and plotting support. NetPBM providesimage 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 GLambiguous is available for 3-D plotting and rendering.

I/O

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 the IDL End User License Agreement does not allow for the reverse engineering of IDL Save/Restore files with a license, PDL cannot read or write IDL data files.

perldl

An installation of PDL usually comes with an interactive shell known as perldl, which can be used to perform simple calculations without requiring the user to create a perl program file. A typical session of perldl would look something like the following:

perldl> $x = pdl [1, 2] , 3, 4] ; perldl> $y = pdl [5, 6, 7] , 8, 9, 0] ; perldl> $z = $x x $y; perldl> p $z; [ [21 24 7] [47 54 21] ]

The commands used in the shell are perl statements that can be used in a program with PDL module included. x is an overloaded operator for matrix multiplication, and p in the last command is a shortcut for print.

Implementation

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. There is also an Inline module (Inline::PP) that allows PP function definitions to be inserted directly into a perl script; the relevant code is low-level compiled and made available as a Perl subroutine.

The PDL API uses the basic Perl 5 object-oriented functionality: PDL defines a new type of perl scalar object (eponymously called a "PDL", pronounced "piddle") 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.

See also

* List of numerical analysis software
* Comparison of numerical analysis software

External links

* [http://pdl.perl.org/ PDL - The Perl Data Language]
* [http://www.perlmonks.org/?node_id=587436 PDL Quick Reference] PDL Intro & resources


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Perl Data Language — (PDL) Класс языка: векторная (en:Array programming) Появился в: 1996 Автор(ы): Карл Глейзбрук, Шарль Бринчманн, Томас Лукка и Кристиан Соллер Релиз: 2.4.11 (20 мая 2012) …   Википедия

  • Perl — Desarrollador(es) Larry Wall www.perl.org Información general Paradigma multiparadigma, funcional, im …   Wikipedia Español

  • Perl — This article is about the programming language. For other uses, see Perl (disambiguation). Perl Paradig …   Wikipedia

  • Perl Object-Oriented Persistence — (POOP) is the term given to refer to object relational mapping mechanisms written in the Perl programming language to provide object persistence. Dave Rolsky divides POOP mechanisms into two categories:* RDBMS OO Mappers: These tools attempt to… …   Wikipedia

  • Perl 6 — Infobox programming language name = Perl paradigm = Multi paradigm year = 2000 designer = Larry Wall latest release version = pre release latest release date = typing = dynamic, static influenced by = Perl 5, Haskell, Smalltalk influenced =… …   Wikipedia

  • Perl OpenGL — Infobox Software name = Perl OpenGL caption = A screenshot illustrating FBO and Vertex/Fragment program extensions via POGL developer = Stan Melax, Kenneth Albanowski, Ilya Zakharevich, Jean Louis Morel, Bob Free latest release version = 0.57… …   Wikipedia

  • Perl Object Environment — For the Mach variant, see Mach kernel The Perl Object Environment or POE is a library of Perl modules written in the Perl programming language by Rocco Caputo et alia. From CPAN:: POE originally was developed as the core of a persistent object… …   Wikipedia

  • Perl module — A Perl module is a discrete component of software for the Perl programming language. Technically, it is a particular set of conventions for using Perl s package mechanism that has become universally adopted.[discuss] A module defines its source… …   Wikipedia

  • PERL — Paradigmen: prozedural, modular, teilweise objektorientiert Erscheinungsjahr: 1987 Entwickler: Larry Wall, Perl Porter Aktuelle  …   Deutsch Wikipedia

  • Perl (Programmiersprache) — Perl Paradigmen: prozedural, modular, teilweise objektorientiert Erscheinungsjahr: 1987 Entwickler: Larry Wall, Perl Porter Aktuelle Version …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”