PDL Questions - Dec. 21, 2013

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
PDL Questions - Dec. 21, 2013

       Several of us including a retired computer programmer and I are  
gradually developing various science related computer programs.  And present  
efforts involve selecting the best computer languages for these efforts.


       One of the main Perl language limitations is calculation speed.  And  
I would be interested in any information that people have on what type of  
calculation speed improvements can be made if the PDL module is used with  

       Also, how good is it for graphics?

       My current ActiveState Perl based programs will need to be translated  
to a newer version so that PDL will run.  And some of the presently used  
commands will not work with the newest version.  But that translation can be  
managed if it appears to be worth the effort.

       The latest ActiveState version was downloaded and run on a different  
computer.  And the PDL module was linked with it.  But although the PPM  
program automatically loaded some support modules that PDL needed it would  
apparently not run without some additional types of modifications.  So I  
could not do any calculation speed or graphics tests using it myself.  And I  
have not yet had time to try to determine what additional modifications need  
to be made to get the PDL module to work.


       This is another language that is being considered.  It appears that  
it might be something like a supercharged version of Fortran.


       Several of us downloaded the program and tried to get it running  
without success.  And unfortunately there does not appear to be a Julia  
language Newsgroup where questions can be asked.  So that evaluation effort  
is still ongoing.


       One of my programming colleagues has apparently already made the move  
from TrueBasic to Fortran.  The calculation speed differences between Perl  
and TrueBasic and Fortran that he is finding are pretty amazing to me.  I  
was also surprised to see that there can be considerable differences in  
calculation speed with Fortran programs depending on which compiler or IDE  
is used.  My retired programming colleague tested two called Plato and  
Simply Fortran.

       For the calculations we are presently running, the Plato generated  
code was 4 times faster than the Simply Fortran code and about 35 times  
faster than the TrueBasic code.  Perl was not checked.  But I would  
eventually like to compare the Fortran times with PDL module code  
calculation times.

       People that I have talked with so far don't know too much about the  
following.  So, these comments are not based on any expert input.  And one  
or more might be incorrect.

       One of standard Fortran's limitations appear to be the fact that it  
doesn't have a "sleep" command that will tell it to stop using processor  
time and go into a temporary idle mode.

       Perl in contrast does have at least two types of sleep commands.  And  
watching the computer processor work being done in a Windows environment I  
can see that Perl does actually stop using all of the processor time when it  
goes into a "sleep" type of temporary idle mode.

       Also without using special modules Fortran does not have commands  
that allow it to easily interact with Windows and active Windows programs.

       And special libraries need to be used to get it to do graphics.

       It will be interesting to see how the Julia language compares with  
Fortran and Perl PDL regarding those topics.

Re: PDL Questions - Dec. 21, 2013

Perl is great, but for row calculation power there is only C.
So I think youy core function must me coded in C and use them through  
the module  Inline::C

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it


       So far I haven't seen a good explanation of exactly how the PDL  
module works.  But I am guessing that when Perl is told to run, that module  
converts some specially written Perl code to something like C language code.  
And then that C (or whatever) code runs instead of having Perl run all of  
the Perl code one statement at a time.

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it


       Additionally, if you look at the Julia language Web page, there is a  
computation benchmark speed chart.  And it shows that Julia calculations are  
pretty fast.  They are roughly good matches with both C and Fortran language  
calculation speeds.

       Perl PDL calculation speed is not included with that benchmark chart.  
Assuming that PDL calculations are much faster than regular Perl language  
calculations I personally feel that the Julia people should probably also  
run speed tests on the PDL module and add that information to the chart.  
And if I had been able to find a contact E-mail address at the Julia Web  
site or a Julia Newsgroup I would have already contacted them about that.

Re: PDL Questions - Dec. 21, 2013

Στις 21/12/2013 19:28, ο/η E.D.G. έγραψε:
Quoted text here. Click to load it

are you involved at  pdl.perl.org  ?
if so, and you want any specific help to translate something to newer  
Perl version I could help

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it

Hi George,

Thanks for the offer.

       No, I am not involved with Perl PDL development efforts.  And I am  
somewhat surprised that ActiveState Perl PPM by itself was not able to get  
the PDL module to run without some other types of modifications.  Usually  
PPM works fairly well.

       At the moment I don't have time to try to convert my ActiveState Perl  
programs to newer versions.  And also before attempting that I want to  
determine if PDL would make it possible to do calculations and graphic work  
faster and easier.  If not then efforts will probably shift to translating  
all of my Perl programs to some other language such as Fortran or Julia.  
Moving to Python does not appear to be a worthwhile effort as Python is also  
by itself fairly slow with calculations.

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it

From page 7 of the PDL manual: "In PDL each of these [functions] is implemented by heavily  
optimized C code, which is what makes PDL very efficient for procession of large chunks of  
data. If you did the same operation using normal perl arrays rather than piddles it would be  
about ten to twenty times slower (and use ten times more memory)."

John Black

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it

Hi John,

       Thanks for tracking down that information.   I did read through some  
of their documentation but did not come across those details myself.  And  
from the lack of responses here to my questions I have to wonder how many  
people are actually using the Perl PDL module.

       It looks like PDL could be a very powerful and useful addition to  
standard Perl.  And it appears that it probably does the same things as a  
module that I myself encouraged ActiveState to develop quite a while ago.

       That C code generation is largely what I thought PDL might be doing.  
And that information generally answers several question:


Q: What type of accelerated code is actually generated?

A:  It is some version of C.


Q: How fast is that new code compared with regular Perl code, Python,  
Fortran,  C, or Julia?

A:  It appears that if it is optimized C code then the calculations are  
likely as fast as or faster as any of those other languages including  
perhaps Fortran.

       If I can determine how to contact the Julia language people I am  
going to recommend to them that they run their calculation speed tests using  
the PDL module and then add that information to their Web page benchmark  

A third question that I myself have had is,

Q: Would it be worthwhile for me to upgrade my Perl programs to the latest  
ActiveState version so that the PDL module can be used?

A: With that potential calculation speed improvement and assuming that the  
graphics work much better, that update looks quite reasonable.

       One of the reasons for wanting to stay with Perl is that Perl appears  
to run on almost every Internet Server on the planet.  Other languages can  
probably be installed on some servers.  But that means more work.

       I don't know if the PDL module would be available with the Perl  
versions on most Internet Servers.  Hopefully it is.  That could make Web  
site based graphics a lot easier.  Or perhaps PDL could be installed if  
necessary.  I can get that information myself from my own Internet Server  

Re: PDL Questions - Dec. 21, 2013

On 23/12/13 14:32, E.D.G. wrote:
Quoted text here. Click to load it

Don't lose heart; don't be discouraged.  The lack of response here is  
probably because people lose the will to live through trying to help you  
in your futile project.

Wherever it is that you're trying to get to, you won't get there from  
where you are.


Henry Law            Manchester, England

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it

       What "project" might that be?  I presently have several dozen  
underway covering a wide variety of science and medical efforts.

       And again, it would be my guess that not too many people are  
presently using PDL.  One indicator of that would be the problems that I  
myself have had so far with getting the module to install and run using PPM.  
Usually new modules install without any problems.

       Actually, I have several degrees in the physical sciences and regard  
myself as a disaster mitigation professional.  My research and advice  
related to a wide variety of life saving, health improving, and economy  
strengthening efforts have, in my opinion, been used extensively by  
governments and NGOs around the world for many years.

       The programming work that I do is largely just whatever is needed to  
glue other efforts together.

       At the moment the main programming "project" is to find a faster and  
more efficient language than standard Perl.  And if that PDL module works as  
well as it sounds, then I will probably eventually create a "Perl for  
Scientists" Web page.

       Perhaps the main problem with having scientists around the world use  
Perl is that the free downloadable documentation for beginner and  
intermediate level programmers such as myself is in my opinion not very  

If you want to do something as simple as:

for $i(1..5){;
print $i*2, "\n";

You don't want to have to spend a year trying to learn how to install Perl  
and get things running.

       It took me a long, long time to learn how to even get Perl to  
generate exe versions of a program.  And it is actually extremely easy to do  
once you learn how it works.  But the documentation for how to do that was  
unclear or almost nonexistent for a beginner or intermediate level  
programmer in my opinion.  The documentation should say, 1. Do this. 2. Do  
this. 3. Do that.

       Other than that, if Perl calculations can be made to run faster using  
PDL and if the module also provides adequate graphics then it is my opinion  
that I have stated repeatedly over the years that it is likely a high value  
language for scientists who are not professional programmers.  For example,  
I myself like that fact that arrays don't have to have predefined sizes etc.  
Most modern computers have enough memory that a simple program doesn't have  
to be optimized for array sizes.

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it

s/lose/lost many years ago/


Re: PDL Questions - Dec. 21, 2013


Quoted text here. Click to load it

I started to use Perl around the mid-nineties, with no prior programming
experience except as a (teenage - early 20s) hobbyist using Turbo Pascal
for DOS and a little bit of C++ for Windows and OS/2[*] and while I
gladly restricted myself to the more shallow areas, I found using the
language to accomplish what I wanted to accomplish (which was not
necessarily always a sensible or even just remotely viable way to
accomplish what I should have accomplished) no great obstacle.
[*] I also implemented a few intolerably slow OO-systems using some Lisp
implementation which worked on DOS.

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it

You should run for elective office.


(try just my userid to email me)
see X- headers for PGP signature information

Re: PDL Questions - Dec. 21, 2013

Quoted text here. Click to load it

He sure is superbly qualified: no clue, but convinced the world is
desperately waiting for him.


Site Timeline