Guide · Chapter 1
Quick Start
Install HHY, run your first Flow, and learn the daily commands in five minutes.
1.7.1 controlled concurrency and atomicity
This release fixes resource lifetimes and delivers seven experimental APIs, disabled by default. Review state ownership, cooperative file locks, strict transactions and bounded-task guarantees before enabling them.
Read the complete guide and examplesIncludes the guarantee matrix, failure handling and actual validation evidenceHHY 1.7.1 implementation and compatibility
1.7.1 passes local tests, four-platform CI and release validation. Language specification 1.0 remains frozen. Official sample, HTML and macOS/Linux Database 1.0.0 extensions are verified compatible. VS Code 0.2.0 and Sublime 0.1.0 retain independent versions; syntax and editor contract checks pass.
HIR, six optimization passes, integer MIR, type-feedback guards/deopt and local List scalar replacement are implemented. Explicitly enable HHY_COMPILER=ir, HHY_FEEDBACK_SPECIALIZATION=1 and HHY_SCALAR_REPLACEMENT=1; direct Bytecode remains default. Real workloads have not met default-enablement benefit gates. Scalar replacement retains original GC/quota reservations.
Optimization switches, verification and supported scopev1.7.1 implementation1.7.1 release notesReleased capabilities and limitsMinute 1: one-command install (recommended)
The installer supports macOS arm64, Linux x86_64, and Linux arm64. It detects the platform, downloads the V1.7.1 archive and matching .sha256, and installs only after verification. sudo is not required by default.
curl -fsSL https://hhylang.dev/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
hhy --versionmacOS: install from the Homebrew tap
Apple Silicon Macs can use the Formula maintained in this repository. The explicit Git URL lets the repository act as a tap before a separate homebrew-tap repository is created.
brew tap hh696-wq/hhy https://github.com/hh696-wq/hhy-vm.git
brew install hhy
hhy --versionOption 2: download a Release
If you are not modifying the HHY Runtime, an official V1.7.1 archive is the fastest path. Choose darwin-arm64, linux-x86_64, or linux-arm64 for your OS and CPU. Archives include the executable, official sample and database extensions, required non-system runtime libraries, docs, licenses, and build metadata.
Open HHY GitHub Releases ↗Download the latest stable archive and its matching .sha256 file or SHA256SUMS.tar -xzf hhy-1.7.1-PLATFORM-ARCH.tar.gz
cd hhy-1.7.1-PLATFORM-ARCH
./bin/hhy --version
./bin/hhy run examples/07-language-basics.hhyVerify the download and add it to PATH
Before running a download, verify it with the matching .sha256 file or SHA256SUMS. macOS includes shasum; Linux commonly provides sha256sum.
# macOS
shasum -a 256 -c hhy-1.7.1-darwin-arm64.tar.gz.sha256
# Linux
sha256sum -c hhy-1.7.1-linux-x86_64.tar.gz.sha256
# Add to PATH for this terminal (use the real absolute path)
export PATH="/absolute/path/hhy-1.7.1-PLATFORM-ARCH/bin:$PATH"
hhy --versionFor permanent access, put the export PATH line in your shell profile. You may also keep invoking ./bin/hhy from the extracted directory without a system-wide install.
Option 3: build from source
Build from source when developing the Runtime, validating current source, or choosing a custom installation prefix. HHY V1.7.1 supports macOS arm64, Linux arm64, and Linux x86_64 and requires a C11 compiler, make, libcurl, PCRE2, and BDWGC. The database extension additionally needs the corresponding PostgreSQL libpq or MySQL client development library.
brew install curl pcre2 bdw-gc jansson openssl@3 zlib
git clone https://github.com/hh696-wq/hhy-vm.git
cd hhy-vm
make
make test
./build/hhy --versionInstall the source build
make install PREFIX="$(brew --prefix)"
hhy --versionPREFIX may be a custom absolute path. Once PREFIX/bin is on PATH, execute any .hhy file with hhy run.
Your first script
let language = "HHY"
["Flow", "Pipe", "System"]
|> stream
|> map { word -> language + ": " + word }
|> printhhy check hello.hhy
hhy run hello.hhylet creates a binding; the List literal stores three Strings; stream explicitly converts it into a Stream; |> injects the left value into the next call; the map closure creates one new String per item; print consumes the result. check validates lexical syntax, scope, modules, and known standard-library calls without effects.
Running scripts and the development workflow
| Task | Command | Purpose |
|---|---|---|
| Format | hhy fmt script.hhy | Write canonical HHY formatting |
| Check format | hhy fmt --check script.hhy | Verify in CI without changing files |
| Check script | hhy check script.hhy | Validate syntax, scope, and known APIs |
| Run | hhy run script.hhy | Execute the script |
| Pass arguments | hhy run script.hhy input.csv output.json | Arguments enter read-only args |
| Preview plan | hhy run --dry-run script.hhy | Inspect a redacted plan without external effects |
HHY source files use the .hhy suffix. View complete command help:
hhy --help