Skip to main content

Crate stryke

Crate stryke 

Source
Expand description

Crate root — see README.md for overview.

Re-exports§

pub use interpreter::perl_bracket_version;
pub use interpreter::FEAT_SAY;
pub use interpreter::FEAT_STATE;
pub use interpreter::FEAT_SWITCH;
pub use interpreter::FEAT_UNICODE_STRINGS;

Modules§

agent
stryke agent — Persistent load testing agent for distributed stress testing.
aot
Ahead-of-time build: bake a Perl script into a copy of the running stryke binary as a compressed trailer, producing a self-contained executable.
ast
AST node types for the Perl 5 interpreter. Every node carries a line field for error reporting.
builtins
Builtins dispatched from FuncCall (names not modeled as dedicated ExprKinds). I/O uses Interpreter::io_file_slots for raw read/write/seek alongside buffered handles.
bytecode
capture
Structured shell output: capture("cmd").
cluster
Persistent SSH worker pool dispatcher for pmap_on.
compiler
controller
stryke controller — Interactive REPL for coordinating stress test agents.
convert
Convert standard Perl source to idiomatic stryke syntax.
data_section
Split __DATA__ from program source (line must equal __DATA__ after trim).
debugger
Interactive debugger for stryke programs.
deconvert
Deconvert stryke .stk syntax back to standard Perl .pl syntax.
deparse
AST-to-source deparser for serializing code refs.
english
English.pm-style scalar aliases (use English).
error
fmt
Pretty-print parsed Perl back to source (stryke --fmt). Regenerate with python3 tools/gen_fmt.py after ast.rs changes.
format
Perl format / write — picture lines and field padding (subset of Perl 5 perlform).
interpreter
lexer
list_builtins
Stryke list builtins — native Rust implementations of sum, min, max, uniq, reduce, zip, the pairs family, and friends. Every fn here is a bare-name builtin reachable via [dispatch_by_name]; there is no Perl module emulation layer.
lsp
Language server protocol (stdio) for editors — stryke --lsp.
mro
C3 method resolution order (Perl mro / Algorithm::C3 style).
native_data
Native CSV (csv crate), SQLite (rusqlite), and HTTP JSON (ureq + serde_json) helpers.
pack
Subset of Perl pack / unpack for binary I/O. Supported: A a N n V v C Q q Z H x w i I l L s S f d (optional repeat count after each; * for some).
par_lines
Memory-mapped parallel line iteration for par_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_pipeline — two overloads:
par_walk
Parallel recursive directory walk for par_walk PATH, fn { ... }.
parallel_trace
Optional stderr tracing for mysync mutations under trace { ... } and fan.
parser
pcache
Thread-safe memoization for crate::ast::ExprKind::PcacheExpr.
pchannel
Typed message channels for parallel blocks (pchannel, send, recv, pselect).
perl_decode
UTF-8 vs Latin-1 octet decoding for Perl-compatible text (no dependency on crate::value). Used by I/O, par_lines, and byte stringification.
perl_fs
Perl-style filesystem helpers (stat, glob, etc.).
perl_inc
Resolve @INC paths from the system perl binary (same directories Perl searches for .pm files).
perl_signal
Minimal %SIG delivery for common signals (Unix). Handlers run between statements.
pkg
stryke package manager — RFC: docs/PACKAGE_REGISTRY.md.
ppool
Persistent thread pool (ppool) — workers pull jobs from a shared queue and run each task on a fresh Interpreter on an existing OS thread (no rayon task spawn per item; threads stay alive between jobs).
profiler
Wall-clock profiler for stryke --profile.
pwatch
Parallel file notifications for pwatch GLOB, fn { ... } (notify + rayon).
remote_wire
Framed bincode over stdin/stdout for stryke --remote-worker (distributed pmap_on).
rust_ffi
Inline Rust FFI — rust { ... } blocks compiled to a cdylib on first run, dlopened, and registered as Perl-callable subs.
rust_sugar
Source-level desugaring for rust { ... } FFI blocks.
scope
script_cache
SQLite-backed bytecode cache for scripts.
shell_exec
Shell command executor for zshrs
shell_fds
File descriptor utilities for zshrs
shell_history
SQLite-backed command history for zshrs
shell_jobs
Job control for zshrs
shell_parse
Zsh parser - Direct port from zsh/Src/parse.c
shell_signal
Signal handling for zshrs
shell_zle
ZLE - Zsh Line Editor
shell_zwc
ZWC (Zsh Word Code) file parser
special_vars
Perl 5 ${^NAME} scalars: see perlvar.
static_analysis
Static analysis pass for detecting undefined variables and subroutines.
token
value
vm
zsh_lex
Zsh lexical analyzer - Direct port from zsh/Src/lex.c
zsh_parse
Zsh parser - Direct port from zsh/Src/parse.c
zsh_tokens
Zsh token definitions - Direct port from zsh/Src/zsh.h

Functions§

compat_mode
Returns true when --compat is 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_chunk for 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
Returns true when --no-interop is active.
parse
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-interop is 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 Interpreter::file for 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 use file (e.g. a required module path). Restores Interpreter::file after 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 .pm absolute path. Use parse for snippets where -e is 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 $_ to line_str, runs from body_start_ip to Halt, returns $_ for -p output.
run_lsp_stdio
Language server over stdio (stryke --lsp). Returns a process exit code.
set_compat_mode
Enable Perl 5 strict-compatibility mode (disables all stryke extensions).
set_no_interop_mode
Enable no-interop mode (rejects Perl-isms, forces idiomatic stryke).
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). The stryke / stryke driver prepends this to @INC when the directory exists so in-tree pure-Perl modules shadow XS-only core stubs.