Programming Language for Old Timers

by David A. Moon
February 2006 .. September 2008

Comments and criticisms to dave underscore moon atsign alum dot mit dot edu.

Previous page   Table of Contents   Next page

Organizing Mechanisms

PLOT includes five organizing mechanisms: files, modules, types, functions, and macros. Most languages conflate one or more of these mechanisms, but in PLOT they are independent and orthogonal.

Files are the units of source code. This makes them the units of compilation and of loading executable code. Breaking a program into multiple files eases maintenance and delivery of the program, especially when different individuals or organizations are responsible for different files.

Modules are the units of global name scoping. A module can inherit named definitions from other modules, with renaming. Breaking a program into multiple modules makes name conflict issues tractable.

Types are the units of data classification. A type is a dichotomy that classifies every object as either a member of the type or not a member of the type. Classes are the most important type of type in PLOT. A class defines the structure of its member objects as a set of named slots that can hold values. A class can inherit typeness and slots from another class.

Functions are the units of behavior. In PLOT all functions are composite, being constructed at load time from one or more pieces of executable code called methods.

Macros are the units of language definition. A macro defines the syntax of a construct by specifying the procedure for parsing that construct, and defines the semantics of a construct by specifying an expression that is the implementation of that construct. The syntax of PLOT is not built into the compiler, but is entirely defined by macros (many of which are defined by the implementation rather than by the user, of course). The compiler is only concerned with the semantics of the primitive expressions. This enables users to define their own languages based on PLOT which are every bit as flexible, powerful, and clean as the base language.

A few examples of the orthogonality of these mechanisms:

Previous page   Table of Contents   Next page