Dreaming of an English-Based Object Oriented Language

MIT’s media lab has created “Metaphor”, a facinating tool that parses
standard English into a programmatic pseudo-code.  Take a look at: http://www.trnmag.com/Stories/2005/032305/Tool_turns_English_to_code_032305.html.  Metaphor seems very cool, but to deal with the ambiguities of its English parser, it ends up with non-working pseudo-code.  They are attempting a very agressive step forward in the difficult problem of “Natural Language Processing.”

However, looking
the problem from the opposite direction (mapping an object oriented language to
English), you can create a rich grammar that is a subset of the English language
that could be converted to an object oriented language such as

Imagine being able to say:

A hello application is a window that has a
menu bar.

The menu bar has the menu items “File” and “Help”.
has a menu item “Quit”.

When “Quit” is pressed close the hello

When “Help” is pressed create a pop-up window “Hello Demo

The content of the hello application is a label “Hello
world!” that is centered, red, and big.

Create a hello

The above sample is interesting in that
it demonstrates a “simple” possible mapping from objects and members to an
English-based grammar, but it also depicts a rather complex naming scheme in
that multiple names can be used for recently defined objects and members (so the
interpreter will need to maintain a memory of recently defined

In my mental wanderings I see:

  • A rich English-based grammar (and a dynamic memory tree that generates
    multiple names for recently developed objects, members, and methods).
  • A mapping of the grammar to Java objects, members, and methods
  • An interpreter that allows real-time read-eval interactions
  • Introspection (or mark-up) that allows POJO’s to be “understood” as objects,
    members, and methods (may not be needed)
  • A large set of base objects that incorporate both methods and I/O:
    • Fundamental types (including editing and operations)
    • Collections
    • Database and persistence objects
    • Web service (and web service introspection)
    • File I/O
    • UI objects (Windows, buttons, widgets, etc.)

things to ponder:

  • Using labels or data types as the names of recently
    created objects.
  • Dynamic recursive inclusion of members of members as a
    naming convention.  For example, if a person has a name, and a name has a first
    name, a middle name, and a last name, then we should be able to talk about a
    person’s last name unambiguously (unless we add another member with a name, in which case we
    may still wish to use a breadth first search for matching members).  Actually, this would be an interesting feature of a standard language.
  • Multithreading:  (“Simultaneously create a progress pop-up window and run the
    complex process.”)
  • Security: (“Only the administrator role can edit a
    person’s name.”)

Oh well, I can dream…