All chapters21
On this page

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 evidence

HHY 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 limits

Minute 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.

sh
curl -fsSL https://hhylang.dev/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
hhy --version

macOS: 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.

sh
brew tap hh696-wq/hhy https://github.com/hh696-wq/hhy-vm.git
brew install hhy
hhy --version

Option 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.
sh
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.hhy

Verify 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.

sh
# 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 --version

For 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.

sh
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 --version

Install the source build

sh
make install PREFIX="$(brew --prefix)"
hhy --version

PREFIX may be a custom absolute path. Once PREFIX/bin is on PATH, execute any .hhy file with hhy run.

Your first script

hello.hhy
let language = "HHY"

["Flow", "Pipe", "System"]
    |> stream
    |> map { word -> language + ": " + word }
    |> print
sh
hhy check hello.hhy
hhy run hello.hhy

let 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

TaskCommandPurpose
Formathhy fmt script.hhyWrite canonical HHY formatting
Check formathhy fmt --check script.hhyVerify in CI without changing files
Check scripthhy check script.hhyValidate syntax, scope, and known APIs
Runhhy run script.hhyExecute the script
Pass argumentshhy run script.hhy input.csv output.jsonArguments enter read-only args
Preview planhhy run --dry-run script.hhyInspect a redacted plan without external effects

HHY source files use the .hhy suffix. View complete command help:

sh
hhy --help