mp has asked for the wisdom of the Perl Monks concerning the following question:
In working on a web application, I am reaching the point at which I need to provide administrators with some limited scripting capability through a password protected web interface. Capabilities would initially need to include if...elsif...else, return, boolean logic, numeric expressions, retrieving and storing of data from/to a SQL database, and set operations (union, intersection, etc).
I have been exploring several alternatives:
- represent structure in XML
- Disadvantage: ugly to edit, verbose
- Advantage: introspection is easy
- build an API and allow full use of perl as the scripting language
- Disadvantage: few limits to power and flexibility; more training required.
- Advantage: few limits to power and flexibility
- define a mini-language and write a translator to convert it to perl for execution
- Disadvantage: additional work over option 2 and less power and flexibility
- Advantage: introspection easier than option 2, power and flexibility can be limited appropriately; less training required than option 2.
I am leaning toward the third option -- minilanguage with translator to perl. Are there any major pitfalls with such an approach?
I have not found much written about writing a minilanguage translator in perl, though Template Toolkit does serve as an example. Can anyone point me to some good resources as to how to get started down this path?
I envision bulding the parser/translator in something like Parse::RecDescent or Parse::Yapp. Parsing speed is not very critical in this application because code would be parsed once and converted to perl, then used many times.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Embedded perl or mini-language translator to perl
by eric256 (Parson) on Sep 01, 2004 at 16:35 UTC | |
Re: Embedded perl or mini-language translator to perl
by kvale (Monsignor) on Sep 01, 2004 at 16:59 UTC | |
Re: Embedded perl or mini-language translator to perl
by gmpassos (Priest) on Sep 01, 2004 at 19:36 UTC | |
Re: Embedded perl or mini-language translator to perl
by ikegami (Patriarch) on Sep 01, 2004 at 16:44 UTC | |
by mp (Deacon) on Sep 01, 2004 at 17:05 UTC |
Back to
Seekers of Perl Wisdom