<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark light">
<meta name="description" content="stryke — a highly parallel Perl 5 interpreter in Rust. Rayon-powered builtins, bytecode VM + JIT, pipe-forward syntax, and reflection hashes for every builtin / alias / extension.">
<title>stryke — Documentation</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Share+Tech+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="hud-static.css">
<link rel="stylesheet" href="tutorial.css">
<style>
.tutorial-main { max-width: 68rem; }
.docs-build-line {
margin: 0.35rem 0 0;
font-family: 'Share Tech Mono', ui-monospace, monospace;
font-size: 11px;
color: var(--text-dim);
letter-spacing: 0.03em;
max-width: 42rem;
opacity: 0.75;
}
.hub-scheme-strip {
border-bottom: 1px dashed var(--border);
background: color-mix(in srgb, var(--bg-secondary) 85%, transparent);
padding: 0.55rem 1.5rem 0.65rem;
position: relative;
}
.hub-scheme-strip-inner {
max-width: 68rem;
margin: 0 auto;
display: flex;
align-items: center;
gap: 0.85rem;
}
.hub-scheme-strip .hud-scheme-label {
flex: 0 0 auto;
font-family: 'Orbitron', sans-serif;
font-size: 9px;
font-weight: 700;
letter-spacing: 2px;
text-transform: uppercase;
color: var(--accent);
text-align: left;
}
.hub-scheme-strip .scheme-grid {
flex: 1 1 auto;
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 6px;
}
@media (max-width: 720px) {
.hub-scheme-strip-inner { flex-direction: column; align-items: stretch; }
.hub-scheme-strip .scheme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Reflection / builtin tables */
.reflection-table {
width: 100%;
border-collapse: collapse;
margin: 0.6rem 0 0.2rem;
font-size: 12px;
}
.reflection-table th {
background: var(--bg-secondary);
color: var(--cyan);
font-family: 'Orbitron', sans-serif;
font-size: 10px;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
text-align: left;
padding: 6px 10px;
border: 1px solid var(--border);
}
.reflection-table td {
padding: 6px 10px;
border: 1px solid var(--border);
color: var(--text-dim);
vertical-align: top;
}
.reflection-table td code { color: var(--accent-light); background: var(--bg); }
/* One-liner example blocks — pre with a "copy" affordance via user select */
.oneliner {
margin: 0.4rem 0;
padding: 0.55rem 0.8rem;
border-left: 2px solid var(--cyan);
background: var(--bg);
font-family: 'Share Tech Mono', ui-monospace, monospace;
font-size: 12px;
color: var(--text);
white-space: pre-wrap;
word-break: break-word;
}
.oneliner .comment { color: var(--text-muted); }
/* Index-card grid for builtin categories */
.cat-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
gap: 0.6rem;
margin: 0.7rem 0;
}
.cat-card {
border: 1px solid var(--border);
border-left: 2px solid var(--cyan);
padding: 0.6rem 0.8rem;
background: color-mix(in srgb, var(--bg-card) 92%, transparent);
border-radius: 2px;
}
.cat-card h4 {
font-family: 'Orbitron', sans-serif;
font-size: 11px;
font-weight: 700;
letter-spacing: 1.5px;
text-transform: uppercase;
color: var(--cyan);
margin: 0 0 0.35rem;
}
.cat-card p {
margin: 0;
font-size: 11.5px;
color: var(--text-dim);
line-height: 1.5;
}
.cat-card code { font-size: 11px; color: var(--accent-light); }
</style>
</head>
<body>
<div class="app tutorial-app" id="docsApp">
<div class="crt-scanline" id="crtH" aria-hidden="true"></div>
<div class="crt-scanline-v" id="crtV" aria-hidden="true"></div>
<header class="tutorial-header">
<div class="tutorial-header-inner">
<div>
<h1 class="tutorial-brand">// STRYKE — PARALLEL PERL5 INTERPRETER</h1>
<nav class="tutorial-crumbs" aria-label="Breadcrumb">
<span class="current">Docs</span>
<span class="sep">/</span>
<a href="reference.html">Full reference</a>
<span class="sep">/</span>
<a href="https://github.com/MenkeTechnologies/strykelang" target="_blank" rel="noopener noreferrer">GitHub</a>
<span class="sep">/</span>
<a href="https://crates.io/crates/strykelang" target="_blank" rel="noopener noreferrer">crates.io</a>
<span class="sep">/</span>
<a href="https://docs.rs/strykelang" target="_blank" rel="noopener noreferrer">docs.rs</a>
</nav>
<p class="docs-build-line" id="strykeBuildLine">stryke v0.8.3 · Rust-powered · Rayon work-stealing · Cranelift JIT · Perl 5 compat surface + pipe-forward sugar</p>
</div>
<div class="tutorial-toolbar">
<button type="button" class="btn btn-secondary" id="btnTheme" title="Toggle light/dark">Theme</button>
<button type="button" class="btn btn-secondary active" id="btnCrt" title="CRT scanline overlay">CRT</button>
<button type="button" class="btn btn-secondary active" id="btnNeon" title="Neon border pulse">Neon</button>
<a class="btn btn-secondary" href="reference.html">Reference</a>
<a class="btn btn-secondary" href="https://github.com/MenkeTechnologies/strykelang" target="_blank" rel="noopener noreferrer">GitHub</a>
<a class="btn btn-secondary" href="https://github.com/MenkeTechnologies/strykelang/issues" target="_blank" rel="noopener noreferrer">Issues</a>
</div>
</div>
</header>
<div class="hub-scheme-strip">
<div class="hub-scheme-strip-inner">
<span class="hud-scheme-label">// Color scheme</span>
<div class="scheme-grid" id="hudSchemeGrid"></div>
</div>
</div>
<main class="tutorial-main">
<h2 class="tutorial-title"><span class="step-hash">>_</span>STRYKE REFERENCE</h2>
<p class="tutorial-subtitle">A Perl 5 interpreter written in Rust, optimized for parallelism. NaN-boxed <code>PerlValue</code>, rayon work-stealing across every CPU, bytecode VM with Cranelift JIT, and a pipe-forward (<code>|></code>) syntax that threads values through chained stages without refs or intermediate vars. This hub links to the authoritative docs in <code>README.md</code> and <code>rustdoc</code>; the sections below give a fast tour of the surface.</p>
<section class="tutorial-section">
<h2>Quickstart</h2>
<p>Install from crates.io or source, then run scripts or one-liners with <code>s</code> (short for stryke):</p>
<pre># install
cargo install strykelang
# from source
git clone https://github.com/MenkeTechnologies/strykelang
cd strykelang && cargo build --release
# one-liners
s 'p "hello, world"'
s '1..20 |> fi even |> map { _ * _ } |> sum |> p'
s '~>1:20fi{even}map{_*_}sum p'
s 'qw(a b c) |> map uc |> join "," |> p'
s '~> qw(a,b,c) map{uc} join(",") p'
# parallel primitives
s '1..8 |> pmap expensive |> p'
# read + parse JSON
s 'read_json("data.json") |> to_yaml |> p'
s 'p to_yaml read_json "data.json"'</pre>
<p>Full install + usage live in the <a href="https://github.com/MenkeTechnologies/strykelang#readme">README</a>.</p>
<p><strong><code>-e</code> is optional.</strong> If the first argument isn't a file and looks like code, <code>s</code> runs it directly. <code>s 'p 42'</code> and <code>s -e 'p 42'</code> are equivalent.</p>
</section>
<section class="tutorial-section">
<h2>Why stryke — One-Liner Comparison</h2>
<table class="comparison-table" style="width:100%; border-collapse:collapse; font-size:0.85em;">
<thead>
<tr style="border-bottom:2px solid #0ff;">
<th style="text-align:left; padding:4px;">Feature</th>
<th style="padding:4px;">stryke</th>
<th style="padding:4px;">perl5</th>
<th style="padding:4px;">ruby</th>
<th style="padding:4px;">python</th>
<th style="padding:4px;">awk</th>
<th style="padding:4px;">jq</th>
</tr>
</thead>
<tbody>
<tr><td>No <code>-e</code> flag needed</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✗</td><td>—</td><td>—</td></tr>
<tr><td>No semicolons</td><td style="color:#0f0;">✓</td><td>✗</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td></tr>
<tr><td>Built-in HTTP</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td></tr>
<tr><td>Built-in JSON</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✓</td><td>✗</td><td>✓</td></tr>
<tr><td>Built-in CSV</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✓</td><td>✗</td><td>✗</td></tr>
<tr><td>Built-in SQLite</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✓</td><td>✗</td><td>✗</td></tr>
<tr><td>Parallel map/grep</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td></tr>
<tr><td>Pipe-forward <code>|></code></td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td><code>|</code></td></tr>
<tr><td>Thread macro</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td></tr>
<tr><td>In-place edit <code>-i</code></td><td style="color:#0f0;">parallel</td><td>sequential</td><td>sequential</td><td>✗</td><td>✗</td><td>✗</td></tr>
<tr><td>Data viz (spark/bars/flame)</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td></tr>
<tr><td>Clipboard</td><td style="color:#0f0;">✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td></tr>
<tr><td>JIT compiler</td><td style="color:#0f0;">Cranelift</td><td>✗</td><td>YJIT</td><td>✗</td><td>✗</td><td>✗</td></tr>
<tr><td>Single binary</td><td style="color:#0f0;">26MB</td><td>pkg</td><td>pkg</td><td>pkg</td><td>pkg</td><td>3MB</td></tr>
</tbody>
</table>
<h3 style="margin-top:1em;">Character count — real tasks</h3>
<table style="width:100%; border-collapse:collapse; font-size:0.85em;">
<thead>
<tr style="border-bottom:2px solid #0ff;">
<th style="text-align:left; padding:4px;">Task</th>
<th style="padding:4px;">s</th>
<th style="padding:4px;">perl5</th>
<th style="padding:4px;">ruby</th>
<th style="padding:4px;">python</th>
</tr>
</thead>
<tbody>
<tr><td>Sum 1..100</td><td style="color:#0f0;"><code>s 'p sum 1..100'</code> <b>19c</b></td><td>45c</td><td>28c</td><td>38c</td></tr>
<tr><td>Word freq</td><td style="color:#0f0;"><code>s -an 'freq(@F) |> dd'</code> <b>25c</b></td><td>61c</td><td>—</td><td>—</td></tr>
<tr><td>SHA256 file</td><td style="color:#0f0;"><code>s 'p s256"f"'</code> <b>14c</b></td><td>70c+</td><td>—</td><td>80c+</td></tr>
<tr><td>CSV → JSON</td><td style="color:#0f0;"><code>s 'csv_read("f") |> tj |> p'</code> <b>33c</b></td><td>needs modules</td><td>needs modules</td><td>90c</td></tr>
<tr><td>Parallel map</td><td style="color:#0f0;"><code>s '1..1e6 |> pmap{_ * 2}'</code> <b>30c</b></td><td>—</td><td>—</td><td>—</td></tr>
</tbody>
</table>
</section>
<section class="tutorial-section">
<h2>Overview</h2>
<ul>
<li><strong>Parser & compiler</strong> — recursive-descent parser in <code>src/parser.rs</code>, producing an AST consumed by both a tree-walking <code>Interpreter</code> and a bytecode <code>Compiler</code> (<code>src/compiler.rs</code>) that feeds the VM (<code>src/vm.rs</code>). Cranelift JIT kicks in for hot blocks and linear subs (<code>src/jit.rs</code>).</li>
<li><strong>Values</strong> — <code>PerlValue</code> is a NaN-boxed <code>u64</code>: immediates (<code>undef</code>, <code>i32</code>, raw <code>f64</code> bits) and tagged <code>Arc<HeapObject></code> pointers for big ints, strings, arrays, hashes, refs, regexes, atomics, channels.</li>
<li><strong>Regex</strong> — three-tier engine: Rust <code>regex</code> → <code>fancy-regex</code> (backrefs) → <code>pcre2</code> (PCRE-only verbs).</li>
<li><strong>Parallelism</strong> — every parallel builtin uses rayon work-stealing across all cores. See <code>pmap</code>, <code>pflat_map</code>, <code>pgrep</code>, <code>pfor</code>, <code>psort</code>, <code>preduce</code>, <code>pcache</code>, <code>ppool</code>, <code>fan</code>, <code>pipeline</code>, <code>par_pipeline_stream</code>, <code>pchannel</code>, <code>pselect</code>, <code>par_walk</code>, <code>par_lines</code>, <code>par_sed</code>.</li>
<li><strong>Binary size</strong> — ~21 MB stripped with LTO + O3.</li>
</ul>
</section>
<section class="tutorial-section">
<h2>Language reflection</h2>
<p>Everything the parser and dispatcher know about is exposed as plain Perl hashes, populated from the source of truth at compile time. <code>build.rs</code> parses category-labeled section comments in <code>is_perl5_core</code> / <code>stryke_extension_name</code>, the <code>try_builtin</code> match arms, and LSP hover docs in <code>doc_for_label_text</code>. <strong>Eight hashes — every direct lookup is O(1)</strong>.</p>
<h3>Forward maps</h3>
<table class="reflection-table">
<thead>
<tr><th>Long name</th><th>Short</th><th>Key → Value</th></tr>
</thead>
<tbody>
<tr><td><code>%stryke::builtins</code></td><td><code>%b</code></td><td><strong>primary</strong> callable name → category. Clean unique-op count.</td></tr>
<tr><td><code>%stryke::all</code></td><td><code>%all</code></td><td><strong>every spelling</strong> (primary + alias) → category. Aliases inherit their primary's tag. Use for <code>scalar keys %all</code>.</td></tr>
<tr><td><code>%stryke::perl_compats</code></td><td><code>%pc</code></td><td>subset of <code>%b</code>: Perl 5 core only, name → category</td></tr>
<tr><td><code>%stryke::extensions</code></td><td><code>%e</code></td><td>subset of <code>%b</code>: stryke-only, name → category</td></tr>
<tr><td><code>%stryke::aliases</code></td><td><code>%a</code></td><td>alias → canonical primary</td></tr>
<tr><td><code>%stryke::descriptions</code></td><td><code>%d</code></td><td>name → LSP one-liner (<em>sparse</em>)</td></tr>
</tbody>
</table>
<h3>Inverted indexes (O(1) reverse-query)</h3>
<table class="reflection-table">
<thead>
<tr><th>Long name</th><th>Short</th><th>Key → Value</th></tr>
</thead>
<tbody>
<tr><td><code>%stryke::categories</code></td><td><code>%c</code></td><td>category → arrayref of names (<code>$c{parallel}</code> → <code>[pmap, pgrep, …]</code>)</td></tr>
<tr><td><code>%stryke::primaries</code></td><td><code>%p</code></td><td>primary → arrayref of its aliases (<code>$p{to_json}</code> → <code>[tj]</code>)</td></tr>
</tbody>
</table>
<h3>Examples</h3>
<div class="oneliner">s 'p $b{pmap}' <span class="comment"># "parallel"</span></div>
<div class="oneliner">s 'p $b{to_json}' <span class="comment"># "serialization"</span></div>
<div class="oneliner">s 'p $all{tj}' <span class="comment"># "serialization" (alias resolves via %all)</span></div>
<div class="oneliner">s 'p scalar keys %all' <span class="comment"># total callable spellings (primaries + aliases)</span></div>
<div class="oneliner">s 'p $pc{map}' <span class="comment"># "array / list" (Perl core only)</span></div>
<div class="oneliner">s 'p $e{pmap}' <span class="comment"># "parallel" (extensions only)</span></div>
<div class="oneliner">s 'p $a{tj}' <span class="comment"># "to_json"</span></div>
<div class="oneliner">s 'p $d{pmap}' <span class="comment"># LSP one-liner</span></div>
<div class="oneliner">s '$c{parallel} |> e p' <span class="comment"># every parallel op, O(1) reverse-lookup</span></div>
<div class="oneliner">s '$p{to_json} |> e p' <span class="comment"># every alias of to_json</span></div>
<div class="oneliner">s 'keys %pc |> sort |> p' <span class="comment"># every Perl compat, sorted</span></div>
<div class="oneliner">s 'keys %e |> sort |> p' <span class="comment"># every stryke extension</span></div>
<div class="oneliner">s 'keys %all |> less' <span class="comment"># browse every spelling in $PAGER</span></div>
<div class="oneliner">s 'my %f; $f{$b{$_}}++ for keys %b; dd \%f' <span class="comment"># per-category frequency</span></div>
<div class="oneliner">s 'for my $h (qw(b all pc e a d c p)) { printf "%%%-4s %d\n", $h, scalar keys %$h }' <span class="comment"># catalog</span></div>
<h3>Notes</h3>
<ul>
<li>Every <code>$h{name}</code> lookup is O(1). Inverted indexes (<code>%c</code>, <code>%p</code>) let you do reverse-queries in O(1) too; filters like <code>grep { cond } keys %h</code> are still O(n).</li>
<li>Hash sigil namespace is separate from scalars/subs — the short-alias letters don't collide with <code>$a</code>/<code>$b</code> sort specials, the <code>e</code> extension sub, or any other stryke name.</li>
<li><code>%descriptions</code> is sparse: <code>exists $d{$name}</code> doubles as "is this documented in the LSP?".</li>
<li>A value of <code>"uncategorized"</code> in <code>%builtins</code> flags a name that's dispatched at runtime but missing a <code>// ── category ──</code> section comment in <code>parser.rs</code>.</li>
</ul>
</section>
<section class="tutorial-section">
<h2>Pipe-forward</h2>
<p>The <code>|></code> operator (F# / Elixir) threads a value into the <strong>first argument</strong> of the next call — parse-time only, zero runtime cost.</p>
<pre>x |> f # f(x)
x |> f(a, b) # f(x, a, b)
x |> f |> g(2) # g(f(x), 2)
# real pipeline — count words per file, top 10 longest:
f("*.txt") |> map { [_, slurp(_) |> split(/\s+/) |> scalar] }
|> sort { $b->[1] <=> $a->[1] }
|> take(10)
|> dd</pre>
<p>Precedence sits between <code>?:</code> and <code>||</code>, so <code>x + 1 |> f || y</code> parses as <code>f(x + 1) || y</code>.</p>
<h3>Pipe-RHS sugar</h3>
<ul>
<li><strong>Thread macro</strong> — <code>t EXPR s1 s2 s3</code> expands to <code>EXPR |> s1 |> s2 |> s3</code>. Stages like <code>pow(_, 2)</code> use bare <code>_</code> (or <code>$_</code>) as a placeholder, auto-wrapped in a coderef. Bare <code>_</code> = <code>$_</code> in any expression — enables <code>map{_*2}fi{_>5}</code>.</li>
<li><strong><code>>{ BLOCK }</code></strong> — IIFE anywhere an expression is valid; also works as a pipe stage (<code>lhs |> >{ body }</code>).</li>
<li><strong><code>@[...]</code></strong> — sugar for <code>@{[...]}</code> (deref anonymous arrayref inline).</li>
<li><strong><code>%[k => v]</code></strong> — sugar for <code>%{+{k => v}}</code> (deref anonymous hashref inline, sidesteps the block-vs-hashref ambiguity).</li>
</ul>
</section>
<section class="tutorial-section">
<h2>Builtin categories</h2>
<p>3200+ operations across 3700+ spellings. Query them via <code>keys %stryke::builtins</code> — the table below is a navigational overview, not a full index. Run <code>s 'p scalar keys %b'</code> for the live count.</p>
<div class="cat-grid">
<div class="cat-card"><h4>Array / List (134+)</h4><p><code>map maps flat_map grep sort reverse push pop shift unshift splice reduce fold fore e first any all none take take_while drop skip_while partition min_by max_by zip zip_with interleave frequencies count_by chunk windowed enumerate shuffle uniq dedup compact flatten concat pluck grep_v with_index sorted sorted_desc sorted_nums without take_last drop_last pairwise batch rotate swap_pairs sliding_pairs run_length_encode group_consecutive permutations combinations power_set cartesian_product</code> …</p></div>
<div class="cat-card"><h4>String (129+)</h4><p><code>chomp chop length substr index rindex split join uc lc ucfirst lcfirst chr ord trim lines words chars snake_case camel_case kebab_case pascal_case constant_case capitalize swap_case title_case squish pad_left pad_right center truncate_at reverse_str rot13 rot47 caesar_shift count_vowels count_consonants first_word last_word left_str right_str wrap_text dedent indent strip_html levenshtein soundex extract_numbers extract_emails extract_urls</code> …</p></div>
<div class="cat-card"><h4>Math / Numeric (147+)</h4><p><code>abs int sqrt sin cos tan asin acos atan sinh cosh tanh exp log rand srand inc dec avg stddev clamp normalize range even odd zero positive negative sign negate double triple half round floor ceil gcd lcm factorial fibonacci is_prime divisors sieve_primes cbrt log2 log10 hypot rad_to_deg deg_to_rad pow2 softmax argmax argmin</code> …</p></div>
<div class="cat-card"><h4>Conversion / Units (102+)</h4><p><code>c_to_f f_to_c c_to_k k_to_c miles_to_km km_to_miles feet_to_m m_to_feet inches_to_cm kg_to_lbs lbs_to_kg bytes_to_kb bytes_to_mb bytes_to_gb seconds_to_minutes hours_to_seconds liters_to_gallons cups_to_ml joules_to_cal watts_to_hp pascals_to_psi to_bin to_hex to_oct from_bin from_hex from_oct to_base from_base</code> …</p></div>
<div class="cat-card"><h4>Validation (91+)</h4><p><code>is_empty is_blank is_numeric is_upper is_lower is_alpha is_digit is_alnum is_space is_palindrome is_prime is_sorted is_subset is_superset is_valid_ipv4 is_valid_ipv6 is_valid_email is_valid_url is_valid_json is_valid_semver is_valid_base64 is_ascii is_printable luhn_check is_undef is_defined is_array is_hash is_code is_ref is_int is_float</code> …</p></div>
<div class="cat-card"><h4>Hash / Map (52+)</h4><p><code>keys values each delete exists select_keys top invert merge_hash has_key has_any_key has_all_keys pick omit hash_size hash_from_pairs pairs_from_hash hash_eq keys_sorted values_sorted hash_insert hash_update hash_delete zipmap counter</code></p></div>
<div class="cat-card"><h4>Encoding / Crypto (64+)</h4><p><code>sha1 sha256 sha384 sha512 md5 hmac_sha256 uuid crc32 base64_encode base64_decode hex_encode hex_decode url_encode url_decode gzip gunzip zstd zstd_decode jwt_encode jwt_decode html_escape_str html_unescape_str shell_escape sql_escape hex_dump random_password random_hex_str</code></p></div>
<div class="cat-card"><h4>I/O (62+)</h4><p><code>print p say printf open close eof readline read seek tell slurp input capture pager/pg/less binmode flock getc select truncate read_lines append_file to_file read_json write_json tempfile tempdir file_size file_mtime file_atime is_symlink is_readable is_writable is_executable xopen/xo</code></p></div>
<div class="cat-card"><h4>Filesystem (84+)</h4><p><code>files/f fr dirs/d dr sym_links glob glob_par basename dirname realpath which stat lstat size copy move spurt read_bytes path_ext path_stem path_parent path_join path_split path_is_abs path_is_rel strip_prefix strip_suffix ensure_prefix ensure_suffix</code></p></div>
<div class="cat-card"><h4>Serialization</h4><p><code>to_json/tj to_csv/tc to_toml/tt to_yaml/ty to_xml/tx to_html/th to_markdown/to_md/tmd ddump/dd stringify/str json_encode/decode yaml_encode/decode toml_encode/decode xml_encode/decode json_pretty json_minify escape_json</code></p></div>
<div class="cat-card"><h4>Parallel (31)</h4><p><code>pmap pflat_map pgrep pfor psort preduce preduce_init pmap_reduce pmap_chunked pcache ppool pchannel pselect puniq pfirst pany fan fan_cap pipeline par_pipeline_stream glob_par par_walk par_lines par_sed par_find_files par_line_count pwatch watch</code></p></div>
<div class="cat-card"><h4>Functional (56+)</h4><p><code>reduce fold inject collect complement constantly coalesce default_to when_true when_false if_else safe_div safe_mod safe_sqrt safe_log scan accumulate keep_if reject_if group_consecutive normalize_list softmax argmax argmin juxt2 juxt3 tap_val debug_val converge iterate_n unfold</code> …</p></div>
<div class="cat-card"><h4>Matrix / Linear Algebra (29+)</h4><p><code>dot_product cross_product matrix_add matrix_scale matrix_multiply identity_matrix zeros_matrix ones_matrix diagonal matrix_trace matrix_shape matrix_row matrix_col magnitude vec_normalize vec_add vec_sub vec_scale linspace arange</code></p></div>
<div class="cat-card"><h4>Data / Network (50+)</h4><p><code>fetch fetch_json fetch_async par_fetch csv_read csv_write dataframe sqlite json_jq ipv4_to_int int_to_ipv4 email_domain email_local url_host url_path url_query url_scheme</code></p></div>
<div class="cat-card"><h4>Date / Time (48+)</h4><p><code>time localtime gmtime is_leap_year days_in_month month_name weekday_name quarter_of now_ms now_us now_ns unix_epoch today yesterday tomorrow is_weekend is_weekday datetime_utc datetime_from_epoch datetime_strftime</code></p></div>
<div class="cat-card"><h4>System / Process (35+)</h4><p><code>system exec exit fork wait waitpid kill alarm sleep os_name os_arch num_cpus pid ppid uid gid username home_dir temp_dir cwd is_root uptime_secs cmd_exists env_get env_has env_set env_keys env_pairs signal_name has_stdin_tty has_stdout_tty</code></p></div>
<div class="cat-card"><h4>Geometry</h4><p><code>distance_2d distance_3d midpoint slope area_triangle area_circle circumference perimeter_rect area_rect point_in_circle point_in_rect</code></p></div>
<div class="cat-card"><h4>Color / ANSI</h4><p><code>rgb_to_hex hex_to_rgb ansi_red ansi_green ansi_blue ansi_yellow ansi_cyan ansi_magenta ansi_bold ansi_dim strip_ansi darken lighten mix_colors is_dark is_light</code></p></div>
<div class="cat-card"><h4>Random</h4><p><code>rand srand coin_flip dice_roll random_int random_float random_bool random_choice random_between random_string random_alpha random_digit random_password random_hex_str</code></p></div>
<div class="cat-card"><h4>Data Structures</h4><p><code>set heap deque stack_new queue_new lru_new counter counter_most_common defaultdict ordered_set bitset_new bitset_set bitset_test bitset_clear</code></p></div>
<div class="cat-card"><h4>Async / Timing</h4><p><code>async spawn await timer bench trace eval_timeout retry rate_limit every gen</code></p></div>
<div class="cat-card"><h4>Reflection</h4><p>Eight O(1) hashes — <code>%b</code> builtins, <code>%all</code> every spelling, <code>%pc</code> perl_compats, <code>%e</code> extensions, <code>%a</code> aliases, <code>%d</code> descriptions, <code>%c</code> categories, <code>%p</code> primaries.</p></div>
</div>
</section>
<section class="tutorial-section">
<h2>Parallel primitives (highlights)</h2>
<p>Every <code>p*</code> primitive uses rayon work-stealing, saturates all cores by default, and takes three surface forms:</p>
<pre># block form (_ = element, bare _ is shorthand for $_)
pmap { _ * 2 } 1..1_000_000
# expression form
pmap _ * 2, 1..1_000_000
# bare-fn form (sub double { $_0 * 2 })
pmap double, 1..1_000_000</pre>
<h3>fan / pchannel / ppool</h3>
<pre># fan — run a block N times in parallel (_/$_0 = index 0..N-1)
fan 16 { heavy_work(_) }
# pchannel — bounded MPMC queue
my ($tx, $rx) = pchannel(100)
async { $tx->send($_) for 1..1000; undef $tx }
while (defined(my $v = $rx->recv)) { p $v }
# ppool — persistent worker pool
my $pool = ppool 4, sub {
while (defined(my $j = $rx->recv)) { process($j) }
}
$tx->send($_) for @jobs; undef $tx
$pool->join</pre>
<h3>Pipelines</h3>
<pre># sequential (each stage drains list before next)
pipeline(
sub { map { _ * 2 } @_ },
sub { grep { _ > 10 } @_ },
sub { sum(@_) },
)->run(1..1000)
# streaming — bounded crossbeam channels, concurrent stages
par_pipeline_stream([\&stage1, \&stage2, \&stage3], \@input)</pre>
</section>
<section class="tutorial-section">
<h2>Perl-compat highlights</h2>
<ul>
<li><strong>OOP</strong> — <code>@ISA</code>, C3 MRO (live, not cached), <code>$obj->SUPER::method</code>, <code>tie</code> for scalars/arrays/hashes with <code>TIESCALAR</code>/<code>TIEARRAY</code>/<code>TIEHASH</code>, plus <code>EXISTS</code>/<code>DELETE</code>; <code>use overload</code> with full binary dispatch, <code>nomethod</code>, unary <code>neg</code>/<code>bool</code>/<code>abs</code>. Native <code>class</code> syntax with inheritance, traits, abstract/final, visibility, static fields, operator overloading, and reflection — see <a href="#oop">OOP section</a> below.</li>
<li><strong>Specials</strong> — <code>$?</code> packed POSIX status, <code>$|</code> autoflush, <code>$.</code> line count (undef until first read), <code>@ARGV</code>, <code>%ENV</code>, <code>%SIG</code> (<code>SIGINT</code>/<code>SIGTERM</code>/<code>SIGALRM</code>/<code>SIGCHLD</code>), <code>format</code>/<code>write</code> (partial).</li>
<li><strong>Phases</strong> — <code>BEGIN</code> / <code>UNITCHECK</code> / <code>CHECK</code> / <code>INIT</code> / <code>END</code> run in Perl order; <code>${^GLOBAL_PHASE}</code> matches Perl in both tree-walker and VM.</li>
<li><strong>Interpolation</strong> — <code>$var</code>, <code>#{expr}</code>, <code>$h{k}</code>, <code>$a[i]</code>, <code>@a</code>, <code>@a[slice]</code>, <code>$#a</code>, <code>$0</code>, <code>$1</code>..<code>$n</code>; <code>\x{hex}</code> and unbraced <code>\x</code>.</li>
<li><strong>Strict / modules</strong> — per-mode <code>use strict 'refs'</code> etc., <code>@INC</code> built from <code>-I</code>, <code>vendor/perl</code>, system Perl's <code>@INC</code>, script dir, <code>STRYKE_INC</code>. <code>List::Util</code> is native Rust.</li>
</ul>
<p>Full list in the <a href="https://github.com/MenkeTechnologies/strykelang#0x08-supported-perl-features">README §0x08</a>.</p>
</section>
<section class="tutorial-section" id="oop">
<h2>Object-Oriented Programming</h2>
<p>Stryke supports both Perl 5 OOP (<code>bless</code>, <code>@ISA</code>, <code>tie</code>, <code>use overload</code>) and a native <code>class</code> syntax with inheritance, traits, visibility, static fields, operator overloading, and full reflection.</p>
<h3>Class basics</h3>
<p>Declare classes with typed fields, defaults, and instance methods. Fields get auto-generated getters/setters. <code>$self</code> is implicit in methods.</p>
<pre>class Dog {
name: Str
breed: Str = "Mixed"
fn bark { "Woof from " . $self->name }
}
my $d = Dog(name => "Rex") <span class="comment"># named construction</span>
my $d = Dog("Rex", "Lab") <span class="comment"># positional construction</span>
p $d->name <span class="comment"># getter → "Rex"</span>
$d->name("Max") <span class="comment"># setter</span>
p $d->bark() <span class="comment"># "Woof from Max"</span></pre>
<h3>Methods with parameters</h3>
<pre>class Calculator {
value: Int = 0
fn add($n) { $self->value + $n }
}
my $c = Calculator(value => 10)
p $c->add(5) <span class="comment"># 15</span></pre>
<h3>Static methods</h3>
<pre>class Math {
fn Self.add($a, $b) { $a + $b }
fn Self.pi { 3.14159 }
}
p Math::add(3, 4) <span class="comment"># 7</span>
p Math::pi() <span class="comment"># 3.14159</span></pre>
<h3>Inheritance (<code>extends</code>)</h3>
<p>Single and multiple inheritance. Parent fields and methods are inherited. C3 MRO for diamond resolution.</p>
<pre>class Animal {
name: Str
fn speak { "Animal: " . $self->name }
}
class Dog extends Animal {
fn speak { "Woof from " . $self->name } <span class="comment"># override</span>
}
my $d = Dog(name => "Rex")
p $d->speak() <span class="comment"># "Woof from Rex"</span>
<span class="comment"># multiple inheritance</span>
class A { a: Int = 1 }
class B { b: Int = 2 }
class C extends A, B { c: Int = 3 }
my $c = C()
p $c->a . "," . $c->b . "," . $c->c <span class="comment"># "1,2,3"</span></pre>
<h3>Abstract classes</h3>
<p>Cannot be instantiated directly. Subclasses must implement abstract methods.</p>
<pre>abstract class Shape {
name: Str
fn describe { "Shape: " . $self->name }
}
<span class="comment"># Shape(name => "x") → ERROR: cannot instantiate abstract class</span>
class Circle extends Shape { radius: Int }
my $c = Circle(name => "ring", radius => 5)
p $c->describe() <span class="comment"># "Shape: ring"</span></pre>
<h3>Final classes and methods</h3>
<p><code>final class</code> prevents subclassing. <code>final fn</code> prevents method override in subclasses. Both checked at declaration time.</p>
<pre>final class Config { value: Int = 42 }
<span class="comment"># class Bad extends Config { } → ERROR: cannot extend final class</span>
class Base {
final fn id { 42 }
fn label { "base" } <span class="comment"># can be overridden</span>
}
class Child extends Base { }
my $c = Child()
p $c->id() <span class="comment"># 42 (inherited, cannot override)</span></pre>
<h3>Visibility (<code>pub</code> / <code>prot</code> / <code>priv</code>)</h3>
<p>Applies to both fields and methods. Runtime enforcement on access.</p>
<pre>class Secret {
pub visible: Int = 1 <span class="comment"># public (default)</span>
priv hidden: Int = 42 <span class="comment"># own class only</span>
prot internal: Int = 99 <span class="comment"># class + subclasses</span>
fn get_hidden { $self->hidden } <span class="comment"># internal access ok</span>
}
class Child extends Secret {
fn get_internal { $self->internal } <span class="comment"># prot: ok from subclass</span>
}
my $s = Secret()
p $s->get_hidden() <span class="comment"># 42</span>
<span class="comment"># $s->hidden → ERROR: private field</span>
my $c = Child()
p $c->get_internal() <span class="comment"># 99</span>
<span class="comment"># $c->internal → ERROR: protected field (outside class hierarchy)</span></pre>
<h3>Static fields</h3>
<p>Shared across all instances. Access via <code>ClassName::field()</code> (getter) / <code>ClassName::field(value)</code> (setter).</p>
<pre>class Tracker {
static total: Int = 0
name: Str
fn BUILD { Tracker::total(Tracker::total() + 1) }
}
my $a = Tracker(name => "a")
my $b = Tracker(name => "b")
p Tracker::total() <span class="comment"># 2</span></pre>
<h3>BUILD / DESTROY hooks</h3>
<p><code>BUILD</code> runs after field init (parent first, then child). <code>DESTROY</code> runs in reverse (child first, then parent).</p>
<pre>class Base {
log: Str = ""
fn BUILD { $self->log("base") }
}
class Child extends Base {
fn BUILD { $self->log($self->log . "+child") }
}
my $c = Child()
p $c->log <span class="comment"># "base+child"</span>
<span class="comment"># DESTROY — child runs first</span>
class Base {
static log: Str = ""
fn DESTROY { Base::log(Base::log() . "base,") }
}
class Child extends Base {
fn DESTROY { Base::log(Base::log() . "child,") }
}
my $c = Child()
$c->destroy()
p Base::log() <span class="comment"># "child,base,"</span></pre>
<h3>Traits</h3>
<p>Interface contracts with required and default methods. Enforced at class declaration.</p>
<pre>trait Loggable {
fn log_prefix { "LOG" } <span class="comment"># default (optional to implement)</span>
fn log_msg <span class="comment"># required (no body)</span>
}
class Event impl Loggable {
msg: Str
fn log_msg { $self->msg }
}
my $e = Event(msg => "hello")
p $e->log_msg() <span class="comment"># "hello"</span>
p $e->does("Loggable") <span class="comment"># 1</span>
<span class="comment"># Missing required method → compile-time error</span>
<span class="comment"># class Bad impl Loggable { } → ERROR: missing required method 'log_msg'</span></pre>
<h3>Late static binding (<code>static::</code>)</h3>
<p>Resolves to the runtime class of <code>$self</code>, unlike <code>SUPER::</code> which is compile-time.</p>
<pre>class Base {
fn class_name { static::identify() }
fn identify { "Base" }
}
class Child extends Base {
fn identify { "Child" }
}
my $c = Child()
p $c->class_name() <span class="comment"># "Child" (not "Base")</span></pre>
<h3>Operator overloading</h3>
<p>Define <code>op_add</code>, <code>op_sub</code>, <code>op_mul</code>, <code>op_div</code>, <code>op_mod</code>, <code>op_pow</code>, <code>op_eq</code>, <code>op_ne</code>, <code>op_lt</code>, <code>op_gt</code>, <code>op_le</code>, <code>op_ge</code>, <code>op_spaceship</code>, <code>op_neg</code>, <code>op_bool</code>, <code>op_abs</code>, <code>op_concat</code>, <code>stringify</code>, and more.</p>
<pre>class Vec2 {
x: Int
y: Int
fn op_add($other) {
Vec2(x => $self->x + $other->x, y => $self->y + $other->y)
}
fn op_neg { Vec2(x => -$self->x, y => -$self->y) }
fn stringify { "(" . $self->x . "," . $self->y . ")" }
}
my $a = Vec2(x => 1, y => 2)
my $b = Vec2(x => 3, y => 4)
my $c = $a + $b
p "$c" <span class="comment"># "(4,6)"</span>
my $d = -$a
p "$d" <span class="comment"># "(-1,-2)"</span></pre>
<h3>Reflection / introspection</h3>
<pre>class Animal { name: Str; fn speak { "..." }; fn eat { "nom" } }
class Dog extends Animal { breed: Str }
my $d = Dog(name => "Rex", breed => "Lab")
p join(",", $d->fields()) <span class="comment"># "name,breed"</span>
p join(",", $d->methods()) <span class="comment"># "speak,eat" (inherited)</span>
p join(",", $d->superclass()) <span class="comment"># "Animal"</span>
p $d->isa("Dog") <span class="comment"># 1</span>
p $d->isa("Animal") <span class="comment"># 1 (inherited)</span>
p $d->isa("Cat") <span class="comment"># "" (false)</span></pre>
<h3>Built-in instance methods</h3>
<table class="reflection-table">
<thead>
<tr><th>Method</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>$obj->fields()</code></td><td>List of all field names (including inherited)</td></tr>
<tr><td><code>$obj->methods()</code></td><td>List of all method names (including inherited)</td></tr>
<tr><td><code>$obj->superclass()</code></td><td>List of parent class names</td></tr>
<tr><td><code>$obj->isa("Class")</code></td><td>Checks inheritance chain</td></tr>
<tr><td><code>$obj->does("Trait")</code></td><td>Checks trait implementation</td></tr>
<tr><td><code>$obj->clone()</code></td><td>Deep copy (independent instance)</td></tr>
<tr><td><code>$obj->with(k => v)</code></td><td>Functional update — returns new instance with changed fields</td></tr>
<tr><td><code>$obj->to_hash()</code></td><td>Convert to hash reference</td></tr>
<tr><td><code>$obj->destroy()</code></td><td>Explicit destructor call (triggers DESTROY chain)</td></tr>
<tr><td><code>"$obj"</code></td><td>Stringify — <code>Class(field => val, ...)</code> or custom <code>stringify</code></td></tr>
</tbody>
</table>
<h3>Field types</h3>
<p>Runtime validation on setter. <code>Float</code> accepts both int and float. Custom types (struct/enum names) also work.</p>
<pre>class Typed {
count: Int <span class="comment"># integer</span>
name: Str <span class="comment"># string</span>
ratio: Float <span class="comment"># int or float</span>
items: Array <span class="comment"># array reference</span>
map: Hash <span class="comment"># hash reference</span>
any_val <span class="comment"># untyped (Any)</span>
}</pre>
</section>
<section class="tutorial-section">
<h2>Extensions beyond stock Perl 5</h2>
<ul>
<li><strong>Native data</strong> — CSV (<code>csv_read</code>/<code>csv_write</code>), columnar <code>dataframe</code>, embedded <code>sqlite</code>, TOML/YAML helpers.</li>
<li><strong>HTTP</strong> — <code>fetch</code> / <code>fetch_json</code> / <code>fetch_async</code> / <code>par_fetch</code>.</li>
<li><strong>Crypto / compression</strong> — <code>sha256</code>, <code>hmac_sha256</code>, <code>jwt_encode</code>/<code>decode</code>, <code>gzip</code> / <code>gunzip</code> / <code>zstd</code>.</li>
<li><strong>Standalone binaries</strong> — <code>s build SCRIPT -o OUT</code> bakes a script into a self-contained executable.</li>
<li><strong>Inline Rust FFI</strong> — <code>rust { pub extern "C" fn ... }</code> blocks compile to a cdylib on first run, dlopen + register as Perl-callable subs.</li>
<li><strong>Bytecode cache</strong> — <code>STRYKE_BC_CACHE=1</code> skips parse + compile on warm starts via on-disk <code>.pec</code> bundles.</li>
<li><strong>Distributed compute</strong> — <code>cluster([...])</code> builds an SSH worker pool; <code>pmap_on $cluster { } @list</code> fans a map across persistent remote workers with fault tolerance.</li>
<li><strong>Shared state</strong> — <code>mysync</code> declares atomic variables safe to mutate from parallel workers.</li>
<li><strong>Language server</strong> — <code>s lsp</code> (or <code>s --lsp</code>) runs an LSP server over stdio with diagnostics, hover, completion. The five reflection hashes above are part of the completion surface.</li>
</ul>
</section>
<section class="tutorial-section">
<h2>CLI flags (common)</h2>
<pre>-e CODE // one-line program (multiple -e's allowed)
-E CODE // like -e, but enables all optional features
-c // syntax check only
--lint / --check // parse + compile bytecode without running
--disasm // print bytecode disassembly before VM run
--ast // dump parsed AST as JSON and exit
--fmt // pretty-print parsed Perl to stdout and exit
--profile // wall-clock profile stderr (flamegraph-ready)
--flame // flamegraph: terminal bars (TTY) or SVG
--no-jit // disable Cranelift JIT (bytecode interpreter only)
--compat // Perl 5 strict-compat: disable all stryke extensions
-n / -p / -i // stdin line-mode + in-place edit
-j N // parallel threads for multi-file execution
// Subcommands
s build SCRIPT -o OUT // AOT compile to standalone binary
s build --project DIR // bundle project (main.stk + lib/) into binary
s check FILE... // parse + compile without executing (CI/editor)
s disasm FILE // disassemble bytecode
s profile FILE // run with profiling (--flame for SVG)
s fmt -i FILE... // format source files in place
s bench // run benchmarks from bench/ or benches/
s test // run tests from t/
s init NAME // scaffold new project (lib/, bench/, t/)
s repl --load FILE // REPL with pre-loaded file
s lsp // language server over stdio
s completions zsh // emit shell completions
s ast FILE // dump AST as JSON
s prun FILE... // run multiple files in parallel
s convert FILE... // convert Perl to stryke syntax
s deconvert FILE... // convert stryke back to Perl
s --remote-worker // worker process for distributed cluster</pre>
</section>
<section class="tutorial-section">
<h2>zshrs — The Most Powerful Shell Ever Created</h2>
<p><code>zshrs</code> is a drop-in zsh replacement written in Rust. Full bash/zsh/fish compatibility, SQLite-indexed completions, and native stryke parallel operations.</p>
<h3>Why zshrs?</h3>
<table class="reflection-table" style="font-size:11px;">
<thead><tr><th>vs zsh</th><th>vs fish</th><th>vs bash</th></tr></thead>
<tbody>
<tr><td>10x faster startup</td><td>Full POSIX compat</td><td>Fish-quality UX</td></tr>
<tr><td>SQLite history (frequency, duration, exit status)</td><td>Runs <code>.bashrc</code> unchanged</td><td>Modern completions</td></tr>
<tr><td>Native stryke parallel ops</td><td>No syntax translation needed</td><td>Syntax highlighting</td></tr>
<tr><td>ZWC precompiled function support</td><td>Global/suffix aliases</td><td>Autosuggestions</td></tr>
</tbody>
</table>
<h3>Core features</h3>
<table class="reflection-table">
<thead><tr><th>Feature</th><th>Description</th></tr></thead>
<tbody>
<tr><td><strong>zsh/bash/fish compat</strong></td><td>Runs <code>.zshrc</code>, <code>.bashrc</code>, shell scripts unchanged</td></tr>
<tr><td><strong>Fish-style highlighting</strong></td><td>Real-time colorization — commands green, strings yellow, errors red, variables cyan</td></tr>
<tr><td><strong>Fish-style autosuggestions</strong></td><td>Ghost-text completions from history, accept with →</td></tr>
<tr><td><strong>Fish-style abbreviations</strong></td><td><code>g</code> → <code>git</code>, <code>gco</code> → <code>git checkout</code>, expand with space</td></tr>
<tr><td><strong>SQLite completions</strong></td><td>FTS5 prefix search indexes all PATH executables for instant fuzzy completion</td></tr>
<tr><td><strong>SQLite history</strong></td><td>Frequency-ranked, timestamped, tracks duration and exit status per command</td></tr>
<tr><td><strong>Stryke mode</strong></td><td>Prefix any line with <code>@</code> for full parallel primitives</td></tr>
<tr><td><strong>ZWC support</strong></td><td>Reads compiled <code>.zwc</code> files for fast function loading</td></tr>
<tr><td><strong>Job control</strong></td><td>Full <code>&</code>, <code>fg</code>, <code>bg</code>, <code>jobs</code>, <code>wait</code>, <code>disown</code></td></tr>
<tr><td><strong>Traps & signals</strong></td><td><code>trap 'cmd' EXIT INT TERM ERR DEBUG</code></td></tr>
<tr><td><strong>Hooks</strong></td><td><code>precmd</code>, <code>preexec</code>, <code>chpwd</code>, <code>add-zsh-hook</code></td></tr>
<tr><td><strong>zsh modules</strong></td><td><code>zpty</code>, <code>zsocket</code>, <code>zprof</code>, <code>sched</code>, <code>zparseopts</code></td></tr>
<tr><td><strong>PCRE regex</strong></td><td><code>pcre_compile</code>, <code>pcre_match</code> with capture groups</td></tr>
<tr><td><strong>Shell emulation</strong></td><td><code>emulate zsh</code>, <code>bash</code>, <code>ksh</code>, <code>sh</code></td></tr>
</tbody>
</table>
<h3>Build options</h3>
<table class="reflection-table" style="font-size:11px;">
<thead><tr><th>Build</th><th>Size</th><th>@ mode</th><th>Command</th></tr></thead>
<tbody>
<tr><td>Fat</td><td>~24MB</td><td>Yes</td><td><code>cargo build --release</code> (strykelang)</td></tr>
<tr><td>Lean</td><td>~4MB</td><td>No</td><td><code>cargo build --release -p zsh</code></td></tr>
</tbody>
</table>
<h3>Usage</h3>
<pre>zshrs # interactive shell
zshrs -c 'echo hello' # execute command
zshrs script.sh # run script file
zshrs --dump-zwc file.zwc # inspect compiled zsh files
# In interactive mode, @ enters stryke (fat build only):
$ @ 1..100 |> sum |> p
5050
$ @ fetch_json("https://api.github.com/users/octocat") |> dd
$ @ ls |> pmap { stat(_)->{size} } |> sum |> p # parallel file sizes
$ @ glob("**/*.rs") |> pgrep { slurp(_) =~ /TODO/ } |> p</pre>
<h3>Default abbreviations (fish-style)</h3>
<p>Abbreviations expand inline when you press space — type <code>gs<space></code> and it becomes <code>git status </code>.</p>
<table class="reflection-table" style="font-size:11px;">
<thead><tr><th>Abbr</th><th>Expansion</th><th>Abbr</th><th>Expansion</th></tr></thead>
<tbody>
<tr><td><code>g</code></td><td>git</td><td><code>ga</code></td><td>git add</td></tr>
<tr><td><code>gaa</code></td><td>git add --all</td><td><code>gc</code></td><td>git commit</td></tr>
<tr><td><code>gcm</code></td><td>git commit -m</td><td><code>gco</code></td><td>git checkout</td></tr>
<tr><td><code>gd</code></td><td>git diff</td><td><code>gds</code></td><td>git diff --staged</td></tr>
<tr><td><code>gp</code></td><td>git push</td><td><code>gpl</code></td><td>git pull</td></tr>
<tr><td><code>gs</code></td><td>git status</td><td><code>gsw</code></td><td>git switch</td></tr>
<tr><td><code>gb</code></td><td>git branch</td><td><code>gl</code></td><td>git log --oneline</td></tr>
<tr><td><code>cb</code></td><td>cargo build</td><td><code>cr</code></td><td>cargo run</td></tr>
<tr><td><code>ct</code></td><td>cargo test</td><td><code>cc</code></td><td>cargo check</td></tr>
<tr><td><code>cf</code></td><td>cargo fmt</td><td><code>ccl</code></td><td>cargo clippy</td></tr>
<tr><td><code>dc</code></td><td>docker compose</td><td><code>dcu</code></td><td>docker compose up</td></tr>
<tr><td><code>k</code></td><td>kubectl</td><td><code>kgp</code></td><td>kubectl get pods</td></tr>
<tr><td><code>...</code></td><td>../..</td><td><code>....</code></td><td>../../..</td></tr>
</tbody>
</table>
<h3>Full feature reference</h3>
<div class="cat-grid">
<div class="cat-card">
<h4>Parameter expansion</h4>
<p><code>${var:-default}</code>, <code>${#var}</code>, <code>${var:offset:len}</code>, <code>${var#pat}</code>, <code>${var/old/new}</code>, <code>${(U)var}</code>, <code>${(s/:/)var}</code>, <code>${(o)arr}</code>, <code>${(k)assoc}</code></p>
</div>
<div class="cat-card">
<h4>Arrays</h4>
<p><code>arr=(a b c)</code>, <code>${arr[1]}</code>, <code>${arr[-1]}</code>, <code>${arr[2,4]}</code>, <code>arr+=(d)</code>, <code>declare -A map</code>, <code>map[k]=v</code></p>
</div>
<div class="cat-card">
<h4>Control flow</h4>
<p><code>if/elif/else/fi</code>, <code>for/do/done</code>, <code>for ((;;))</code>, <code>while/until</code>, <code>case/esac</code>, <code>select</code>, <code>repeat N cmd</code>, <code>{} always {}</code></p>
</div>
<div class="cat-card">
<h4>Arithmetic</h4>
<p><code>$((expr))</code>, <code>((stmt))</code>, <code>let</code>, <code>+ - * / % **</code>, <code>& | ^ ~ << >></code>, <code>++ --</code>, <code>?: ,</code>, hex/octal/binary literals</p>
</div>
<div class="cat-card">
<h4>Conditionals</h4>
<p><code>[[ ]]</code>, <code>[ ]</code>, <code>-eq -ne -lt -gt</code>, <code>== != < ></code>, <code>-z -n</code>, <code>=~</code> regex, <code>-e -f -d -L -r -w -x -s -nt -ot</code></p>
</div>
<div class="cat-card">
<h4>Redirection</h4>
<p><code>> >> < 2> &></code>, <code>2>&1</code>, <code>>|</code> force, heredoc <code><<EOF</code>, herestring <code><<<</code>, process sub <code><(cmd)</code> <code>>(cmd)</code></p>
</div>
<div class="cat-card">
<h4>Globbing</h4>
<p><code>* ? [abc] [!a] [a-z]</code>, <code>{a,b,c}</code>, <code>{1..10}</code>, <code>{0..10..2}</code>, <code>**/*.rs</code>, qualifiers <code>*(.) *(/) *(@) *(om)</code></p>
</div>
<div class="cat-card">
<h4>Functions</h4>
<p><code>f() {}</code>, <code>function f {}</code>, <code>local</code>, <code>return</code>, <code>$@ $* $#</code>, <code>autoload -Uz</code>, <code>functions</code>, <code>unfunction</code></p>
</div>
<div class="cat-card">
<h4>Aliases</h4>
<p><code>alias</code>, <code>unalias</code>, global <code>alias -g G='|grep'</code>, suffix <code>alias -s txt=cat</code></p>
</div>
<div class="cat-card">
<h4>Job control</h4>
<p><code>&</code>, <code>jobs</code>, <code>fg</code>, <code>bg</code>, <code>wait</code>, <code>disown</code>, <code>suspend</code>, <code>kill</code>, <code>%1 %+ %- %?str</code></p>
</div>
<div class="cat-card">
<h4>Traps</h4>
<p><code>trap 'cmd' EXIT INT TERM ERR DEBUG CHLD</code>, <code>trap -</code> reset, <code>trap ''</code> ignore, <code>kill -l</code></p>
</div>
<div class="cat-card">
<h4>History</h4>
<p><code>history</code>, <code>fc</code>, <code>!!</code>, <code>!-2</code>, <code>!42</code>, <code>!echo</code>, <code>!?pat</code>, <code>!$ !^ !*</code>, <code>^old^new</code></p>
</div>
<div class="cat-card">
<h4>Prompt</h4>
<p><code>%n %m %~ %? %j %T %D</code>, <code>\u \h \w \W \$</code>, <code>RPROMPT</code>, colors <code>%F{red} %f</code></p>
</div>
<div class="cat-card">
<h4>Hooks</h4>
<p><code>precmd</code>, <code>preexec</code>, <code>chpwd</code>, <code>periodic</code>, <code>add-zsh-hook</code></p>
</div>
<div class="cat-card">
<h4>zsh modules</h4>
<p><code>zpty</code>, <code>zsocket</code>, <code>zprof</code>, <code>sched</code>, <code>zformat</code>, <code>zparseopts</code>, <code>zregexparse</code>, <code>pcre_compile/match</code>, <code>zstyle</code>, <code>zstat</code></p>
</div>
<div class="cat-card">
<h4>Options</h4>
<p><code>setopt/unsetopt</code>: <code>autocd</code>, <code>extendedglob</code>, <code>nullglob</code>, <code>pipefail</code>, <code>noclobber</code>, <code>histignorespace</code>, <code>sharehistory</code></p>
</div>
</div>
<p>See the <a href="https://github.com/MenkeTechnologies/strykelang#0x13-zshrs-shell">full zshrs documentation in README</a> for complete reference with examples.</p>
</section>
<section class="tutorial-section">
<h2>Repository & links</h2>
<ul>
<li><strong>Source</strong> — <a href="https://github.com/MenkeTechnologies/strykelang">github.com/MenkeTechnologies/stryke</a></li>
<li><strong>Crate</strong> — <a href="https://crates.io/crates/strykelang">crates.io/crates/stryke</a> (<code>cargo install strykelang</code>)</li>
<li><strong>Rust API docs</strong> — <a href="https://docs.rs/strykelang">docs.rs/stryke</a></li>
<li><strong>Issues</strong> — <a href="https://github.com/MenkeTechnologies/strykelang/issues">github.com/MenkeTechnologies/stryke/issues</a></li>
<li><strong>Full README</strong> — <a href="https://github.com/MenkeTechnologies/strykelang#readme">README on GitHub</a> (install, parallel primitives, mysync, CLI flags, architecture, benchmarks, standalone binaries, inline Rust, bytecode cache, distributed <code>pmap_on</code>, LSP).</li>
<li><strong>Parity</strong> — <code>parity/cases/*.pl</code> holds 20k+ Perl-vs-s test cases run by <code>parity/run_parity.sh</code>.</li>
</ul>
</section>
</main>
</div>
<script src="hud-theme.js"></script>
</body>
</html>