tiny.python.code
Defined in tiny.python.
The package's compiled form of a program: a list of instructions for a stack machine, with tables of the constants, names and function bodies the instructions refer to.
API (6)
Types and contracts
Public types and contracts.
Chunk: A compiled program or function body: its instructions and the tables of constants, names and functions that they index.Function: A compiled function: its name, its parameter names in order, and its body as a chunk of its own.Instruction: One instruction: an operation and one integer operand.Op: The operations of the package's bytecode, one tag each.
Namespaces
Public namespaces.
chunk: A compiled program is a list of instructions plus three tables that the instructions refer to by position: constants, variable names and function bodies.op: The package's virtual machine has 39 operations, each of which takes its inputs from one stack of values and pushes its result back onto it.
Source
Source: lib/python/src/code/root.zig
zig
//! The package's compiled form of a program: a list of instructions for a stack machine, with//! tables of the constants, names and function bodies the instructions refer to. The compiler needs//! a form it can append to during one walk over the syntax tree, and the virtual machine needs a//! form it can run directly, one instruction at a time.//!//! The file `chunk` defines `Chunk`, `Instruction` and `Function`, and the file `op` defines `Op`,//! the set of operations. The namespace re-exports those four names. The compiler returns a//! `Chunk`, and the virtual machine runs it.pub const chunk = @import("chunk.zig");pub const op = @import("op.zig");pub const Chunk = chunk.Chunk;pub const Function = chunk.Function;pub const Instruction = chunk.Instruction;pub const Op = op.Op;Source: lib/python/src/root.zig:91
zig
pub const code = @import("code/root.zig");Audit
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |