html and http1 become official packages, taken in by use html / use http1, and leave std (ADR-338)Open and answer this issue on GitHub.
ready, html · opened 2026-11-22 · updated 2026-11-22 · 0 comments
Part of #539
Goal. html and http1 are official packages under packages/, not modules of std: a program writes use html / use http1, and the toolchain takes them in by that first use as it does json and db today.
Governing decision. ADR-338 D2 (a format or protocol is an official package), D3 (std lists them, a use takes one in), section 5 (std::html, std::http1 and std::db become the packages html, http1 and db). ADR-017 (escaping) and ADR-289 name them under std:: and are read as these packages.
Where it stands (read in the code).
html is Rust in std: crates/nikaia-std/src/html.rs (221 lines: the Html type with new, as_str, escaped, and escape(text) -> Cow<str>).http1 is Rust plus Nikaia: crates/nikaia-std/src/http1.rs (348 lines) and crates/nikaia-std/src/runtime/http1.nika (lowered to runtime/lowered/http1.rs).project_members_official() in crates/nikaia-std/src/compiler/project_members.nika; it holds db and json (both 0.1.0). A name joins it when its package is under packages/ at that version.examples/inventory/src/page.nika, examples/report/src/main.nika, examples/escaping/src/main.nika, examples/fortunes.nika (use std::html); the dsl html lowering in emit_core_leaves.nika and check_core_expr.nika; examples/http.Done when. use html and use http1 in a project without a [dependencies] entry build offline from packages/html and packages/http1, std no longer holds either module, and every example’s output is unchanged. The last code step carries Fixes #N; the report gives a Found: line per finding.
To build
packages/html: the escaping API of html.rs (Html, escape, escaped) written in Nikaia, with its tests in packages/html/tests/ (escape of <, >, &, ", '; an Html value is not escaped twice). The Rust in html.rs it replaces is named in the commit.html joins project_members_official(); test in tests/compiler/tests/: a project with use html and no manifest entry builds and prints an escaped line.http1: packages/http1 from runtime/http1.nika and the Nikaia-expressible half of http1.rs; what is a platform call stays a primitive in std.contracts (ADR-platform-layer-v1), named in the report.use html / use http1: the examples above, the dsl html lowering, examples/http. Outputs byte-identical (nikaia test of each example).std::html and std::http1 removed from std; use std::html is refused with the message that names use html.Files and limits. crates/nikaia-std/src/html.rs, http1.rs, runtime/http1.nika, compiler/project_members.nika, the dsl html sites, the examples named, new packages/html/, packages/http1/. Not: packages/json, packages/db (their lanes).