3
PDL::Philosophy -- what's behind PDL?
7
This is an attempt to summarize some of the common spirit between
8
pdl developers in order to answer the question "Why PDL"? If
9
you are a PDL developer and I haven't caught your favorite ideas
10
about PDL, please let me know!
12
An often-asked question is:
13
Why not settle for some of the existing systems like Matlab or IDL
14
or GnuPlot or whatever?
18
The first tenet of our philosophy is the "free software" idea:
19
software being free has several advantages (less bugs because
20
more people see the code, you can have the source and port
21
it to your own working environment with you, ... and of course,
22
that you don't need to pay anything).
24
The second idea is a pet peeve of many: many languages like matlab
25
are pretty well suited for their specific tasks but for
26
a different application, you need to change to an entirely
27
different tool and regear yourself mentally. Not to speak about
28
doing an application that does two things at once...
29
Because we use Perl, we have the power and ease of perl syntax,
30
regular expressions, hash tables etc at our fingertips at all times.
31
By extending an existing language, we start from a much healthier
32
base than languages like matlab which have grown into existence
33
from a very small functionality at first and expanded little by little,
34
making things look badly planned. We stand by the Perl sayings:
35
"simple things should be simple but complicated things should be
36
possible" and "There is more than one way to do it" (TIMTOWTDI).
38
The third idea is interoperability: we want to be able to use PDL
39
to drive as many tools as possible, we can connect to OpenGL or Mesa for
40
graphics or whatever. There isn't anything out there that's really
41
satisfactory as a tool and can do everything we want easily. And be portable.
43
The fourth idea is related to PDL::PP and is Tuomas's personal
44
favorite: code should only specify as little as possible redundant
45
info. If you find yourself writing very similar-looking code
46
much of the time, all that code could probably be generated by a simple
47
perl script. The PDL C preprocessor takes this to an extreme.
49
=head2 Minor goals and purposes
51
We want speed. Optimally, it should ultimately (e.g. with the Perl compiler)
52
be possible to compile PDL::PP subs to C and obtain the top vectorized
53
speeds on supercomputers. Also, we want to be able to calculate
54
things at near top speed from inside perl, by using dataflow to avoid
55
memory allocation and deallocation (the overhead should ultimately be only
56
a little over one indirect function call plus couple of ifs per
57
function in the pipe).
59
We want handy syntax. Want to do something and cannot do it easily?
62
We want lots of goodies. A good mathematical library etc.
66
Copyright(C) 1997 Tuomas J. Lukka (lukka@fas.harvard.edu).
67
Redistribution in the same form is allowed but reprinting requires
68
a permission from the author.