Module submission: REV

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I've written a mini programming language called REV for data
validation.  REV stands for Really Easy Validation - and is a language
similar to Perl that can be compiled to Perl, PHP, and JavaScript.
(with more languages on the way)  The idea is to write validation code
only once and then compile it to JavaScript and to your server side
language.  The language itself is pretty powerful.  For example:

error("Please specify a username") if empty <username>;
error("Please specify a valid email address") unless @ <email>;

These are the most basic types of statements - they check a given form
field (variables in <>) for a specific condition - if it is empty or if
it is an email (the @ operator).  Lots of other data type checks are
available.  You can also create temporary variables and use constructs
like loops.  Consider a form that uses JavaScript to allow you to add
many email addresses to a mailing list. (i.e. you can click on 'Add
Another Address' and you get another text box)  Then, assuming your
JavaScript keeps updating a form field called 'maxIndex' you can use
the following code for validation:

error("Please specify at least one email address"0 unless <maxIndex> >
for i ( 1..<maxIndex> ) {
   error("Please specify a valid email address in box #" _ i) unless @

The compiler is written in Perl and I would like to register the
namespace REV for this module - but of couse I understand the
difficulties involved with top level namespaces.  Does anyone object to
this namespace?  Or suggest a different one?  I'd also like to register
Template::Plugin::REV for generation of JavaScript validation functions
using Text::Template.

For more information you also might visit - the current source code is there as


Re: Module submission: REV

Quoted text here. Click to load it

Please forgive my typo here - the first line should read

error("Please specify at least one email address") unless <maxIndex> >

Thanks again,

Re: Module submission: REV

Quoted text here. Click to load it

How about Compiler::REV?

Quoted text here. Click to load it

That sounds about right to me.


Cocoa programming in Perl:
Hire me! My resume:

Re: Module submission: REV

Sherm Pendley wrote:
Quoted text here. Click to load it

I like Compiler::REV - although there don't appear to be other
Compiler::* modules.  So that would be a new root level suggestion too!
 In fact, the only things I've seen have been the PHP and JavaScript
root level namespaces - hence my original choice.  Thoughts?


- Robby

Re: Module submission: REV

Robby Walker wrote:
Quoted text here. Click to load it

What about the Language:: namespace? It appears to contain Basic and
Haskell, as well as less-serious entries such as Brainf**k and Ook.

I have never tried to establish a top-level namespace. Once upon a time
you had to jump through hoops to get any kind of namespace registered,
but it seems to be easier now.

Tom Wyant

Site Timeline