--- name: h0-tape description: Edit, check, build, or debug Project H0 (Human Zero) Tape source and native H0 command-line programs. Use for .h0 files, the H0 compiler, and projects created from the H0 CLI starter. --- # Work with H0 Tape ## Find the native toolchain Use the H0 version pinned by the project or its CI. From an extracted toolchain, use `./h0` on Linux x64 or `.\h0.cmd` in Windows PowerShell. If the toolchain directory is on PATH, use `h0`. Run the commands from the project directory with the appropriate executable path. If the project has no compiler, use the [native release quickstart](https://github.com/h0lang/h0/blob/main/llms.txt) to choose the archive for the host, verify its SHA-256 digest, and run the bundled calendar. The [Linux x64 compiler image](https://github.com/h0lang/h0/pkgs/container/h0-compiler) is another option when Docker is available. The [release notes](https://github.com/h0lang/h0/releases/tag/v0.1.1) give Docker commands. ## Edit a program 1. Check the original file with `h0 check path/to/program.h0`. For an existing program, use `h0 guide path/to/program.h0` for the relevant native grammar and standard-library contracts. Use the same explicit target for guide, check, and build when cross-compiling (for example, `--target linux`). 2. Read the project's nearest instructions and follow its existing patterns. For native Tape grammar and layout, read [EDIT.md from the v0.1.1 release](https://github.com/h0lang/h0/blob/v0.1.1/EDIT.md). Read [CORE.md](https://github.com/h0lang/h0/blob/v0.1.1/CORE.md) when you need a compiler protocol or a standard-library contract. 3. Preserve UTF-8, significant tabs, and the order of Tape sections. Numeric calls resolve by section order, so moving a function can change unrelated calls. Check standard-library imports before adding a library operation. Use native examples for features that must compile with the released seed compiler. 4. Re-run the source check, build with `h0 build path/to/program.h0 -o path/to/output`, and verify the executable on its target platform. Use an `.exe` suffix on Windows. Run the project's focused tests when they exist. For [the CLI starter](https://github.com/h0lang/h0-cli-starter), pass the resulting binary to `tests/check_hash.py` using Python 3. ## Adapt a byte-view pattern When implementing a loop over a shared byte view, start with the [checked byte-view patterns](references/byte-counters.md) for exact-byte counts, nonzero counts, ASCII digit ranges or a predicate-weighted byte sum. Match the view/scalar roles and the loop index lifetime before adapting the expression. Then check and test the resulting function on its target. ## Preserve source separators `` in the editing guide denotes a literal U+0009 TAB separator. Write the actual separator into `.h0` source. Before checking generated source, read the saved file and verify its significant separators; the TAB byte is `0x09`. When a file-writing tool accepts a JSON string, use the JSON escape `\t` for a TAB. The tool's JSON decoder produces the separator in the saved file. Keep documentation notation in explanations and literal separators in executable Tape. For failures, record the target, compiler version or release tag, command, exact diagnostic, and the smallest relevant source section. When a native source check passes, verify observable behavior separately by running the program.