PICTUREBALM(ID:4150/pic021)


LISP dialect for graphics manipulation

Places
People:
Related languages
BALM => PICTUREBALM   Extension of
BIL => PICTUREBALM   Written using
LISP 1.5 => PICTUREBALM   Extension of
PICTURE => PICTUREBALM   Evolution of

References:
  • Harrison, Malcolm C. "A language-oriented instruction set for the BALM language" view details Abstract: The availability of microprogramming has increased interest in the design of instruction sets which are oriented towards particular higher-level languages. We will refer to these as language-oriented instruction sets (or LOISs). In this paper we give a formal definition of a LOIS for the extendable language BALM. This LOIS, which we call MBALM, is used as the basis of the implementation of the current version of the language, BALM4. We will also compare two implementations of the MBALM instruction set, and outline briefly our experiences with them. The external description of BALM4 is given in detail elsewhere. Briefly, it is an extendable language with an Algol-like syntax and data-types integer, real, logical, string, pair (list), vector, identifier, procedure, and label. Type information is carried with all data-objects, and run-time type testing and conversion is done when necessary. Garbage collection and a run-time compiler are significant attributes of the system. Outlined below are some of the properties of the implementation, which was designed initially for reasons of simplicity and flexibility, but which illustrate some of the advantages of a LOIS-based system.
          in SIGPLAN Notices 9(08) August 1974 Proceedings of the meeting on SIGPLAN/SIGMICRO interface, May 30-June 01, 1973, Harriman, New York, United States view details
  • Goates, G. B.; Griss, M. L.; and Herron, G. J. PICTUREBALM: A LISP-Based Graphics Language System with Flexible Syntax and Hierarchical Data Structure. Technical Report UUCS-80-118, University of Utah Computer Science Department, February, 1980. view details
          in SIGPLAN Notices 9(08) August 1974 Proceedings of the meeting on SIGPLAN/SIGMICRO interface, May 30-June 01, 1973, Harriman, New York, United States view details
  • Goates, Gary B.; Griss, Martin L. and Herron, Gary J. "PICTUREBALM: A LISP-based graphics language system with flexible syntax and hierarchical data structure" pp93-99 view details Abstract: PICTUREBALM is a portable, interactive, LISP-based language system for graphics applications programming. PICTUREBALM's design and initial experimental implementation is described from the point of view of both the user and the language system implementor. The approach of extending a LISP-based language by adding graphical operations was chosen because many of the recognized requirements for graphics programming languages are standard features of LISP-like systems. Future work is proposed. Extract: Introduction
    I. Introduction
    BALM is a portable, easily extensible, interactive, LISP-based language system. BALM's data structures, dynamic storage management, and resident incremental compiler are essentially those of LISP [7], but BALM is ALGOL-like in its syntax. The close match between these features and the requirements for good graphics programing environments motivated extending BALM into a graphics language. The Utah version of BALM is implemented in terms of a pseudo-code, or "P-code", abstract stack machine, called MTLISP. MTLISP is written in the highly portable BIL language which is translated into FORTRAN or target machine assembly language. PICTUREBALM was developed by adding about a dozen low-level graphics functions as new MTLISP P-code operations, and then making them easily accessible by means of the extension mechanisms built into the BALM system. In particular, PICTUREBALM's parsing was extended by adding new operators for graphics.

    The hierarchical structure and implementation of the PICTUREBALM system are designed to support both the beginning and the expert user well. The sophisticated PICTUREBALM user can utilize low level primitive operations to support customized modeling, syntax or device environments; yet the beginner need not know how to use these features. PICTUREBALM usage typically consists of creating, modifying, and requesting the display of graphical objects, called "Models". The usage adopted in this paper is that the names of non-terminal symbols of the grammar of Models are capitalized, so as to emphasize that the term is being used in a technical sense. A Model is a three dimensional representation of the spatial, topological and graphical features of an object, similar to the "image model" described by Baer, Eastman and Henrion. Models can contain any number of primitives, which can generally be in any order. PICTUREBALM Model primitives include: Point Sets, which might be interpreted as polygons, connected line segments, curve control points, etc.; transformations; color or appearance attributes; named references to other Models to be displayed as if they were part of the current Model; and procedure calls. Model primitives need not be the same as the hardware primitives available.

    Allowing Models to contain references to other Models facilitates dynamic displays and allows the user to structure his data in Clusters in a meaningful manner. Sub-Models may be shared among a number of Models. Allowing procedure calls to be imbedded within Models provides the user with a mechanism which can easily effect arbitrary displays, transformations, parameterized models or other functions that may be required by a specific application; in some cases, it is essential to represent objects by algorithms or procedural models. BALM's rich, hierarchical and easy-to-manipulate data structure will be a treat to work with for anyone used to writing FORTRAN routines to manipulate "lists" of graphical data. The PICTUREBALM system includes operators and syntactic extensions which are designed to make PICTUREBALM commands look "natural" to the user. Points are constructed by using curly brackets, e.g. {x, y}. The " " operator is used to make Point Sets; e.g. it ~an be used to make polygons out of Points. The "@" operator is used to locate text displays at some Point on the screen. Transforms change the view or the position of objects which they are linked to by either of the "<" or ">" operators. For example, the following PICTUREBALM command will assign to the identifier "Rotated.triangle" the Model which represents a triangle rotated 45 degrees about the z axis: Rotated.triangle = {0,0} {1,1} {2,0} {0,0} > ZROT (45~; -- Note that the ">" and "<" operators have lower precedence than " "

    Display is accomplished by passing Models to the PICTUREBALM interpreter for the desired output device. Each PICTUREBALM interpreter knows of the existence of all legal Model primitives and each does something appropriate with any primitives which are not directly relevant to their device, e.g. an interpreter for a storage tube device might ignore a color attribute. Also, some Model interpreters must place constraints on what Models they consider to be validly formed.

    The intent of this project was not to produce a production quality graphics system, but rather to explore the features that LISP-like languages offer for graphics. While neither the design nor the implementation of PICTUREBALM is completed, the success of the current experimental implementation illustrates the benefits of LISP-like languages in many graphics programing activities.
    Extract: Selecting BALM as the Base Language to Extend
    2. Selecting BALM as the Base Language to Extend
    The basic unit of data in BALM is called an "item". An item can be a pair, a list, a vector, a string, an integer, a procedure or an identifier. The elements of a pair, a list or a vector can be any item of any type. Each item contains a run-time tag specifying its type, in the sense of its being one of the above types; variables may change types dynamically. Unlike PASCAL, there are no user-definable data types nor is there compile-time type checking. All identifiers have both a value item and a "property list" item, which is typically a list of attribute-value pairs. Each top level BALM command is terminated by a semicolon. Typically such commands are assignment statements or procedure invocations. As soon as a semicolon is encountered on an input line, the command is interpreted. If the right hand side of an assignment statement starts with the "PROC" operator, then the procedure which follows is compiled to MTLISP machine P-codes by the run-time resident compiler. If the procedure contains no syntax errors, then the value of the identifier on the left side of the assignment becomes the compiled procedure. After each command is interpreted, the language system fetches the next command from the active input stream, which can easily be switched between the user's terminal and files.

    All BALM language statements "return" a value. The value item returned by a procedure can be specified by an explicit RETURN statement. BALM procedures can accept a variable number of arguments; they can determine at run time the namber and the type of their arguments. BALM uses BEGIN-END blocks for determining the scope of identifiers, and it has a number of high-level control structures, such as WHILE and FOR. Most graphics applications would benefit from the following PICTUREBALM features, which are attributes shared by many LISP-like systems:
    - Interactive program definition and execution.
    - Efficient and natural manipulation of complex, hierarchical, data structures.
    - Run-time type checking.
    - Dynamic storage management.
    - Run-time symbol table.
    - Availability of language features at run time.
    BALM has several features which are important for graphics that are not shared by all LISP-based languages, viz:
    - ALGOL or PASCAL-like syntax and control structures.
    - Extensible syntax.
    - An abstract machine pseudo-code implementation.
    - A highly portable implementation.
    Thus BALM, of the available LISP-based languages, is particularly well suited for extension to graphics applications. Extract: PICTUREBALM Graphical Objects and Their Interpretation
    3. PICTUREBALM Graphical Objects and Their Interpretation
    PICTUREBALM Models are created by combining primitive objects, modifiers, and references to other Models. Models are then displayed by means of the prefix operator SHOW, which passes the Model to whichever PICTUREBALM interpreter is currently selected.
    One goal of the PICTUREBALM design is to keep Models as device independent as possible. However, some Model interpreters must place constraints on what Models they consider to be validly formed. For example, the current implementation of a Model interpreter for line drawing devices will accept any arbitrary Point Set which it interprets as a connected set of line segments, but a surface rendering interpreter would have to use only Point Sets which describe surfaces of specified types. PICTUREBALM does not use the approach of constraining all Models so as to be interpretable on every device because this restricts Models to only that small set of primitives common to all devices.
    PICTUREBALM supports the creation and manipulation of Models both by means of built-in procedures for the various primitives and by means of syntactic extensions, i.e. operators which construct Models out of primitives. PICTUREBALM contains seven operators designed to make graphics programs easy to read and write. They are denoted by the following special characters: {, }, _, @0 &, < and >.
    Points are constructed by using curly brackets. One to four numbers can be used to specify Points. For example, {a} denotes the Point a on the x axis, {x, y} denotes the point (x, y, O) in three dimensional space, and {x, y, z} denotes the point (x, y, z). The use of curly brackets to denote Points was prefered over the standard parentheses notation because of the ambiguity of the latter with function calls.
    The " " operator constructs Point Sets out of Points. --It can be used, for example, to form a Point Set representing a line out of two Points, or one representing a set of connected line segments out of more than two Points. The sequence "A B C D", where A, B, C and D are identifiers of Points, creates a Model which when SHOW'n moves the display beam to the point represented by A, draws to B, to C, and then to D. The "@" operator is used to locate a text display at some location on the screen, e.g. "Hi There!" @ {10} denotes a Model which displays a string that starts at 10 on the x axis. Models may have modifiers and Transforms concatenated onto them to form new Models using either the "<" operator or the ">" operator. They are equivalent semantically but they differ in the order in which their arguments are given. The ">" view expresses the transformations which may be successively applied to an object relative to the global coordinate system. The "<" view expresses transformations relative to the object's own local coordinate system; it can be thought of as moving the object's coordinate system relative to a static observer. In both views, the transformations are thought of as occurring in order from left to right and the observer remains stationary with respect to a global coordinate system.

    The "&" operator is used to group Models into larger Models. For example, the command sequence
    Two.things = ABC > XROT(45) & XYZ
    > YMOVE(6);
    SHOW Two.things;
    will draw Model ABC rotated by 45 degrees around the X axis and will also draw Model XYZ moved by 6 units in the Y direction.

    Models are simply BALM items; they can be assigned as the value of any identifier and they can serve as operands in commands. Also modifiers such as Transforms can be applied to objects either at the time that a Model is built, or at the time it is SHOW'n.
    Models can contain any number of the following types of primitives:
    - Point Sets, i.e. an ordered set of Points.
    - Point Set Modifiers, which could be used to specify that Point Sets are to be interpreted as curve or surface control Points or vectors.
    - Text Specifications.
    - Transforms, which represent transformations of Model Objects in three dimensional space, clipping windows or perspective transformations.
    -Appearance Attributes, such as color or intensity.
    -Repeat Specifications, which instantiate sub-Models under a specified Transform which is repeatedly applied.
    -Clusters, i.e. named references to other Models.
    - Calls to arbitrary PICTUREBALM procedures.
    Model primitives can generally be combined in any order to form a Model. A more detailed description of PICTUREBALM as well as some comparisons with previous work is presented in [3]. One notable feature of PICTUREBALM is that most graphics functions are represented as primitives to be included in Models; unlike graphics subroutine packages, few functions are implemented as procedures which are intended to be called directly by the user.

          in Computer Graphics Volume 14, Number 3, July, 1980 (Proceedings of the 7th International Conference on Computer Graphics and Interactive Techniques Seattle, Washington, United States SIGRAPH 80) view details