Language Guide¶
The pypto.language surface, one topic per page: what you can write, what each
construct means, and where it fails.
Prerequisites: Quickstart and Programming Model. This chapter assumes you have compiled something and know the difference between the control plane and the execution plane.
What this chapter is¶
A guide, organized by capability — each page covers one part of the language in full, including the edge cases. It is not a tutorial: no page builds a complete kernel from start to finish. It is also not an API reference: for signatures, see the API Reference, reached by name through the catalog.
Conventionally, import pypto.language as pl — every name on these pages is reached
through that alias.
Contents¶
| Page | What it covers |
|---|---|
| Types | dtypes, Tensor / Tile / Scalar / Array / Tuple, layouts, dynamic shapes, parameter directions |
| Functions and Programs | @pl.jit family, @pl.function, @pl.program, @pl.inline, cross-function calls, external kernels |
| Control Flow | pl.range / parallel / unroll / pipeline / while_, carried values, yield_, cond, SSA |
| Memory and Data Movement | the memory spaces, load / store / move, valid_shape and fillpad, L1 residency |
| Scopes and Placement | at / cluster / spmd / split_aiv — where work runs |
| Compile-Time Directives | static_print / static_assert, const |
| Language Syntax | Subscript sugar, Python operators, closure capture |
Reading order¶
Read Types and Functions and Programs first — every other page assumes both. After that the pages are independent:
00-types ──► 01-functions ──┬─► 02-control-flow
├─► 03-memory
├─► 04-scopes ← the widest gap if you are
└─► 05-directives coming from single-kernel code
Scopes and Placement is the page most readers have not seen equivalent material for elsewhere: it covers how work is placed on cores and how the task graph the runtime executes is shaped.
See Also¶
- Operations — which namespace an operator lives in, and the full catalog.
- Programming Model — the abstractions this chapter is the surface of.
- Python IR Syntax Specification — the parser's own reference, including forms this guide does not recommend.
- Passes — what the compiler does with each construct.