Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.49 KB

File metadata and controls

57 lines (41 loc) · 1.49 KB

AffineScript Warmup Scripts

Short, focused AffineScript programs for building muscle memory before reading the full Frontier Guide.

Each script is self-contained and has inline exercises to try.

How to use

# Parse only (syntax check):
affinescript parse 01_basics.affine

# Type check:
affinescript check 02_ownership.affine

# Evaluate (for scripts that produce output):
affinescript eval 01_basics.affine

Warmup sequence

Script Covers

01_basics.affine

Let bindings, literals, functions, pattern matching

02_ownership.affine

own/ref/mut, @linear/@erased, Option/Result

03_effects.affine

Effect declarations, effect composition, effect polymorphism

04_rows.affine

Row-polymorphic records, row type aliases, spread syntax

For bot / agent guidance

When using an AI agent to learn AffineScript interactively, point the agent at these files in order. Each file ends with numbered exercises — a suitable prompt is:

"Complete exercise 1 in this warmup. If the compiler accepts it, move on. If it rejects it, read the error and try to understand what rule was violated before looking it up."

The exercises are deliberately constraint-based: success is learning to work within the type system, not producing output as quickly as possible.