Skip to main content
Version: 0.8.0

Metel Language Specification

Status: Active. This document is the single source of truth for the Metel language. Features not described here are not part of the language.

Source files use the .mtl extension.

Overview

Metel is a statically typed, expression-oriented language with a Rust-inspired syntax. This specification describes the language accepted by the current interpreter.

The language's core design principles are:

  • Strong static typing with full Hindley-Milner type inference
  • No classes — data and behaviour are defined separately via structs, enums, and aspects
  • Algebraic data types — enums with data-carrying variants and exhaustive pattern matching
  • Explicit nullability — absence of a value is represented by Perhaps<T>, never by null
  • Explicit error handling — errors are values, represented as Result<T, E>
  • Safe memory by default — reference counting, no ownership semantics required

Contents

FileContents
Lexical StructureComments, identifiers, keywords, literals, operators
ModulesFiles, modules, imports, path roots, visibility, re-exports
Type SystemPrimitive types, inference, tuples, arrays, casting, generics, Never, Perhaps<T>, Result<T,E>
DeclarationsVariables, structs, enums, aspects
FunctionsFunctions, closures, the ? operator
ExpressionsPattern matching, control flow
RuntimePanics, built-in functions
GrammarFormal grammar

See Changelog for version history.