Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Potential project - Perl Beads?

by princepawn (Parson)
on Sep 24, 2001 at 22:54 UTC ( [id://114395]=note: print w/replies, xml ) Need Help??


in reply to Potential project - Perl Beads?

 I've got an idea. Instead of using XML, which is incredily slow to parse and create, we could just use standard Perl data structures. We'll call them objects. Then we'll need a text language for writing the description of how to connect them. We'll call that Perl.

This is exactly why Mark-Jason Dominus wrote Text::Template and it is exactly why it is paradoxical that you would be such a Template Toolkit fiend when it is in fact a 3rd technology between two technologies which can stand quite well on their own two feet (HTML and Perl). As MJD said: "the second you start writing your own language, you realize you need a loop. And then a reference. And pretty soon you realize you need Perl.. and you already know it.. so why not use it! (paraphrase).

It's trivial to do code generation in Perl with the power of eval(), so why create an entirely new way to do it?
Perl is a verysyntax-heavy and syntax-complicated language. Now it makes for easy English-like hand-coding, but for program text generation, Prolog and Lisp are the easiest because they have 50-100 times fewer syntactic elements and 100 to 1000 times fewer funny ambiguous overloaded operators and statements. Exageration intentional, but not far off the mark.

Replies are listed 'Best First'.
Re: Re: Potential project - Perl Beads?
by perrin (Chancellor) on Sep 25, 2001 at 17:26 UTC
    The goal for this idea, as I understand it, is to write a GUI program which allows users to specify connections between components and then generates code to do it. There's no real need to create an intermediary specification language there, since it's so easy to do code generation with Perl. Seriously, it's so simple that beginners often use it too much, eval'ing as a solution to everything.

    Of course, if people WANT to write the specification language by hand then you could use XML for it, or you could use some kind of simple macro language. If it was simple enough, you could use Template Toolkit for it. Regardless, I don't think you'll see non-programmers writing it by hand.

    I don't think the HTML templating debate is really so similar. HTML with templating constructs usually is coded by hand, often by non-programmers, and it doesn't lend itself to the same kind of GUI tool approach that's described here because it's a mix of formatting and simple control structures that can't be fully shown with either a WYSIWYG approach or a flowchart approach (like XBeans seems to have). I generally prefer mini-languages like Template Toolkit over in-line Perl solutions when generating HTML because they make things easier on the HTML coders and help prevent pollution of templates with too much programming logic. These concerns don't really apply to an XBeans project.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://114395]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2024-03-19 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found