There's more than one way to do things | |
PerlMonks |
Re: program design language - a reality?by danger (Priest) |
on Feb 21, 2001 at 03:21 UTC ( [id://59795]=note: print w/replies, xml ) | Need Help?? |
If you are interested, Literate Programming provides much of the benefits of PDL, and additional benefits as well. You describe your program and define it in a series of named 'chunks' -- within a chunk, you may include other chunks. Then you define/refine each chunk. The chunk names are rather like the pseudo-code. The literate source code file may be 'tangled' into an actual source file, or 'woven' into a typeset document (LaTeX, HTML, or some other format depending the tools you are using). So the root chunk (the chunk that defines the program) might look like (for a program called 'faqgrep'):
And then later you'd create the definition for each of those included chunks (and those may include chunks as well). So you get stepwise refinement and flexible order of presentation (we don't have to present those chunks in the order given, though in a case such as above it probably makes more sense to go linearly). Each of these 'chunks' is preceded (and/or followed) by the explanatory text (usually in LaTeX). Tangling assembles the chunks into the proper order to create your source code, and weaving turns it into a typeset document with any indexing and cross-reference features you (and the LP tool) have implemented. To find out more about LP: The faq is located here, and Mark-Jason Dominus has an article on perl.com. I use the noweb LP tool myself (not religiously though). I've been considering writing up a little introductory LP article for perlmonks, so let me know if you are interested.
In Section
Meditations
|
|