Repository navigation
Language Map
Chloë Strainge edited this page Oct 15, 2026
·
3 revisions
You can learn Shelly in layers. The shell layer handles commands and their I/O; the value layer handles data; the application layer supplies interfaces and modules. A script can use all three without changing languages.
- Language basics: statements, comments, quoting, and grouping.
- Variables and scope: declarations, assignment, shadowing, caller scope, and captured bindings.
- Numbers and logic: numeric promotion, arithmetic, equality, ordering, truthiness, and short-circuit evaluation.
- Strings and paths: Unicode text, interpolation, slices, home-directory display, and file patterns.
- Arrays: element contracts, slices, copying, spread, and stack methods.
- Hash maps: typed keys and values, lookup, and pairs.
-
Ranges and iteration: bounded and open ranges, snapshots,
and the
next_itemprotocol. -
Control flow:
if,for,while,until, and loop transfers. - Match and type guards: value/range cases and narrowing.
- Functions and calls: argument positions, results, executable references, aliases, and versioned definitions.
- Closures and function types: live captures, callbacks, prototypes, and optional arguments.
-
Methods and properties: live
$self, getters, setters, dynamic member names, and receiver-dependent contracts. - Structs, Enums, Named types and unions.
- Conversions: explicit conversion and source/target hooks.
- Reflection: runtime types and discoverable interfaces.
- Pipelines and Pipeline formats.
- Pipeline splits: nested branches, required alignment guides, streaming fan-out, and portable tab settings.
- Commands and exit status.
- Redirection and Environment.
- Errors and cleanup.
- Modules, Module packages, and Conditional code.
- Standard library and Prelude.
- Bytes and I/O, Item streams, JSON.
- Networking, HTTP, HTTP servers, Framing and RPC.
- Startup and library selection.
- REPL and history, Prompts and widgets.
- Terminal formatting, Line editing, VS Code integration, Vim integration.
Recipes combines topics into small programs. The syntax reference is a compact reminder once the concepts are familiar.
Related: Home · Syntax reference
Begin here
Values and expressions
- Language basics
- Variables and scope
- Numbers and logic
- Strings and paths
- Arrays
- Hash maps
- Ranges and iteration
- Control flow
- Match and type guards
Functions and types
- Functions and calls
- Closures and function types
- Methods and properties
- Structs
- Enums
- Named types and unions
- Conversions
- Types and properties
Shell and modules
- Pipelines
- Pipeline splits
- Pipeline formats
- Commands and exit status
- Redirection
- Environment and exported variables
- Modules and visibility
- Nested modules and directory packages
- Conditional imports and declarations
- Errors and cleanup
- Supervised processes and terminals
Library guides
- Standard library
- The implicit prelude
- Bytes, files, readers, and writers
- Explicit item streams
- JSON documents and typed mapping
- Sockets, DNS, and TLS
- HTTP clients
- HTTP servers
- Framing, server-sent events, and JSON-RPC
- Terminal colors, styles, and geometry
- Build an application console
Interactive use