Install → a running first program in about two minutes. The installer targets the published v0.8.3 release (CLI binaries for macOS, Linux and Windows; they are not code-signed, but they are checksum-verified against a GPG-signed SHA256SUMS); v0.8.2 remains available as the previous release.
Garnet is a research-grade prototype (v0.x.x), not a production-complete language. This page is the verified happy path; the install section covers per-OS specifics and fallbacks.
None for the prebuilt path — the universal installer pulls a release package verified against SHA256SUMS. The source path needs Rust 1.95+; CI also tracks current stable.
$ curl --proto '=https' --tlsv1.2 -sSf https://garnet-lang.org/install.sh | sh
This verifies the download, extracts garnet, and prints where it landed. Add that bin dir to your PATH if the installer warns it isn't there.
On Windows, in PowerShell: irm https://garnet-lang.org/install.ps1 | iex. It checks the zip against SHA256SUMS, installs garnet.exe and adds it to your user PATH.
Both installers check the download against SHA256SUMS. When gpg is installed, they first check that SHA256SUMS is signed by the release key pinned for that version, and stop if it is not. Without gpg they warn and check integrity only; on Windows, Gpg4win provides gpg. Release signing explains the check and how to verify by hand.
Garnet is not published to crates.io, npm, PyPI or Homebrew. Packages named garnet there, and garnet-cli on npm, belong to unrelated projects. Install only through the two installers above or from source at github.com/Island-Dev-Crew/garnet, and treat any other install instruction for Garnet as untrusted.
$ garnet new --template cli my_app created my_app/ (cli template) $ cd my_app
You get a small, real project:
my_app/ ├── Garnet.toml # project manifest ├── README.md ├── src/main.garnet # entry point └── tests/test_main.garnet
src/main.garnet is deliberately tiny — and it teaches the one idea that makes Garnet different: capabilities.
@caps()
def main() {
println("Hello from my_app!")
println("")
println("Edit src/main.garnet to change this message.")
println("Run `garnet run src/main.garnet` to execute.")
0
}
The @caps() annotation declares the OS authority a function may use; empty declares none. Files, time, network and subprocesses need @caps(fs), @caps(time), @caps(net) and @caps(proc). garnet check rejects an undeclared call when it is reached along the named call chains it traces from an annotated function. From v0.8.3 (the v0.8.2 release gates 15 and has no mem kind), the checker also follows cycles, the memory tiers need @caps(mem), and the twenty-four gated host primitives (file I/O, outbound TCP, environment, processes, time and UUID v4/v7, file logging, memory tiers) need the program entry's declared budget at run time. garnet run does not run the checker, so run garnet check first.
$ garnet test
test test_arithmetic ... ok
test test_string_interpolation ... ok
test result: ok. 2 passed; 0 failed; in 2 file(s)
The template ships with two green starter tests so you start from a known-good state.
$ garnet run src/main.garnet
Hello from my_app!
Edit src/main.garnet to change this message.
Run `garnet run src/main.garnet` to execute.
=> 0
The trailing => 0 is main's printed return value. garnet run exits with status 0 after a successful run, regardless of that value; a runtime error exits with status 1.
Edit the first println in src/main.garnet, then re-run garnet run src/main.garnet. That edit/run loop is the whole inner cycle.
Try the other starters too: garnet new --template web-api and garnet new --template agent-orchestrator — each scaffolds, tests, and runs the same way.