meta language to define forms

Eric S. Johansson esj at harvee.org
Fri Mar 28 08:11:11 EDT 2014


On 3/27/2014 4:56 PM, Sells, Fred wrote:
> I'm trying to use python classes and members to define complex data entry forms as a meta language
>
> The idea is to use a nice clean syntax like Python to define form content, then render it as HTML but only as a review tool for users,  The actual rendering would go into a database to let a vendor's tool generate the form in a totally non-standard syntax that's really clunky.

I've run into a similar problem when building a framework for 
programming by speech and web application development. Although, my 
goals were different. I want to something you can create with speech 
recognition without too much of a vocal load or requiring 
extensive/specialized editor changes. One could say I was trying to make 
it possible to develop web apps in Microsoft Word. :-)

The first attempt was a bracketed notation that was in effect a very 
high level domain specific notation. The next attempt is trying to 
eliminate the use of bracketing notation to specify scope and said use 
indentation.

Like you, the environment consists of little bits of Python that takes 
what you want in the form/user interface and generates the HTML and 
JavaScript for presentation in action.

To use your example, my notation would look something like this

: Form
   uses section_title; Enter Patient Vital Signs
   uses number_question; 3, Enter pulse rate
   : drop_down_list
     uses title; Enter current status
     uses choices; 1, alive and kicking
     uses choices; 2, comatose
     uses choices; 3, there's another dead Bishop on the landing

The: names refer to the methods that generate the code using the 
arguments provided by the statements within the: name definition. as 
refine what is your trying to do, you can make the: names more and more 
meta-and less and less implementation details. For example, one of the 
experiences that told me the bracketed notation was not going to fly was 
when I created a storefront for telescope shop. I created notation that 
expressed the work of the store not the display of the store 
information. Obviously the output of the notation was the display data 
but it operated in a way that the storekeeper understood and could take 
care of himself which was impossible with ordinary HTML and completely 
impossible if you added something like bootstrap.

And before somebody kicks up a fuss About the notation, let me say that 
this was aimed at disabled developers who cannot type anymore or who 
want to listen because they cannot see. What I have created is far more 
productive and speakable than any of the other systems out there.

--- eric




More information about the Python-list mailing list