Lash is a Lua-like scripting language that lowers directly to Bash.
This repository contains:
lash: CLI entrypointlashc: compiler (.lash->.sh)lashfmt: formatterlash-lsp: language server
Lash is under active development. The current implemented surface is documented in:
docs/web/site/index.html(interactive HTML docs)docs/book/README.md(markdown source for the user guide)docs/language-spec.md(reference)
Implemented language features include:
- mutable, immutable, readonly, and global declarations
- arrays and string-keyed map literals
- functions, enums,
switch, and Bash-oriented control flow for,select,while,until,break N, andcontinue N- raw shell command statements,
$(...), process substitution, redirections, traps, background jobs, andcoproc
- .NET SDK (
net10.0) - Bash
Build interactive HTML docs:
just docs-web-buildOpen the web docs:
xdg-open docs/web/site/index.htmlRead the markdown book source:
cat docs/book/README.mdPreview interactive docs locally:
just docs-web-previewRun a Lash script:
lash run script.lash arg1 arg2Check a script without emitting Bash:
lash check script.lashCompile a script to Bash:
lash compile script.lash -o script.sh
bash script.shFormat Lash files:
lash format .
lash format . --checkWatch Lash files and recompile on changes:
lash watch script.lash
lash watch src/From lash --help:
compile <file>: compile.lashto Bash (-o/--outputoptional)check <file>: validate a.lashfile without emissionformat <paths>...: format files/directories (--checksupported)run <file> [args...]: compile to temp Bash and executewatch <paths>...: watch.lashfiles/directories and recompile changed files
Use --verbose on commands for extra phase and progress logs.