You are talking about something like "literate programming", or we can say 
"literate analysis". Personally I would like to do that with noweb in Emacs. It 
sounds very nice to have mixed pod renderer + code editor. Just put my 2 cents, 
how about making a plugin of Padre?

XZ

From: David Mertens [mailto:[email protected]]
Sent: Tuesday, December 18, 2012 1:07 AM
To: Pablo marin-garcia
Cc: perldl list
Subject: Re: [Perldl] Is there a perl tool like ipython notebook? would be very 
useful for scratching (and teaching) pdl scripts

Wow, I'm sorry for not getting to this sooner. (And I'm sorry nobody else beat 
me to it.)
For those who do not know, Sweave allows its users to embed their calculation 
code directly into their LaTeX documents. This is very handy for many reasons. 
The author says that such documents "can be automatically updated if data or 
analysis change, which allows for truly reproducible research." ipython 
notebooks allow their users to intermingle rich text and Python code, with a 
similar sort of aim. That actually sounds more to me like a Mathematica 
notebook than Sweave, though perhaps Sweave users actually use it more like 
Mathematica than I realize.
The quick answer is "No, Perl and PDL do not have any near-clones of such 
facilities." But there are reasons.

The chief reason is that Perl's documentation format, POD, is actually really 
good, unlike Python's documentation format, for example. As such, Perl 
programmers have bent their expectations and mode of expression into using the 
tool at hand (POD) rather than creating the more expressive notebook style of 
documenting things.

Another reason why Perl and PDL has not evolved a notebook style of documenting 
things is that it is not inherently better than POD documentation, or even 
simple scripts with comments. It's different, and it may work with your brain 
better than POD or well written code comments, but for many people a notebook 
facility would lead to terrible habits. The real issue at hand is that of 
preserving provenance, and I am not convinced that a notebook actually helps 
one to cleanly preserve the provenance of one's data any better than a 
collection of well written and documented scripts with a clear starting point. 
For example, I have found that writing a README.pod file that helps orient my 
potential colleague, together with well-written pod in each of my scripts, is a 
fantastic way for me to get my head around how my data gets transformed. 
Admittedly, it's easy to get behind on this sort of thing, so I eventually 
created a simple GUI program using Prima that displays a list of the scripts in 
a selection list on the left of the window, and the script's pod documentation 
on the right. This made me feel much more compelled to explain the workings of 
my scripts in detail, and to include references to the results from other 
scripts. (Adding a button at the bottom to "Edit Script" removed the barrier of 
finding and opening those scripts, making the whole process even better.) 
Still, I find that if I have anything worth publishing in a journal, it's worth 
creating a bona fide set of modules to handle all the calculations for me. Then 
the data analysis becomes a collection of simple scripts, and the provenance of 
my data is apparent just from reading those scripts.

I find the idea of creating some sort of integrated code + documentation 
intriguing. I wrote App::Prima::REPL to provide a GUI shell instead of the 
command-line shell. I would be quite interested in taking your idea of 
notebooks and incorporating them, somehow, into App::Prima::REPL, if you have 
ideas and time to help. It already has the capability to open code in a tab. 
Perhaps we could develop some sort of mixed pod renderer + code editor?
David

On Sat, Nov 17, 2012 at 10:41 AM, Pablo marin-garcia 
<[email protected]<mailto:[email protected]>> wrote:
I have just recently discovered ipython notebooks[1] and and like (R
sweave[2]) they are essential for reproducible research.

Being pdl a scientific tool these kind of  utilities seems a perfect
match. Do someone knows something similar in Perl to be use with pdl2
shell?

[1] http://blog.fperez.org/2012/09/blogging-with-ipython-notebook.html
[3] http://www.stat.uni-muenchen.de/~leisch/Sweave/

--
   - Pablo Marin-Garcia

_______________________________________________
Perldl mailing list
[email protected]<mailto:[email protected]>
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to