Skip to main content

Op

Enum Op 

Source
pub enum Op {
Show 231 variants Nop, LoadInt(i64), LoadFloat(f64), LoadConst(u16), LoadTrue, LoadFalse, LoadUndef, Pop, Dup, Dup2, Swap, Rot, GetVar(u16), SetVar(u16), DeclareVar(u16), GetSlot(u16), SetSlot(u16), SlotArrayGet(u16), SlotArraySet(u16), GetArray(u16), SetArray(u16), DeclareArray(u16), ArrayGet(u16), ArraySet(u16), ArrayPush(u16), ArrayPop(u16), ArrayShift(u16), ArrayLen(u16), MakeArray(u16), GetHash(u16), SetHash(u16), DeclareHash(u16), HashGet(u16), HashSet(u16), HashDelete(u16), HashExists(u16), HashKeys(u16), HashValues(u16), MakeHash(u16), Add, Sub, Mul, Div, Mod, Pow, Negate, Inc, Dec, Concat, StringRepeat, StringLen, NumEq, NumNe, NumLt, NumGt, NumLe, NumGe, Spaceship, StrEq, StrNe, StrLt, StrGt, StrLe, StrGe, StrCmp, LogNot, LogAnd, LogOr, BitAnd, BitOr, BitXor, BitNot, Shl, Shr, Jump(usize), JumpIfTrue(usize), JumpIfFalse(usize), JumpIfTrueKeep(usize), JumpIfFalseKeep(usize), Call(u16, u8), Return, ReturnValue, PushFrame, PopFrame, Print(u8), PrintLn(u8), ReadLine, Range, RangeStep, MapBlock(u16), GrepBlock(u16), SortBlock(u16), SortDefault, ForEachBlock(u16), PreIncSlot(u16), SlotLtIntJumpIfFalse(u16, i32, usize), SlotIncLtIntJumpBack(u16, i32, usize), AccumSumLoop(u16, u16, i32), ConcatConstLoop(u16, u16, u16, i32), PushIntRangeLoop(u16, u16, i32), AddAssignSlotVoid(u16, u16), PreIncSlotVoid(u16), PreDecSlot(u16), PostIncSlot(u16), PostDecSlot(u16), CallBuiltin(u16, u8), Extended(u16, u8), ExtendedWide(u16, usize), Exec(u8), ExecBg(u8), PipelineBegin(u8), PipelineStage, PipelineEnd, Redirect(u8, u8), HereDoc(u16), HereString, CmdSubst(u16), SubshellBegin, SubshellEnd, ProcessSubIn(u16), ProcessSubOut(u16), Glob, GlobRecursive, TestFile(u8), SetStatus, GetStatus, TrapSet(u16), TrapCheck, ExpandParam(u8), WordSplit, BraceExpand, TildeExpand, CallFunction(u16, u8), StrMatch, RegexMatch, WithRedirectsBegin(u8), WithRedirectsEnd, AwkFieldGet, AwkFieldSet, AwkNf, AwkSetRecord, AwkSpecialGet(u16), AwkSpecialSet(u16), AwkPrint(u8), AwkPrintf(u8), AwkSprintf(u8), AwkGetline(u8), AwkLength(u8), AwkSubstr(u8), AwkIndex, AwkSplit(u8), AwkSub(u8), AwkGsub(u8), AwkMatch, AwkToLower, AwkToUpper, AwkInt, AwkSqrt, AwkSin, AwkCos, AwkExp, AwkLog, AwkAtan2, AwkDiv, AwkMod, AwkDivJit, AwkModJit, AwkSqrtJit, AwkLogJit, AwkLshiftJit, AwkRshiftJit, AwkComplJit, AwkGetFieldNum(u16), PowFloat, SqrtFloat, SinFloat, CosFloat, ExpFloat, Atan2Float, LogFloat, AbsFloat, TruncInt, CeilFloat, FloorFloat, TruncFloat, RoundFloat, TanFloat, AsinFloat, AcosFloat, AtanFloat, SinhFloat, CoshFloat, TanhFloat, Log2Float, Log10Float, AbsInt, GcdInt, LcmInt, TimeInt, AwkArrayGet(u16), AwkArraySet(u16), AwkArrayExists(u16), AwkArrayDelete(u16), AwkArrayClear(u16), AwkArrayLen(u16), AwkAnd(u8), AwkOr(u8), AwkXor(u8), AwkCompl, AwkLshift, AwkRshift, AwkStrtonum, AwkSystime, AwkRand, AwkSrand(u8), AwkStrftime(u8), AwkMktime(u8), AwkOrd, AwkChr, AwkMkbool, AwkIntdiv, AwkIntdiv0, AwkGensub(u8), AwkSignal(u8), Go(u16, u8), ChanMake, ChanSend, ChanRecv, ChanClose, Select(u8, u8), CallDynamic(u8),
}
Expand description

Stack-based bytecode instruction set.

Operands: u16 for pool indices (64k names/constants), usize for jump targets. Language-specific operations use Extended with a frontend-registered handler.

Variants§

§

Nop

No-op; consumed for cycle-counting and as a branch sentinel.

§

LoadInt(i64)

Push int value onto the stack.

§

LoadFloat(f64)

Push float value onto the stack.

§

LoadConst(u16)

index into constant pool

§

LoadTrue

Push true value onto the stack.

§

LoadFalse

Push false value onto the stack.

§

LoadUndef

Push undef value onto the stack.

§

Pop

Discard the top of the stack.

§

Dup

Duplicate the top of the stack.

§

Dup2

Duplicate the top two values on the stack.

§

Swap

Swap the top two stack values.

§

Rot

Rotate the top three stack values (a b c → b c a).

§

GetVar(u16)

Read var into the stack via name-pool index.

§

SetVar(u16)

Pop top of stack into var via name-pool index.

§

DeclareVar(u16)

Declare a fresh var binding in the current scope.

§

GetSlot(u16)

Slot-indexed fast path (frame slot index, avoids name lookup)

§

SetSlot(u16)

Pop top of stack into slot via name-pool index.

§

SlotArrayGet(u16)

Slot-based array index: stack: [index], slot contains array → value

§

SlotArraySet(u16)

Slot-based array set: stack: [value, index], slot contains array

§

GetArray(u16)

Read array into the stack via name-pool index.

§

SetArray(u16)

Pop top of stack into array via name-pool index.

§

DeclareArray(u16)

Declare a fresh array binding in the current scope.

§

ArrayGet(u16)

stack: [index] → value

§

ArraySet(u16)

stack: [value, index]

§

ArrayPush(u16)

stack: [value]

§

ArrayPop(u16)

→ popped value

§

ArrayShift(u16)

→ shifted value

§

ArrayLen(u16)

→ length

§

MakeArray(u16)

pop N values, push as array

§

GetHash(u16)

Read hash into the stack via name-pool index.

§

SetHash(u16)

Pop top of stack into hash via name-pool index.

§

DeclareHash(u16)

Declare a fresh hash binding in the current scope.

§

HashGet(u16)

stack: [key] → value

§

HashSet(u16)

stack: [value, key]

§

HashDelete(u16)

stack: [key] → deleted value

§

HashExists(u16)

stack: [key] → bool

§

HashKeys(u16)

→ array of keys

§

HashValues(u16)

→ array of values

§

MakeHash(u16)

pop N key-value pairs, push as hash

§

Add

Numeric a + b (pops 2, pushes sum).

§

Sub

Numeric a - b (pops 2, pushes difference).

§

Mul

Numeric a * b (pops 2, pushes product).

§

Div

Numeric a / b (pops 2, pushes quotient).

§

Mod

Numeric a % b (pops 2, pushes remainder).

§

Pow

Numeric a ** b (pops 2, pushes power).

§

Negate

Numeric unary minus (-x).

§

Inc

In-place += 1 on top-of-stack numeric.

§

Dec

In-place -= 1 on top-of-stack numeric.

§

Concat

String concatenation a . b.

§

StringRepeat

Repeat a string N times (a x b in Perl).

§

StringLen

Length of top-of-stack string in bytes.

§

NumEq

Numeric eq comparison.

§

NumNe

Numeric ne comparison.

§

NumLt

Numeric lt comparison.

§

NumGt

Numeric gt comparison.

§

NumLe

Numeric le comparison.

§

NumGe

Numeric ge comparison.

§

Spaceship

<=> → -1, 0, 1

§

StrEq

String eq comparison.

§

StrNe

String ne comparison.

§

StrLt

String lt comparison.

§

StrGt

String gt comparison.

§

StrLe

String le comparison.

§

StrGe

String ge comparison.

§

StrCmp

String cmp comparison.

§

LogNot

Boolean ! (eager, evaluates both operands for binary forms).

§

LogAnd

differs from short-circuit jumps: evaluates both

§

LogOr

Boolean || (eager, evaluates both operands for binary forms).

§

BitAnd

Bitwise and operation.

§

BitOr

Bitwise or operation.

§

BitXor

Bitwise xor operation.

§

BitNot

Bitwise not operation.

§

Shl

Bit-shift left (<</>>).

§

Shr

Bit-shift right (<</>>).

§

Jump(usize)

Unconditional jump to the given chunk offset.

§

JumpIfTrue(usize)

Jump if top-of-stack is true; pops predicate.

§

JumpIfFalse(usize)

Jump if top-of-stack is false; pops predicate.

§

JumpIfTrueKeep(usize)

short-circuit ||

§

JumpIfFalseKeep(usize)

short-circuit &&

§

Call(u16, u8)

Call: name_index, arg_count

§

Return

Return from current function with no value (pushes Undef).

§

ReturnValue

Return from current function using top-of-stack as the result.

§

PushFrame

Push a call frame on the frame stack.

§

PopFrame

Pop a call frame on the frame stack.

§

Print(u8)

Print N values from stack to stdout

§

PrintLn(u8)

Print N values + newline

§

ReadLine

Read line from stdin, push as string

§

Range

[from, to] → array

§

RangeStep

[from, to, step] → array

§

MapBlock(u16)

Higher-order map over a slot-array using the block at the given chunk index.

§

GrepBlock(u16)

Higher-order grep over a slot-array using the block at the given chunk index.

§

SortBlock(u16)

Higher-order sort over a slot-array using the block at the given chunk index.

§

SortDefault

sort with default string comparison

§

ForEachBlock(u16)

Higher-order foreach over a slot-array using the block at the given chunk index.

§

PreIncSlot(u16)

Slot-indexed pre-increment (no stack traffic)

§

SlotLtIntJumpIfFalse(u16, i32, usize)

if ($slot < INT) goto target — fused compare + branch

§

SlotIncLtIntJumpBack(u16, i32, usize)

$slot += 1; if $slot < limit goto body — fused loop backedge

§

AccumSumLoop(u16, u16, i32)

while $i < limit { $sum += $i; $i += 1 } — entire counted sum loop

§

ConcatConstLoop(u16, u16, u16, i32)

while $i < limit { $s .= CONST; $i += 1 } — fused string append loop

§

PushIntRangeLoop(u16, u16, i32)

while $i < limit { push @a, $i; $i += 1 } — fused array push loop

§

AddAssignSlotVoid(u16, u16)

Void-context slot add-assign: $a += $b (no stack push)

§

PreIncSlotVoid(u16)

Void-context pre-increment: ++$slot (no stack push)

§

PreDecSlot(u16)

Slot-indexed pre-decrement: --$slot, pushes the new value

§

PostIncSlot(u16)

Slot-indexed post-increment: $slot++, pushes the old value

§

PostDecSlot(u16)

Slot-indexed post-decrement: $slot--, pushes the old value

§

CallBuiltin(u16, u8)

Call a registered builtin by ID: (builtin_id, arg_count) The builtin table is registered by the frontend at VM init.

§

Extended(u16, u8)

Language-specific opcode dispatched through a frontend handler table. u16 = extension op ID, u8 = inline operand. Frontends register a fn(&mut VM, u16, u8) handler at init.

§

ExtendedWide(u16, usize)

Extended with usize payload (for jump targets, large indices)

§

Exec(u8)

Spawn external command: pop N args from stack, exec, push exit status

§

ExecBg(u8)

Spawn background: like Exec but don’t wait

§

PipelineBegin(u8)

Set up N-stage pipeline

§

PipelineStage

Wire next pipeline stage

§

PipelineEnd

Wait for pipeline, push last status

§

Redirect(u8, u8)

Redirect fd: (source_fd, op_byte) — target on stack

§

HereDoc(u16)

Here-document: fd on stack, content from constant pool

§

HereString

Here-string: fd on stack, word on stack

§

CmdSubst(u16)

Command substitution: capture stdout of subprogram

§

SubshellBegin

Subshell: isolate scope

§

SubshellEnd

Shell Ops (Registered Via Extended, But Defined Here For Type Safety) operation (SubshellEnd).

§

ProcessSubIn(u16)

Process substitution <(cmd) — push FIFO path

§

ProcessSubOut(u16)

Process substitution >(cmd) — push FIFO path

§

Glob

Glob expand: pop pattern, push array of matches

§

GlobRecursive

Recursive glob (parallel): pop pattern, push array

§

TestFile(u8)

File test: u8 encodes test type (-f=0, -d=1, -r=2, -w=3, -x=4, -e=5, -s=6, -L=7)

§

SetStatus

Set last exit status ($?)

§

GetStatus

Get last exit status

§

TrapSet(u16)

Set trap handler: signal on stack, handler bytecode range

§

TrapCheck

Check pending traps (inserted between ops by compiler)

§

ExpandParam(u8)

Expand ${var:-default} family: u8 encodes modifier type

§

WordSplit

Word split by IFS

§

BraceExpand

Brace expand {a,b} and {1..10}

§

TildeExpand

Tilde expand ~ and ~user

§

CallFunction(u16, u8)

Call user-defined shell function by name pool index with N args. Falls through to host.call_function() then host.exec() if not found. stack: [arg_N, …, arg_1] → pushes Status

§

StrMatch

Glob-pattern match: pop pattern, pop string, push Bool. Used by [[ x = pat ]] and case arm matching.

§

RegexMatch

Regex match: pop regex, pop string, push Bool. (=~)

§

WithRedirectsBegin(u8)

Begin scoped redirection block: u8 = number of redirects already applied via prior Redirect ops. Saves fd state on the host’s stack. Used for cmd > out.txt applied to compound commands and func() { ... } > out.txt.

§

WithRedirectsEnd

End scoped redirection block — restore fd state.

§

AwkFieldGet

$i — read field i; index popped from stack, pushes the field value.

§

AwkFieldSet

$i = v — assign field i. Stack [value, index]; rebuilds $0/NF.

§

AwkNf

NF — push the current field count.

§

AwkSetRecord

$0 = v — replace the whole record (resplit). Stack [value].

§

AwkSpecialGet(u16)

Read a special AWK variable by name-pool index (FS/NR/OFS/…).

§

AwkSpecialSet(u16)

Assign a special AWK variable by name-pool index. Stack [value].

§

AwkPrint(u8)

print a, b, ... — pops u8 args, joins with OFS, ends with ORS.

§

AwkPrintf(u8)

printf fmt, ... — pops u8 args (last popped is the format).

§

AwkSprintf(u8)

sprintf(fmt, ...) — like AwkPrintf but pushes the formatted string.

§

AwkGetline(u8)

getline family. u8 encodes the source kind (see crate::awk_builtins::getline_source); pushes status (1/0/-1).

§

AwkLength(u8)

length / length(x) — pops u8 args (0 ⇒ length($0)).

§

AwkSubstr(u8)

substr(s, m [, n]) — pops u8 args (2 or 3).

§

AwkIndex

index(s, t) — stack [s, t]; pushes 1-based position or 0.

§

AwkSplit(u8)

split(s, arr [, fs]) — pops u8 args; pushes field count.

§

AwkSub(u8)

sub(re, repl [, target]) — pops u8 args; pushes substitution count.

§

AwkGsub(u8)

gsub(re, repl [, target]) — pops u8 args; pushes substitution count.

§

AwkMatch

match(s, re) — stack [s, re]; sets RSTART/RLENGTH, pushes RSTART.

§

AwkToLower

tolower(s) — stack [s].

§

AwkToUpper

toupper(s) — stack [s].

§

AwkInt

int(x) — truncate toward zero. Stack [x]. Host-independent.

§

AwkSqrt

sqrt(x) — square root. Stack [x]. Host-independent.

§

AwkSin

sin(x) — sine (radians). Stack [x]. Host-independent.

§

AwkCos

cos(x) — cosine (radians). Stack [x]. Host-independent.

§

AwkExp

exp(x) — e^x. Stack [x]. Host-independent.

§

AwkLog

log(x) — natural log. Stack [x]. Host-independent.

§

AwkAtan2

atan2(y, x) — arctangent of y/x. Stack [y, x]. Host-independent.

§

AwkDiv

awk a / b — float divide. Stack [a, b]. Raises a fatal “division by zero attempted” runtime error when b == 0 (POSIX awk), distinct from the shell-arithmetic Op::Div which yields Undef. Host-independent.

§

AwkMod

awk a % b — float modulo (fmod). Stack [a, b]. Raises a fatal “division by zero attempted in %'" runtime error when b == 0(POSIX awk), distinct fromOp::Mod`. Host-independent.

§

AwkDivJit

Block-JIT-eligible variant of Op::AwkDiv — identical semantics (float divide, fatal “division by zero attempted” on b == 0), but the block JIT compiles it natively with a guarded early-exit: on a zero divisor the compiled code sets a thread-local trap code and returns, and the VM raises the fatal immediately after the block function returns (AwkDiv stays interpreter-only so its existing behavior is untouched). Emitted only by the awkrs fusevm bridge for offloaded numeric chunks. Host-independent.

§

AwkModJit

Block-JIT-eligible variant of Op::AwkMod — identical semantics (float modulo, fatal “division by zero attempted in %'" on b == 0) with the same guarded early-exit trap as [Op::AwkDivJit`]. Host-independent.

§

AwkSqrtJit

Block-JIT-eligible variant of sqrt(x) — f64::sqrt on the non-negative path, libcall warning + +NaN on the negative path (matching the awk “received negative argument” warning). Uses Cranelift block params to phi-merge the two paths into a single SSA result, so the chunk stays disk-cacheable through the warn libcall (registered as a named host helper). Host-independent.

§

AwkLogJit

Block-JIT-eligible variant of log(x) — f64::ln on the non-negative path (which yields -inf for 0.0 naturally), libcall warning + +NaN on the negative path. Same phi-merge pattern as Op::AwkSqrtJit. The host-default lint_warn on zero (gawk LINT=1) is omitted here. Host-independent.

§

AwkLshiftJit

Block-JIT-eligible variant of lshift(a, n) — pops [a, n]. Raises the awk fatal “negative values are not allowed” when either operand is negative (guarded early-exit via the trap channel, code 3). The non-negative path computes (a as i64) << (n as i64 & 0x3f) and pushes the result as a float, matching the awkrs interpreter behavior. Host-independent.

§

AwkRshiftJit

Block-JIT-eligible variant of rshift(a, n) — same guard as Op::AwkLshiftJit (trap code 4), uses unsigned-right-shift on the non-negative path. Host-independent.

§

AwkComplJit

Block-JIT-eligible variant of compl(a) — pops [a]. Raises fatal “negative value is not allowed” when a < 0 (trap code 5). Non-negative path computes !(a as i64) and pushes as float. Host-independent.

§

AwkGetFieldNum(u16)

Block-JIT-eligible read of awk’s $N field as a number, where N is a compile-time constant (u16). Calls the host-installed hook crate::set_awk_field_num_hook, which the host must set to an extern "C" fn(i64) -> f64 BEFORE invoking any chunk containing this op. Pushes the returned f64 onto the stack. The hook reads the active awk record’s field via a host-side thread-local Runtime pointer; fusevm itself stays host-agnostic. If no hook is installed at chunk-run time, the libcall returns 0.0 (matching awk’s $N for missing fields).

§

PowFloat

Always-float exponentiation: pops [base, exp], pushes Float(base.powf(exp)). Unlike Op::Pow (whose JIT lowering keeps an integer result for two static-Int operands), this op coerces BOTH operands to f64 in every tier, so the JIT and interpreter agree and the chunk stays disk-cacheable (reuses the pow_f64 host helper). Intended for frontends whose ** is always floating-point (e.g. strykelang). Host-independent.

§

SqrtFloat

Always-float square root: pops [x], pushes Float(x.sqrt()) (NaN for a negative operand). Lowers to a native Cranelift fsqrt in the JIT and f64::sqrt in the interpreter — identical across tiers, with no host helper or relocation, so the chunk is trivially disk-cacheable. Unlike Op::AwkSqrt (which dispatches through the awk host and is not JIT-lowerable), this op is host-independent. Intended for frontends whose sqrt is always floating-point (e.g. strykelang).

§

SinFloat

Always-float sine (radians): pops [x], pushes Float(x.sin()). Lowers to the fusevm_jit_sin_f64 host helper in the JIT (the same one Op::AwkSin uses) and f64::sin in the interpreter. Unlike Op::AwkSin (which dispatches through the awk host and would panic in a non-awk fallback), this op is host-independent and runs in the plain interpreter, so the chunk is disk-cacheable. Intended for frontends whose sin is always floating-point (e.g. strykelang).

§

CosFloat

Always-float cosine (radians): pops [x], pushes Float(x.cos()). See Op::SinFloat; reuses the fusevm_jit_cos_f64 host helper.

§

ExpFloat

Always-float exponential: pops [x], pushes Float(x.exp()). See Op::SinFloat; reuses the fusevm_jit_exp_f64 host helper.

§

Atan2Float

Always-float two-argument arctangent: the chunk pushes y then x (so x is on top), pops both, and pushes Float(y.atan2(x)). See Op::SinFloat; reuses the fusevm_jit_atan2_f64 host helper. Intended for frontends whose atan2 is always floating-point (e.g. strykelang).

§

LogFloat

Always-float natural logarithm: pops [x], pushes Float(x.ln()). Lowers to the fusevm_jit_log_f64 host helper in the JIT and f64::ln in the interpreter. Host-independent (unlike Op::AwkLog, which dispatches through the awk host). Intended for frontends whose log is the always- floating-point natural log (e.g. strykelang).

§

AbsFloat

Always-float absolute value: pops [x], pushes Float(x.abs()). Lowers to the native Cranelift fabs in the JIT (no host helper, like Op::SqrtFloat) and f64::abs in the interpreter. Intended for frontends whose abs is floating-point (e.g. strykelang); integral results format identically to their integer form.

§

TruncInt

Truncate-to-integer (int(x)): pops [x], pushes Int of x truncated toward zero. An integer operand is returned unchanged (full i64 precision); a float is converted via a saturating cast (matching Rust’s f as i64 and Cranelift fcvt_to_sint_sat). Unlike Op::AwkInt (which keeps awk’s float result), this yields a genuine integer — intended for frontends whose int returns an integer (e.g. strykelang/Perl).

§

CeilFloat

Ceiling (always-float). Native Cranelift ceil.

§

FloorFloat

Floor (always-float). Native Cranelift floor.

§

TruncFloat

Truncate toward zero (always-float). Native Cranelift trunc.

§

RoundFloat

Round to nearest, ties to even (always-float). Native Cranelift nearest.

§

TanFloat

Tangent. Host helper fusevm_jit_tan_f64.

§

AsinFloat

Arcsine. Host helper fusevm_jit_asin_f64.

§

AcosFloat

Arccosine. Host helper fusevm_jit_acos_f64.

§

AtanFloat

1-arg arctangent. Host helper fusevm_jit_atan_f64.

§

SinhFloat

Hyperbolic sine. Host helper fusevm_jit_sinh_f64.

§

CoshFloat

Hyperbolic cosine. Host helper fusevm_jit_cosh_f64.

§

TanhFloat

Hyperbolic tangent. Host helper fusevm_jit_tanh_f64.

§

Log2Float

Base-2 logarithm. Host helper fusevm_jit_log2_f64.

§

Log10Float

Base-10 logarithm. Host helper fusevm_jit_log10_f64.

§

AbsInt

Integer absolute value (abs(i64)). Native Cranelift iabs.

§

GcdInt

Greatest common divisor of two non-negative i64s (gcd(|a|, |b|)). Host helper fusevm_jit_gcd_i64; returns 0 if both inputs are 0.

§

LcmInt

Least common multiple of two non-negative i64s (lcm(|a|, |b|)). Host helper fusevm_jit_lcm_i64; returns 0 if either input is 0; saturates at i64::MAX on overflow.

§

TimeInt

Unix epoch seconds as i64 (time()). Host helper fusevm_jit_time_i64. Pure-ish — depends on system clock; not const-foldable.

§

AwkArrayGet(u16)

arr[k] — stack [key]; pushes the element (auto-vivifies to “”). u16 = name-pool index of the array variable.

§

AwkArraySet(u16)

arr[k] = v — stack [value, key]. u16 = array name-pool index.

§

AwkArrayExists(u16)

(k in arr) — stack [key]; pushes Bool. u16 = array name-pool index.

§

AwkArrayDelete(u16)

delete arr[k] — stack [key]. u16 = array name-pool index.

§

AwkArrayClear(u16)

delete arr — clear the whole array. u16 = array name-pool index.

§

AwkArrayLen(u16)

length(arr) — push the element count. u16 = array name-pool index.

§

AwkAnd(u8)

and(v1, v2, ...) — bitwise AND; pops u8 args (≥2). Host-independent.

§

AwkOr(u8)

or(v1, v2, ...) — bitwise OR; pops u8 args (≥2). Host-independent.

§

AwkXor(u8)

xor(v1, v2, ...) — bitwise XOR; pops u8 args (≥2). Host-independent.

§

AwkCompl

compl(v) — bitwise complement. Stack [v]. Host-independent.

§

AwkLshift

lshift(v, n) — left shift. Stack [v, n]. Host-independent.

§

AwkRshift

rshift(v, n) — right shift. Stack [v, n]. Host-independent.

§

AwkStrtonum

strtonum(s) — parse hex/octal/decimal string to number. Stack [s]. Host-independent.

§

AwkSystime

systime() — seconds since the Unix epoch. Nullary; pushes a number. Host-independent.

§

AwkRand

rand() — next PRNG value in [0, 1). Nullary; pushes a number. VM-owned seed.

§

AwkSrand(u8)

srand([x]) — reseed PRNG, push previous seed. Payload = argc (0 or 1). VM-owned seed.

§

AwkStrftime(u8)

strftime([fmt[, ts[, utc]]]) — format timestamp. Payload = argc (0..=3). Host-independent.

§

AwkMktime(u8)

mktime(datespec[, utc]) — datespec → epoch seconds (or -1). Payload = argc (1..=2). Host-independent.

§

AwkOrd

ord(s) — Unicode scalar of first char (0 if empty). Host-independent.

§

AwkChr

chr(n) — single-char string for codepoint n (empty if invalid). Host-independent.

§

AwkMkbool

mkbool(x) — 1 if truthy else 0. Host-independent.

§

AwkIntdiv

intdiv(a, b) — truncating integer quotient (Undef on divide-by-zero). Host-independent.

§

AwkIntdiv0

intdiv0(a, b) — truncating integer quotient (0 on divide-by-zero; never errors). Host-independent.

§

AwkGensub(u8)

gensub(re, repl, how [, target]) — pops u8 args; pushes the result string. Host-bound (IGNORECASE, $0).

§

AwkSignal(u8)

AWK control-flow signal — halts the current chunk and stashes code in the VM for the frontend driver to read after run() (0=next, 1=nextfile, 2=exit; see crate::awk_builtins::signal). Has no fusevm::Value representation, so it is a VM-state side effect rather than a stack value. zshrs/stryke never emit it. Interpreter-only.

§

Go(u16, u8)

Spawn a goroutine running sub name_idx with argc popped args.

§

ChanMake

Make a channel with the capacity popped from the stack; pushes its id.

§

ChanSend

Send the popped value on the popped channel (may block).

§

ChanRecv

Receive from the popped channel, pushing the received value (may block).

§

ChanClose

Close the popped channel.

§

Select(u8, u8)

select over num_cases channel ops. Pops num_cases * 3 descriptor values (ch, is_recv, send_val per case) and, with has_default, raises a scheduling request. Pushes [recv_value, case_index].

§

CallDynamic(u8)

Indirect call: like Op::Call(name_idx, argc) but the subroutine name-index is popped from the top of the stack (below it sit the argc arguments). Lets a frontend call a function value whose target is only known at run time (closures passed as arguments, function-typed fields). Additive; frontends that never emit it are unaffected.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Op

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for Op

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Op

Source§

fn eq(&self, other: &Op) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Op

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more