zshrs
The first compiled Unix shell. The most powerful shell ever created.
"No fork, no problems."
A drop-in zsh replacement written in Rust. The first Unix shell to compile to bytecodes and execute on a purpose-built virtual machine with fused superinstructions. Since the Bourne shell at Bell Labs in 1970, every Unix shell has been an interpreter. zshrs is the first to be a compiler.
Install
# Lean build — pure shell, full concurrent primitives, no stryke
# From source
&&
# binary: target/release/zshrs
# Set as login shell
No-Fork Architecture
Every operation that zsh forks for runs in-process on a persistent worker thread pool:
| Operation | zsh | zshrs |
|---|---|---|
$(cmd) |
fork + pipe | In-process stdout capture via dup2 |
<(cmd) / >(cmd) |
fork + FIFO | Worker pool thread + FIFO |
**/*.rs |
Single-threaded opendir |
Parallel walkdir per-subdir on pool |
*(.x) qualifiers |
N serial stat calls |
One parallel metadata prefetch |
rehash |
Serial readdir per PATH dir |
Parallel scan across pool |
compinit |
Synchronous fpath scan | Background scan + bytecode compilation |
| History write | Synchronous fsync |
Fire-and-forget to pool |
| Autoload | Read file + parse every time | Bytecode deserialization from SQLite |
| Plugin source | Parse + execute every startup | Delta replay from SQLite cache |
Bytecode Compilation
Every command compiles to fusevm bytecodes:
Interactive command → Parser → ShellCompiler → fusevm::Op → VM::run()
Script file (first) → Parser → ShellCompiler → VM::run() → cache bytecodes in SQLite
Script file (cached) → SQLite → deserialize Chunk → VM::run() (no lex, no parse, no compile)
Autoload function → SQLite → deserialize Chunk → VM::run() (microseconds)
Concurrent Primitives
Full parallelism in the thin binary. No stryke dependency needed.
# Async/await
id=
result=
# Parallel map — ordered output
# Parallel filter
# Parallel for-each — unordered, fire as completed
# Barrier — run all, wait for all
AOP Intercept
First shell with aspect-oriented programming:
# Before — log every git command
# After — timing
# Around — memoize
Worker Thread Pool
Persistent pool of [2-18] threads. Configurable:
# ~/.config/zshrs/config.toml
[]
= 8
[]
= true
[]
= true
[]
= 32
= true
SQLite Caching
Three databases power the shell:
- compsys.db — completions: autoloads with bytecodes, comps, services, PATH executables (FTS5)
- history.db — frequency-ranked, timestamped, duration, exit status per command
- plugins.db — plugin delta cache: functions, aliases, variables, hooks, zstyles, options
Browse without SQL:
Exclusive Builtins
| Builtin | Description |
|---|---|
intercept |
AOP before/after/around advice on any command |
intercept_proceed |
Call original from around advice |
async / await |
Ship work to pool, collect result |
pmap |
Parallel map with ordered output |
pgrep |
Parallel filter |
peach |
Parallel for-each, unordered |
barrier |
Run all commands in parallel, wait for all |
doctor |
Full diagnostic: pool metrics, cache stats, bytecode coverage |
dbview |
Browse SQLite caches without SQL |
profile |
In-process command profiling with nanosecond accuracy |
Compatibility
- Full zsh script compatibility — runs existing
.zshrc - Full bash compatibility via emulation
- Fish-style syntax highlighting, autosuggestions, abbreviations
- 150+ builtins ported from zsh
- ZWC precompiled function support
- Glob qualifiers, parameter expansion flags, completion system
- zstyle, ZLE widgets, hooks, modules
Documentation
License
MIT — Copyright (c) 2026 MenkeTechnologies