Phase 4 Tooling Slice
This page records the Phase 4 workflow surface implemented by the bootstrap compiler. It is local-first rather than hosted-service-oriented, but it is complete at bootstrap scope.
Summary
The shipped Phase 4 slice focuses on developer workflow:
- a primary
hyCLI - v2
.hyprojmanifests - workspaces and local path dependencies
- build, run, test, format, check, and package workflows
- incremental build caching
- simple debug/source-map metadata
- warning-bearing
hy check --jsondiagnostics - local filesystem package registries
- lightweight
hy lspsupport - VS Code assets in-repo
- pure-Hylang showcase workspaces:
hexlabandsdk_demo
The raw-memory systems surface from Phase 3 is executable at bootstrap scope: unsafe, pointers, stackalloc, sizeof, System.Runtime.Memory, and Buffer.DangerousData() run in both interpreter and compiled mode.
CLI
The hy executable is the default entry point.
Supported commands:
hy new app|lib|tool|test|workspace <name>hy build <target> [--target exe|lib] [-o output] [--debug]hy run <target> [-- args...]hy test [target]hy fmt <path...> [--check]hy check <target> [--json]hy package pack <target> [-o output]hy package add <target> <path>hy package init-registry <path>hy package publish <project.hyproj> --registry <path>hy package search <query> --registry <path>hy package install <target.hyproj> <package-id> [--version <version>] --registry <path>hy lsp
Compatibility shims remain available:
hyrun <file.hy|project.hyproj> [args...]hyc build <file.hy|project.hyproj> [--target exe|lib] [-o output]
Manifest v2
New projects scaffolded by hy new use the v2 manifest format.
Current supported fields:
format = 2nameversiontype = "exe" | "lib" | "test" | "workspace"sources = [...]project_references = [...]members = [...][package]iddescriptionauthorslicense
[dependencies]- inline tables with
path - optional
id - optional
version
- inline tables with
Current manifest rules:
- workspace manifests use
type = "workspace"andmembers = [...] - test projects use
type = "test" - v1 manifests still load for compatibility
- local path dependencies are resolved directly
- registry dependencies are resolved only from an explicitly supplied local filesystem registry
hy fmtcanonicalizes v2 manifests only
Build and Test Workflow
Current behavior:
hy buildcan build a script, a project, or every member of a workspacehy runexecutes a script or project through the direct run pathhy testruns explicittype = "test"projects inside a workspace- if a workspace has no explicit test projects,
hy testfalls back to its member projects - build caching lives under
.hylang/cache/ - cache keys include manifest data, source hashes, compiler version, target type, and debug flags
hy build --debugemits a simple.hymap.jsonnext to generated output
hy check currently performs parse/bind/type-check validation plus a bootstrap lint pass. --json writes machine-readable diagnostics for editor and task integration.
Current warning categories:
- unused
using - unused local
- unused parameter
- unreachable statement after terminating control flow
- local shadowing another local or parameter
- empty or unnecessary
unsafeblock - statically provable
Bufferuse-after-free - unused private field
- unused private method
- duplicate dependency entries
- invalid manifest/package metadata
Bootstrap Standard Library Additions Used By Phase 4
The workflow and showcase slice currently depends on these additional runtime pieces:
System.IO.File.ReadAllBytes(string path) -> byte[]System.IO.File.WriteAllBytes(string path, byte[] data)System.Convert.ToInt32(string text)System.Runtime.BufferAllocateFromArrayLengthGetSetSliceFillToArrayDangerousDataFree
System.Runtime.Memory.AllocSystem.Runtime.Memory.FreeSystem.Runtime.Memory.CopySystem.Runtime.Memory.SetSystem.Runtime.Memory.CompareSystem.Testing.Assert.TrueSystem.Testing.Assert.FalseSystem.Testing.Assert.EqualSystem.Testing.Assert.NotEqualSystem.Testing.Assert.FailSystem.Runtime.BinaryPrimitivesReadUInt16LE,ReadUInt16BEReadUInt32LE,ReadUInt32BEReadUInt64LE,ReadUInt64BEReadInt16LE,ReadInt16BEReadInt32LE,ReadInt32BEReadInt64LE,ReadInt64BE- matching 16-bit, 32-bit, and 64-bit write helpers
Showcase: HexLab
hexlab is the current showcase workspace for the delivered Phase 4 slice.
Workspace members:
HexLab.CoreHexLab.CliHexLab.Tests
CLI surface:
dump <file> [width] [start] [count]inspect <file>diff <left> <right>search <file> <hex-pattern>slice <file> <start> <count> <out>
Implemented showcase behavior:
- hex dump output for binary files
- binary signature inspection for PNG, ZIP, ELF, and PE/DOS headers
- file diff reporting
- byte-pattern search from hex strings
- byte slicing and write-back
- Buffer-backed core byte handling
- explicit unsafe search fast path through
Buffer.DangerousData() - package/build/test/fmt/check flow through the
hyCLI
Golden coverage currently exercises:
inspectdumpdiffsearchslice
Showcase: SDK Demo
sdk_demo is the Phase 4 tooling ecosystem proof workspace.
Workspace members:
SdkDemo.CoreSdkDemo.CliSdkDemo.TestsSdkDemo.Consumer
It proves:
- workspace build and test
- format and check workflows
- package publishing into a local registry
- package search
- package install into a consumer project
- running the consumer through the installed registry dependency
Deliberate Exclusions
The following remain beyond Phase 4:
- hosted registry service, authentication, signing, and remote downloads
- semver range solving
- full semantic IDE features such as completion, go-to-definition, references, rename, semantic tokens, and workspace indexing
- debugger integration beyond source-mapped runtime failures