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§
- aot
- Ahead-of-time build: bake a Perl script into a copy of the running
strykebinary as a compressed trailer, producing a self-contained executable. - ast
- AST node types for the Perl 5 interpreter.
Every node carries a
linefield for error reporting. - builtins
- Builtins dispatched from
FuncCall(names not modeled as dedicatedExprKinds). I/O usesInterpreter::io_file_slotsfor rawread/write/seekalongside buffered handles. - bytecode
- capture
- Structured shell output:
capture("cmd"). - cluster
- Persistent SSH worker pool dispatcher for
pmap_on. - compiler
- 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 withpython3 tools/gen_fmt.pyafterast.rschanges. - format
- Perl
format/write— picture lines and field padding (subset of Perl 5perlform). - interpreter
- lexer
- list_
util - Perl 5
List::Util— core Perl ships an XSList/Util.pm; stryke registers native Rust implementations here so everyEXPORT_OKname is callable and matches common Perl 5 semantics. - lsp
- Language server protocol (stdio) for editors —
stryke --lsp. - mro
- C3 method resolution order (Perl
mro/Algorithm::C3style). - native_
data - Native CSV (
csvcrate), SQLite (rusqlite), and HTTP JSON (ureq+serde_json) helpers. - pack
- Subset of Perl
pack/unpackfor binary I/O. Supported:AaNnVvCQqZHxwiIlLsSfd(optional repeat count after each;*for some). - par_
lines - Memory-mapped parallel line iteration for
par_lines PATH, sub { ... }. 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, sub { ... }. - parallel_
trace - Optional stderr tracing for
mysyncmutations undertrace { ... }andfan. - parser
- pcache
- Thread-safe memoization for
crate::ast::ExprKind::PcacheExpr. - pchannel
- Typed message channels for parallel blocks (
pchannel,send,recv,pselect). - pec
- On-disk bytecode bundles (
.pec): serializedcrate::ast::Program+crate::bytecode::Chunkfor warm starts without re-parsing or re-compiling whenSTRYKE_BC_CACHE=1. - 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
@INCpaths from the systemperlbinary (same directories Perl searches for.pmfiles). - perl_
signal - Minimal
%SIGdelivery for common signals (Unix). Handlers run between statements. - ppool
- Persistent thread pool (
ppool) — workers pull jobs from a shared queue and run each task on a freshInterpreteron 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, sub { ... }(notify + rayon). - remote_
wire - Framed bincode over stdin/stdout for
stryke --remote-worker(distributedpmap_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
- special_
vars - Perl 5
${^NAME}scalars: see perlvar. - static_
analysis - Static analysis pass for detecting undefined variables and subroutines.
- token
- value
- vm
Functions§
- compat_
mode - Returns
truewhen--compatis active. - 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. - parse
- parse_
and_ run_ string - Parse and execute a string of Perl code within an existing interpreter.
Tries bytecode VM first, falls back to tree-walker on unsupported features.
Uses
Interpreter::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). RestoresInterpreter::fileafter execution. - 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_
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).
- 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.