Expand description
Crate root — see README.md for overview.
Re-exports§
pub use vm_helper::perl_bracket_version;pub use vm_helper::FEAT_SAY;pub use vm_helper::FEAT_STATE;pub use vm_helper::FEAT_SWITCH;pub use vm_helper::FEAT_UNICODE_STRINGS;
Modules§
- agent
agentsubmodule.stryke agent— Persistent load testing agent for distributed stress testing.- ai
aisubmodule. AI primitives — Phase 0 (“walking skeleton”) of the design indocs/AI_PRIMITIVES.md.- ai_
sugar ai_sugarsubmodule. Source-level desugar fortool fnandmcp_serversyntax.- aop
aopsubmodule. Aspect-oriented programming primitives for stryke.- aot
aotsubmodule. Ahead-of-time build: bake a Perl script into a copy of the runningstrykebinary as a compressed trailer, producing a self-contained executable.- ast
astsubmodule. AST node types for the Perl 5 interpreter. Every node carries alinefield for error reporting.- banner
bannersubmodule. Stryke ASCII logo + live-stats box banner. Single source of truth shared by:- builtins
builtinssubmodule. Builtins dispatched fromFuncCall(names not modeled as dedicatedExprKinds). I/O usesInterpreter::io_file_slotsfor rawread/write/seekalongside buffered handles.- builtins_
bio_ geom_ markov builtins_bio_geom_markovsubmodule. Bioinformatics, 3D geometry, sequence alignment, file format header parsers, resampling, Markov chains.- builtins_
bits_ music_ stats builtins_bits_music_statssubmodule. Bit manipulation, music theory, hash functions, text utilities, statistical tests. Pure deterministic functions.- builtins_
combin_ audio_ physics builtins_combin_audio_physicssubmodule. Combinatorics, audio synthesis, search algorithms, physics 2D, noise generators, RNG variants, polygonal numbers.- builtins_
const builtins_constsubmodule. Constants & distribution helpers. HTTP status codes return their numeric value. HTTP method names return their canonical uppercase form. Distribution PDF/quantile/ sampler functions use thestatrscrate.- builtins_
data builtins_datasubmodule. HTML / JSON / XML / CSS primitives. Usesserde_jsonandscraper(both already deps). XML/CSS ops that don’t have a clean crate-backed implementation use lightweight regex/string parsing — pragmatic, not RFC-perfect.- builtins_
games_ ml_ chem builtins_games_ml_chemsubmodule. Game theory, ML inference primitives, operations research, chemistry, language modeling, information-theoretic divergences.- builtins_
geom builtins_geomsubmodule. Geometric primitives, complex numbers, color-space extras, and trig extras. Pure functions, no external crates.- builtins_
github builtins_githubsubmodule. GitHub REST API primitives — pragmatic wrappers aroundapi.github.com.- builtins_
iter builtins_itersubmodule. Iterator combinator + string-distance extras. Pure functions, no external crates.- builtins_
linalg_ graph_ date builtins_linalg_graph_datesubmodule. Linear algebra (matrices), graph algorithms, calendar/date helpers, special math. Pure functions only.- builtins_
mathx builtins_mathxsubmodule. Math / number theory / random extras.- builtins_
misc builtins_miscsubmodule. Miscellaneous primitives: BigInt ops + game/physics vectors + probabilistic data structures + audio synthesis basics + geo extras. Pure functions where possible; BigInt usesnum-bigint.- builtins_
misc2 builtins_misc2submodule. Currency / ML / file-path / locale / channels. Pure functions where possible. Channels honor capacity, oneshot auto-close, and subscriber cursors; timeout args are accepted but no-op in the single-thread VM.- builtins_
net builtins_netsubmodule. Network / IP / CIDR / MAC primitives — Phase 1 of the 10k-builtin push.- builtins_
phonetic_ geo_ codec builtins_phonetic_geo_codecsubmodule. Phonetic algorithms, geo projections, base58/base91, astronomy, CRC variants, color blending, compression primitives.- builtins_
quant builtins_quantsubmodule. Quantitative builtins: technical indicators, time-series ops, finance, optimization, numerical methods. Pure functions; deliberately compact implementations.- builtins_
ratings_ geom_ units builtins_ratings_geom_unitssubmodule. Ratings/tournaments, image morphology, computational geometry 2D, crypto primitives, physics constants, case conversions, photography, unit conversions.- builtins_
sync builtins_syncsubmodule. Synchronization primitives — basic exclusive mutex + counting semaphore.- builtins_
validate builtins_validatesubmodule. Validation / input-check primitives.- builtins_
vision_ ir_ algorithms builtins_vision_ir_algorithmssubmodule. Computer vision / image kernels, information retrieval, distance metrics, Bayesian updates, RL primitives, color spaces, window functions, trie / Fenwick / union-find, network extras.- bytecode
bytecodesubmodule.- capture
capturesubmodule. Structured shell output:capture("cmd").- cli_
runners cli_runnerssubmodule. Shared runners forstryke checkandstryke test.- cluster
clustersubmodule. Persistent SSH worker pool dispatcher forpmap_on.- compiler
compilersubmodule.- controller
controllersubmodule.stryke controller— Interactive REPL for coordinating stress test agents.- convert
convertsubmodule. Convert standard Perl source to idiomatic stryke syntax.- dap
dapsubmodule. Debug Adapter Protocol (DAP) server for stryke.- data_
section data_sectionsubmodule. Split__DATA__from program source (line must equal__DATA__after trim).- debugger
debuggersubmodule. Interactive debugger for stryke programs.- deconvert
deconvertsubmodule. Deconvert stryke .stk syntax back to standard Perl .pl syntax.- deparse
deparsesubmodule. AST-to-source deparser for serializing code refs.- doc_
render doc_rendersubmodule. Render raw hover-doc markdown (fromlsp::doc_text_for) into a terminal display string. Same visual surface as thestryke docsinteractive browser — bold topic heading, dim rule, cyan inlinebackticks, greencode fences— but without the pager chrome (header/footer banner, page navigation hints), so a single doc page can be returned by thedocs(TOPIC)builtin and printed inline at the REPL.- docs
docssubmodule. Module-doc generator — produces Markdown documentation from a parsed stryke source file by pairing## doc commentswith the top-level declaration immediately below them.- english
englishsubmodule.English.pm-style scalar aliases (use English).- error
errorsubmodule.- fmt
fmtsubmodule. Pretty-print parsed Perl back to source (stryke --fmt). Regenerate withpython3 tools/gen_fmt.pyafterast.rschanges.- format
formatsubmodule. Perlformat/write— picture lines and field padding (subset of Perl 5perlform).- fusevm_
bridge fusevm_bridgesubmodule: translates strykelang bytecode to the sharedfusevmruntime, making strykelang a fusevm frontend (opt-in JIT tier). Bridge between strykelang bytecode (crate::bytecode::Op) and the sharedfusevmruntime.- getopts
getoptssubmodule.getopts— Getopt::Long-style CLI flag parser.- god
godsubmodule.god EXPR— omniscient runtime introspection.- kvstore
kvstoresubmodule. rkyv-backed KV store — first-class CRUD store in any scripting language.- lexer
lexersubmodule.- list_
builtins list_builtinssubmodule. Stryke list builtins — native Rust implementations ofsum,min,max,uniq,reduce,zip, thepairsfamily, and friends. Every fn here is a bare-name builtin reachable via [dispatch_by_name]; there is no Perl module emulation layer.- lsp
lspsubmodule. Language server protocol (stdio) for editors —stryke --lsp.- lsp_
docs_ domains lsp_docs_domainssubmodule. Hand-written LSP hover descriptions for stryke builtins grouped by domain. Returned viadoc_for_label_textfallback — every entry here is concise, signature-typed, and ships a runnable example.- lsp_
extras lsp_extrassubmodule. Additional LSP capabilities forstryke --lsp:- lsp_
symbols lsp_symbolssubmodule. Scope-aware symbol table for the LSP server. Powers rename, find-references, and go-to-declaration with proper lexical-scope resolution instead of the textual-occurrence fallback in [crate::lsp::highlights_for_identifier].- mcp
mcpsubmodule. MCP client (Model Context Protocol) — Phase 2 of AI_PRIMITIVES.md.- minify
minifysubmodule. Source-code minifier for stryke (stryke minify FILE).- mro
mrosubmodule. C3 method resolution order (Perlmro/Algorithm::C3style).- nat_
punch nat_punchsubmodule. STUN client + UDP hole-punching state machine for stryke’sstunandpunchbuiltins.- native_
data native_datasubmodule. Native CSV (csvcrate), SQLite (rusqlite), and HTTP JSON (ureq+serde_json) helpers.- pack
packsubmodule. Subset of Perlpack/unpackfor binary I/O. Supported:AaNnVvCQqZHxwiIlLsSfd(optional repeat count after each;*for some).- par_
lines par_linessubmodule. Memory-mapped parallel line iteration forpar_lines PATH, fn { ... }. Splits the file into byte ranges aligned to line starts, then processes each chunk in parallel with rayon (each chunk scans its lines sequentially).- par_
pipeline par_pipelinesubmodule.par_pipeline— two overloads:- par_
walk par_walksubmodule. Parallel recursive directory walk forpar_walk PATH, fn { ... }.- parallel_
trace parallel_tracesubmodule. Optional stderr tracing formysyncmutations undertrace { ... }andfan.- parser
parsersubmodule.- pcache
pcachesubmodule. Thread-safe memoization forcrate::ast::ExprKind::PcacheExpr.- pchannel
pchannelsubmodule. Typed message channels for parallel blocks (pchannel,send,recv,pselect).- perf_
recorder perf_recordersubmodule. Wall-clock recorder forstryke --record. Writes one row per stryke invocation to~/.stryke/perf.sqlite, queryable via theperfviewbuiltin.- perl_
decode perl_decodesubmodule. UTF-8 vs Latin-1 octet decoding for Perl-compatible text (no dependency oncrate::value). Used by I/O,par_lines, and byte stringification.- perl_fs
perl_fssubmodule. Perl-style filesystem helpers (stat,glob, etc.).- perl_
inc perl_incsubmodule. Resolve@INCpaths from the systemperlbinary (same directories Perl searches for.pmfiles).- perl_
pty perl_ptysubmodule. PTY-driven interactive automation — Phases 1–4 of the Tcl/Expect-style feature. Builtins are bare-name and take the handle hashref as first argument; method-form$h->expect(...)works through the thinPtyHandleclass shipped via [PTY_HANDLE_CLASS_STK].- perl_
signal perl_signalsubmodule. Minimal%SIGdelivery for common signals (Unix). Handlers run between statements.- pkg
pkgsubmodule. stryke package manager — RFC:docs/PACKAGE_REGISTRY.md.- ppool
ppoolsubmodule. Persistent thread pool (ppool) — workers pull jobs from a shared queue and run each task on a freshVMHelperon an existing OS thread (no rayon task spawn per item; threads stay alive between jobs).- profiler
profilersubmodule. Wall-clock profiler forstryke --profile.- provenance
provenancesubmodule.provenance($val)— value lineage as a first-class builtin.- pwatch
pwatchsubmodule. Parallel file notifications forpwatch GLOB, fn { ... }(notify + rayon).- remote_
wire remote_wiresubmodule. Framed bincode over stdin/stdout forstryke --remote-worker(distributedpmap_on).- rust_
ffi rust_ffisubmodule. Inline Rust FFI —rust { ... }blocks compiled to a cdylib on first run, dlopened, and registered as Perl-callable subs.- rust_
sugar rust_sugarsubmodule. Source-level desugaring forrust { ... }FFI blocks.- scope
scopesubmodule.- script_
cache script_cachesubmodule. rkyv-backed bytecode cache for scripts.- secrets
secretssubmodule. Encrypted secrets — AES-256-GCM authenticated encryption.- serialize_
normalize serialize_normalizesubmodule. Free-function recursive flatten of strykeClassInstance/StructInstancevalues into plain hashref / arrayref trees, for use by serializers (to_json,to_xml,to_yaml,to_toml,to_html,ddump) that take&[StrykeValue]and don’t have a&VMHelperto consult.- shell_
exec execsubmodule. Faithful Rust ports of free functions and file-static globals fromSrc/exec.c. The wordcode-VM dispatch tree (execlist/execpline/execcmd/execsimpleetc.) that drives execution in C zsh is NOT replicated here — zshrs runs the fusevm bytecode VM instead (seesrc/vm_helper.rs+src/fusevm_bridge.rs).- shell_
fds fdssubmodule. File descriptor utilities for zshrs.- shell_
history historysubmodule. SQLite-backed command history for zshrs.- shell_
jobs jobssubmodule. job control for zshrs- shell_
parse parsesubmodule. Zsh parser — direct port from zsh/Src/parse.c.- shell_
signal signalssubmodule. Signal handling for zshrs- shell_
zle zlesubmodule. ZLE - Zsh Line Editor- shell_
zwc zwcsubmodule. ZWC (Zsh Word Code) file parser. Direct port of the dump-file family in zsh/Src/parse.c:3077-end.- sketches
sketchessubmodule. Probabilistic data structures as native stryke builtins.- special_
vars special_varssubmodule. Perl 5${^NAME}scalars: see perlvar.- static_
analysis static_analysissubmodule. Static analysis pass for detecting undefined variables and subroutines.- stego
stegosubmodule. Polymorphic steganography:hide(CARRIER, SECRET [, KEY])/reveal(STEGO [, KEY]).- stress
stresssubmodule. Expanded stress-testing surface. The originalstress_cpu/stress_mem/stress_io/stress_test/heatbuiltins live inbuiltins.rs; this module adds the rest of the load-axis matrix — float / int / cache / branch / sort compute; sustained-disk + IOPS; TCP / HTTP / DNS network; fork / thread churn; alloc / mmap memory; crypto / compress / regex / json kernels; ramp / burst / oscillate patterns; and per-system telemetry (temp / freq / throttle / load / meminfo).- stryke_
log stryke_logsubmodule. Stryke long-lived log file at~/.stryke/stryke.log(or$STRYKE_HOME/stryke.logwhen that env var is set).- teleport
teleportsubmodule.teleport($val, @pids)+arrive([$timeout_ms])— multi-target SHM IPC.- token
tokensubmodule.- turn_
client turn_clientsubmodule. TURN client (RFC 8656 core) for stryke’s relay-fallback path when pure UDP hole-punching fails (symmetric NATs, UDP-blocking firewalls).- turnbuckle
turnbucklesubmodule.turnbuckle($peer_pid)— 1:1 peer-pair keepalive over UNIX-domain datagram.- udp_
sockets udp_socketssubmodule. Persistent UDP socket pool for stryke’s hole-punching builtins.- value
valuesubmodule.- vm
vmsubmodule.- vm_
helper vm_helpersubmodule.- web
websubmodule. Web framework runtime — Rails-shaped builtins for stryke.- web_orm
web_ormsubmodule. Web framework ORM + migrator runtime — PASS 3 + PASS 4.- zsh_lex
lexsubmodule. Zsh lexical analyzer - Direct port from zsh/Src/lex.c- zsh_
parse parsesubmodule. Zsh parser — direct port from zsh/Src/parse.c.- zsh_
tokens lexsubmodule. Zsh lexical analyzer - Direct port from zsh/Src/lex.c
Macros§
- slog_
debug - slog_
error - slog_
info - slog_
trace slog_trace!("tag", "fmt {} {}", a, b);- slog_
warn
Constants§
- ERRFLAG_
ERROR ERRFLAG_ERRORconstant.
Statics§
- zsh_
errflag - Port of
int errflagfromSrc/init.c. Tracks whether an error has been raised (ERRFLAG_ERROR = 1) or break/return is in flight (ERRFLAG_INT = 2).
Functions§
- bigint_
pragma - Returns
truewhenuse bigint;is active in this script. - compat_
mode - Returns
truewhen--compatis active. - compile_
and_ run_ prelude - Compile program and run only the prelude (BEGIN/CHECK/INIT phase blocks) via the VM.
Stores the compiled chunk on
interp.line_mode_chunkfor per-line re-execution. - convert_
to_ stryke - Convert a parsed program to stryke syntax with
|>pipes and no semicolons. - convert_
to_ stryke_ with_ options - Convert a parsed program to stryke syntax with custom options.
- deconvert_
to_ perl - Deconvert a parsed stryke program back to standard Perl .pl syntax.
- deconvert_
to_ perl_ with_ options - Deconvert a parsed stryke program back to standard Perl .pl syntax with options.
- format_
program - Parse a string of Perl code and return the AST.
Pretty-print a parsed program as Perl-like source (
stryke --fmt). - lint_
program - Parse + register top-level subs /
use(same as the VM path), then compile to bytecode without running. Also runs static analysis to detect undefined variables and subroutines. - no_
interop_ mode - Effective no-interop flag for this thread: TLS override if set, else the process-wide default. Hot path — called from parser/lexer.
- no_
interop_ mode_ tls - Read the current thread’s no-interop override (without falling back). Used by RAII guards to save/restore.
- parse
parse— see implementation.- parse_
and_ run_ module_ in_ file - Like
parse_and_run_string_in_file, but marks parsing as a module load. Allows shadowing stryke builtins (e.g.sub blessed { ... }) unless--no-interopis active. - parse_
and_ run_ string - Parse and execute a string of Perl code within an existing interpreter.
Compile and execute via the bytecode VM.
Uses
VMHelper::filefor both parse diagnostics and__FILE__during this execution. - parse_
and_ run_ string_ in_ file - Like
parse_and_run_string, but parse errors and__FILE__for this run usefile(e.g. a required module path). RestoresVMHelper::fileafter execution. - parse_
module_ with_ file - Like
parse_with_file, but marks the parser as loading a module. Modules are allowed to shadow stryke builtins (e.g.sub blessed { ... }in Scalar::Util.pm) unless--no-interop. - parse_
with_ file - Parse with a source path for lexer/parser diagnostics (
… at FILE line N), e.g. a script path or a required.pmabsolute path. Useparsefor snippets where-eis appropriate. - run
- Parse and execute a string of Perl code with a fresh interpreter.
- run_
line_ body - Execute the body portion of a pre-compiled chunk for one input line.
Sets
$_toline_str, runs frombody_start_ipto Halt, returns$_for-poutput. - run_
lsp_ stdio - Language server over stdio (
stryke --lsp). Returns a process exit code. - set_
bigint_ pragma - Enable bigint pragma (
use bigint;) — integer overflow promotes toBigIntinstead of demoting tof64. - set_
compat_ mode - Enable Perl 5 strict-compatibility mode (disables all stryke extensions).
- set_
no_ interop_ mode - Set the process-wide default for no-interop mode. Used by the CLI
(
--no-interop); threads without a thread-local override inherit it. - set_
no_ interop_ mode_ tls - Set the current thread’s no-interop override.
Noneclears it;Some(b)pins this thread tob. Sibling threads are unaffected — the primitive that letscheck_no_interopwork safely frompmaps. - try_
vm_ execute - Try to compile and run via bytecode VM. Returns None if compilation fails.
- vendor_
perl_ inc_ path - Crate-root
vendor/perl(e.g.List/Util.pm). Thestryke/strykedriver prepends this to@INCwhen the directory exists so in-tree pure-Perl modules shadow XS-only core stubs.