2 The Magma Language and System

2.1 The Magma User Language

  • Imperative language with standard imperative-style statements and procedures

  • A functional subset providing closures, higher-order functions, and partial evaluation

  • General aggregate data types based on algebraic notions: set, sequence, mapping, magma

  • Universal structure constructors providing a general mechanism for the construction of magmas and mappings

  • Simple but powerful notation for constructing sets and sequences in a natural mathematical style

  • Set and sequence operations which are implemented with a strong emphasis on efficiency

  • Coercion between magmas (including automatic coercion)

  • A package mechanism to support modular program construction

2.2 The Magma Environment

  • Command completion and interactive line editing

  • History system with recall and editing of previous lines

  • A hierarchical online help facility

  • Packages containing user-defined intrinsics with automatic compilation

  • Command-line options at startup

  • Environment variables for configuring style of output, etc.

  • Get/set functions and procedures for configuring style, etc.

  • Verbose options for built-in functions

  • Logging of output, redirection of I/O

  • Mechanism for saving and restoring user workspaces

  • Special file type for fully-featured file I/O

  • Ability to execute system commands from within Magma

  • Input/output pipes for communication with external programs

  • UNIX commands and functions such as process ID, alarm setting, etc.

  • A socket mechanism for communicating with other processes.