Table of Contents

MuLang Language Specification

This document is a draft specification for the first version of MuLang. It defines source syntax and semantics independently of any implementation or host platform.

The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, and MAY are to be interpreted as normative requirements.

Examples

Unless stated otherwise, examples use program mode and the standard language-version-1.1 profile. An example consisting of a single expression uses expression mode.

Text outside each code block identifies any required host declarations, expected result, compile-time diagnostic, or runtime error. Examples are informative; the surrounding rules remain normative.

Contents

  1. Overview
  2. Source text and grammar notation
  3. Lexical structure
  4. Types
  5. Assignability and conversions
  6. Variables and scope
  7. User-defined functions
  8. Expressions
  9. Operators
  10. Statements
  11. Host environment and runtime values
  12. Errors and diagnostics
  13. Execution controls
  14. Language profiles
  15. Grammar summary