Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: A minilanguage with the least effort?

by moritz (Cardinal)
on Feb 17, 2009 at 13:21 UTC ( [id://744398]=note: print w/replies, xml ) Need Help??


in reply to A minilanguage with the least effort?

The least effort is eval, which can be used to implement a mini-language called "Perl". (Note that this comes with security implications).

The second least effort is to use a CPAN module that implements a minilanguage.

Or of course you can write a parser for it (if it's really mini that's going to be easy) and a backend.

The exact approach varies greatly on what you actually want your minilanguage to do.

Replies are listed 'Best First'.
Re^2: A minilanguage with the least effort?
by clinton (Priest) on Feb 17, 2009 at 13:27 UTC
Re^2: A minilanguage with the least effort?
by wol (Hermit) on Feb 17, 2009 at 18:28 UTC
    "Security implications"? Surely it would be just as secure as everyone's favourite language: Perl.

    That aside, here's an implementation (complete with syntax checking) for the mini-est language I can think of.

    $_ = <>; die "Syntax Error\n" unless m/^[10]$/; die "Syntax Error\n" if defined <>; exit $_;
    I'll leave it up to you to work out what the valid input is.

    --
    use JAPH;
    print JAPH::asString();

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found