Skip to content

Syntax Principles

Joe Curlee (w4ffl35) edited this page Feb 4, 2026 · 5 revisions

Curlee Syntax Principles (AI-Native)

These principles constrain syntax design so Curlee remains unambiguous and LLM-friendly.

The concrete MVP syntax is defined in wiki/Language-Syntax.md.


1) Unambiguous structure

  • No indentation-sensitive parsing.
  • Blocks must be explicitly delimited (e.g., { ... }).
  • Statements use explicit terminators where needed (e.g., ;) to aid recovery.

2) Token efficiency (without magic)

  • Prefer short, consistent keywords over dense symbolic syntax.
  • Avoid constructs that are easy to hallucinate (implicit terminators, significant whitespace).

3) Verification constructs are first-class

  • Contracts:
    • requires <pred>
    • ensures <pred>
  • Refinements:
    • where <pred>

If these constructs appear, they must be parsed with stable spans and either:

(See Glossary for spans, contracts, and refinements.)

  • lowered into the solver fragment (wiki/Verification-Scope.md), or
  • rejected with a diagnostic (no silent weakening).

4) Explicit unsafe/effects boundaries

  • Any capability-bearing or foreign-function action must be explicit (see Glossary).
  • Future reserved keywords: unsafe, cap.

Note: import and as are part of the MVP syntax (see Language Syntax and Modules and Imports).


5) Error recovery is a requirement

  • Grammar should allow synchronization points (;, }) so the parser can emit multiple diagnostics.

6) Non-goals

  • No “clever” syntax that sacrifices tooling predictability.
  • No implicit coercions that make verification ambiguous.

Clone this wiki locally