A declarative architectural language: separate a program's structure (.hc)
from its context (.hcs β cascading sheets, like CSS for structure), then
resolve them into a graph with provenance. Swap the context to get a different
build without touching the structure.
π API documentation: https://0al-spec.github.io/Hypercode/
.hc + .hcs ββ[resolve]βββΆ resolved graph ββ[validate contracts]βββΆ canonical IR (hypercode.ir/v2)
- Separation of concerns β
.hcis the what (structure / intent);.hcsis the how (values, configuration), targeted by CSS-like selectors and context-aware@rules. - Context switching / white-label β one structure, many contexts. Swap
--ctx env=production(orclient=acme) β different output, same.hc. - Provenance β every resolved value records the selector, file and source
line it came from;
hypercode explainshows the winner and every losing rule. - Contracts that only narrow β
@contract:blocks attach invariants to selectors; values cascade, safety doesn't. A production override that breaks a bound is a build error (HC2104), not an incident. - Hashed, typed IR β per-node SHA-256 over stable resolved content: the invalidation signal for incremental (re)generation.
git clone https://github.com/0al-spec/Hypercode
cd Hypercode
swift build -c release
.build/release/hypercode --helpβ¦or run without installing:
swift run hypercode resolve Examples/service.hc --hcs Examples/service.hcs --ctx env=production.package(url: "https://github.com/0al-spec/Hypercode", from: "0.4.0"),
// then, as a target dependency:
.product(name: "Hypercode", package: "Hypercode"),hypercode parse <file.hc>
hypercode validate <file.hc> [--hcs <file.hcs>] [--ctx key=value]... # incl. contract checks
hypercode resolve <file.hc> --hcs <file.hcs> [--ctx key=value]...
hypercode emit <file.hc> [--hcs <file.hcs>] [--ctx key=value]... [--format json|yaml] [--ir-version 1|2]
hypercode explain <file.hc> --hcs <file.hcs> [--ctx key=value]... <selector> [property]
hypercode diff <old.ir.json> <new.ir.json> [--format text|json] # affected nodes, exit 1 on change
hypercode lsp # LSP over stdio
Describe a service's structure in .hc:
Service
Logger.console
Database#main-db
Connect
APIServer
ListenSet its configuration in .hcs, then resolve the two files together:
Logger:
level: "info"
Database:
driver: "sqlite"
file: "dev.sqlite3"
APIServer > Listen:
host: "127.0.0.1"
port: 5000
hypercode resolve Examples/service.hc --hcs Examples/service.hcsThe same structure, two contexts:
hypercode resolve Examples/service.hc --hcs Examples/service.hcs # development
hypercode resolve Examples/service.hc --hcs Examples/service.hcs --ctx env=production- Usage guide β every command with real outputs: contexts, contracts, explain, IR v2
- API docs (DocC): https://0al-spec.github.io/Hypercode/
- Conceptual overview
- RFC β the paradigm
- Formal specs:
.hcsyntax (BNF) Β· resolution semantics - Architecture: overview Β· backends & adapters Β· core vs dialects Β· positioning
- Resolved-graph IR schemas β the cross-implementation contract: IR v2 Β· diff v1 Β· IR v1 (legacy)
- Lean 4 cascade oracle β machine-checked agreement with the resolver
- Work plan Β· Changelog Β· Contributing
| Path | What |
|---|---|
Sources/, Tests/, Package.swift |
Swift reference implementation (built on SpecificationCore) |
Examples/ |
Runnable .hc / .hcs (service, white-label) |
Schema/ |
Versioned IR schema |
RFC/, EBNF/*.md, DOCS/ |
Specification & documents |
EBNF/ (ANTLR / Java) |
Conformance oracle for .hc parsing |
SPEC/lean/ |
Lean 4 cascade oracle |
- Specifications & documents (
RFC/,DOCS/,EBNF/*.md) β CC BY 4.0. - Source code (
Sources/,Tests/,EBNF/ANTLR/Java,SPEC/) β MIT.
See LICENSE and LICENSE-CC-BY-4.0.