HyperScript's Fundamental Properties

Hyper Context

The hyper adjective of HyperScript implies its ability to execute an interpretive script in the context of another application or application framework. For example, HyperTP is a front end to the PROMIS application, providing complete control over the execution of the PROMIS application. Alternatively, HyperSECS serves as a back-end processing server for SECS-protocol messages that provide communication with semiconductor equipment, and HyperSQL provides enhanced Oracle SQL database access.

Hyperscript glues applications and processes together, using an event-driven model. Running in either client or server modes, HyperScript facilitates the sending and receiving of action-oriented messages to and from other processes in the local system and over the network.

Interpretive

HyperScript is an interpretive language - it parses using a top-down - recursive descent - method, then executes a postfix (RPN) expression on an internal stack.

By default, HyperScript tokens are loaded, parsed, and executed simultaneously , as the tokens are encountered. The only exception to this behavior is when HyperScript is defining a method or a labeled statement block, in which case HyperScript tokens are only loaded and parsed . The defined method or labeled statement block can later be executed by calling the method or branching to the label respectively.

'C' Syntax

HyperScript is based on a C syntax, which makes reading and writing of HyperScript programs palatable. HyperScript supports only a limited subset of the C language, but also enhances the C syntax, primarily in the application of mixed data types in variable length lists and vectors.

Object Oriented

HyperScript uses some object-oriented techniques, specifically the ability to send and receive events from other objects. An incoming EVENT message will invoke a specified HyperScript method (subroutine). Likewise, HyperScript can send an event message to another object in the local system or over the network providing the object uses the AutoRouter message server.

Client/Server

HyperScript supports client/server interaction between other objects. In client mode, HyperScript can send query messages to server objects and wait for a REPLY message. In server mode, HyperScript can receive query messages from clients and respond back with REPLY messages.

States

A HyperScript program can be in one of 4 possible states:

  • EXECUTE
    The HyperScript program is executing.
  • PARSE
    The HyperScript program is parsing.  
  • QUERY
    A query method was executed and the HyperScript program is blocking for a REPLY message
  • IDLE
    The HyperScript program has executed the idle method or has returned from a method invoked via an EVENT or QUERY message.

Condition Handling

HyperScript supports full conditional handling; for run-time errors, timeout conditions, alarms events, incoming message interrupts, I/O pipe errors, ctrl/c, and lifetime expiration (death) conditions. Handler methods are invoked when the condition occurs, and the HyperScript can take the appropriate action.