Skip to content

Source status: no status is stated in the source document, so none is assigned here. Do not treat this page as a finalized specification. The normative rules are in the Technical Specification.

Source Code Structure and Syntax

1. Syntax Philosophy

  • Syntax must be unambiguous.
  • Similar operations must follow consistent patterns.
  • Important behavior must never depend on hidden conventions.
  • Declarations should be explicit.
  • Code should remain readable to human developers.
  • The grammar must be straightforward for AI agents to generate and parse.

2. Program Structure

Programs will be organized into:

  • Projects
  • Modules
  • Types
  • Functions
  • Contracts
  • Statements
  • Expressions

3. Declaration Rules

  • Variables must have declared types.
  • Functions must declare inputs and outputs.
  • Functions must declare their contracts.
  • External effects must be declared.
  • Dependencies must be explicitly imported.
  • Access visibility must be explicit.

4. Syntax Restrictions

  • No implicit type conversions.
  • No ambiguous operator behavior.
  • No hidden external side effects.
  • No silently ignored return values.
  • No undeclared dependencies.
  • No implicit success when an operation fails.

5. Formatting

  • Consistent indentation.
  • Consistent naming conventions.
  • Explicit block boundaries.
  • Predictable declaration ordering.
  • Formatting rules that can be automatically enforced.

6. Design Goal

A developer or AI agent should be able to read any section of a program and understand its structure, requirements, permissions, and behavior without relying on undocumented conventions.


Source and authority

This page migrates SYNTAX.md in full. It is an explanatory / implementation document, not the normative specification. Where it simplifies a rule, the Technical Specification governs. The original file is preserved in source-original/LANG/.