# Language specification

The rules of the language, one page per part. The sidebar and the Previous and Next links follow the order below.

## Pages in this section

- [Overview](https://www.agentica-lang.com/agentica/reference/overview/index.md): The purpose of the language, its design decisions and a core program.
- [Lexical conventions](https://www.agentica-lang.com/agentica/reference/lexical/index.md): The source text: encoding, comments, doc comments, literals and heredocs.
- [Syntax](https://www.agentica-lang.com/agentica/reference/syntax/index.md): The grammar in EBNF, with the statements and the precedence of expressions.
- [Modules](https://www.agentica-lang.com/agentica/reference/modules/index.md): File modules, imports and re-exports, constants, and packages.
- [Semantics](https://www.agentica-lang.com/agentica/reference/semantics/index.md): Types, scope, functions, pattern matching, generics and the collections.
- [Builtins](https://www.agentica-lang.com/agentica/reference/builtins/index.md): Method calls on builtin types, the rules for JSON, builtin discovery, the sandbox flags and the bytecode cache.
- [Tasks and tests](https://www.agentica-lang.com/agentica/reference/tasks-and-tests/index.md): The rules for tasks, channels, shared tables and unit tests.
- [I/O and network](https://www.agentica-lang.com/agentica/reference/io-and-network/index.md): The rules for networking, logging, files, processes and native code.
- [Diagnostics](https://www.agentica-lang.com/agentica/reference/diagnostics/index.md): The format of each error, and the stable codes that agents rely on.
- [Examples](https://www.agentica-lang.com/agentica/reference/examples/index.md): Example programs that show the design, and programs that must be rejected.
