Browse the documentation

AEL 1.0.0

Limits

Every source file in AEL, the Agent Engineering Language, stays small and reviewable: each file has a fixed size limit, and a component that needs more room splits its private helpers into extension files. This page gives the exact limits, and the other limits of the language.

Small, reviewable files

Every .ael file must meet two limits, and each one on its own:

  • At most 5,000 bytes. That is 5,000 bytes as stored, not 5,000 characters.
  • At most 5,000 lines.

A file of 5,000 bytes and 5,000 lines passes; one byte or one line more fails, whatever the other count is. The limits apply to every source file: main.ael, pack.ael, metadata.ael, every component, every subagent, every language file, every extension file, your tests and any source a tool generates for you.

The body of a function in another language counts like the rest of its file, byte for byte and line for line. A body must fit in one file, so long code in another language is split into several functions in the file's extension files; see Functions in other languages.

How the limits count

  • Bytes are counted exactly as stored, before anything else happens: every space, tab and line break, every byte of a character outside ASCII, and every comment.
  • A byte-order mark at the start of a file counts as three bytes.
  • A carriage return followed by a line feed is one line ending, and two bytes.
  • A last line without a line ending still counts as a line. A line ending at the very end of the file does not add an empty line.
  • An empty file has zero lines.

The limits apply to source only. Compiled files, package files and your finished program are not limited by them, and a component together with its extension files may be larger than 5,000 bytes.

When a file grows

  1. Move private helper functions into extension files beside the component: support.agent.extended.ael, then support.agent.extended.2.ael and up. See Files and roles.
  2. Split a long function into helpers. A single function, including a component's primary, must fit in one file: a function never starts in one file and ends in another.
  3. Share what other components need as a global or reusable function in a file of its own. See Functions and visibility.

The formatter never splits a file or moves code for you. If formatting would push a file over a limit, it reports that instead of writing the file. A limit failure names the file, the limit it crossed and the counts it measured.

Extension files

  • The unnumbered extension file is the first; the next is numbered 2. Numbers are plain decimal, with no leading zeros.
  • Numbers may have gaps, so removing one extension file never forces you to rename the others.
  • A component can have up to 1,023 extension files.
  • The extension files of a subagent and of a language file follow the same rules: issue_reader.subagent.extended.ael and profile.python.extended.ael, then .extended.2.ael and up; see The subagent file and Functions in other languages.

Names

  • Names are ASCII: letters, digits and _, not starting with a digit.
  • A project name is at most 64 characters. In an application it is also the name of main and of the built program, and it is never main.
  • A package name is lower case, slash-separated and at most 128 characters, such as server/http.

Values and capacities

  • Integers are at most 64 bits wide. The largest integer literal is 18,446,744,073,709,551,615.
  • The capacity N of Str<N> and Vec<T, N> must fit a u32, at most 4,294,967,295, and the target's largest object.
  • A text literal must fit its type's capacity, or the check fails.
  • A full collection returns an error and stays unchanged; it never grows past its capacity.

Bounded recursion and reserved words

  • Recursion whose depth cannot be bounded is refused on the smallest boards, so that the memory a program uses stays predictable. See Functions and visibility.
  • pub, task, tool, service, prompt, region, await, unsafe, extern and static are reserved, and not usable as names. See Syntax basics.

Outside this reference

This reference does not describe these:

  • Floating-point and fixed-point numbers, usize and isize.
  • Hexadecimal, binary and exponent literals.
  • Generic types and functions of your own, traits, closures and functions used as values.
  • else if, break and continue; if and match as values.
  • Building a struct by field names; pattern conditions; match on structs, text or lists.
  • Indexing or slicing text.
  • Returning a reference, moving one field out of a struct, or keeping a reference across a wait.