text: String.toNfc(), toNfd(), toNfkc() and toNfkd() (commit 2 of 2) #363

Closed
opened 2026-10-13 22:53:26 +00:00 by orion · 6 comments
Collaborator

Context

Commit 2 of 2 for normalization (the compiler side is #362). std/text declares String.toNfc(), toNfd(), toNfkc() and toNfkd() and the docs and conformance programs that go with them. It closes FIRST-PARTY.md gap 23's std/text half (SASLprep itself belongs to the SCRAM slice that needs it) and gives std/dns the NFC it needs (DNS.md section 3).

Depends on

#362, merged and in a published seed (seeds.txt on the seeds release lists a seed at or after the merge commit). Until then this issue is not ready.

Acceptance criteria

  • std/text/src/lib.trb: native fn toNfc(): Self, toNfd(), toNfkc(), toNfkd() on String with doc comments (# Examples, # Pitfalls: normalization changes bytes, compare normalized texts, NFKC loses distinctions, not a security boundary by itself) in the style of the neighbours.
  • A conformance program tests/conformance/text-normalization.trb (+ .expected, .allocations), identical in the VM and natively: precomposed against decomposed ü, Hangul syllables and jamo, a ccc reordering case, a singleton (Ω U+2126), compatibility (fi, ①, A, ㌀), an ASCII text (storage shared), the empty text, and nf(nf(x)) == nf(x).
  • A std test (std/text/tests/) that runs a committed excerpt of NormalizationTest.txt of the pinned version through all four methods; the whole file stays the runtime test of the previous issue.
  • docs/standard-library/ text page, docs/design/FIRST-PARTY.md gap 23 row marked built for the normalization part, docs/design/DNS.md slice 9 row text updated ("NFC: built"), docs/ROADMAP.md line about the natives updated; torb docs skill docs skills regenerated and committed.
  • Tier A and B green in forge CI.

Seed impact

No new native here (it is known to the seed), but a std name is added: the declaration is what the previous commit made safe. Nothing under seed/; no seed refresh needed after this merge.

Size

One PR, one Conventional Commit: feat(text): normalization forms of a String.

## Context Commit 2 of 2 for normalization (the compiler side is #362). `std/text` declares `String.toNfc()`, `toNfd()`, `toNfkc()` and `toNfkd()` and the docs and conformance programs that go with them. It closes [FIRST-PARTY.md gap 23](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/design/FIRST-PARTY.md#L283)'s `std/text` half (SASLprep itself belongs to the SCRAM slice that needs it) and gives `std/dns` the NFC it needs ([DNS.md section 3](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/design/DNS.md#L119)). ## Depends on #362, **merged and in a published seed** (`seeds.txt` on the `seeds` release lists a seed at or after the merge commit). Until then this issue is not `ready`. ## Acceptance criteria - [ ] `std/text/src/lib.trb`: `native fn toNfc(): Self`, `toNfd()`, `toNfkc()`, `toNfkd()` on `String` with doc comments (`# Examples`, `# Pitfalls`: normalization changes bytes, compare normalized texts, NFKC loses distinctions, not a security boundary by itself) in the style of the neighbours. - [ ] A conformance program `tests/conformance/text-normalization.trb` (+ `.expected`, `.allocations`), identical in the VM and natively: precomposed against decomposed `ü`, Hangul syllables and jamo, a ccc reordering case, a singleton (`Ω` U+2126), compatibility (`fi`, `①`, `A`, `㌀`), an ASCII text (storage shared), the empty text, and `nf(nf(x)) == nf(x)`. - [ ] A std test (`std/text/tests/`) that runs a committed excerpt of `NormalizationTest.txt` of the pinned version through all four methods; the whole file stays the runtime test of the previous issue. - [ ] `docs/standard-library/` text page, `docs/design/FIRST-PARTY.md` gap 23 row marked built for the normalization part, `docs/design/DNS.md` slice 9 row text updated ("NFC: built"), `docs/ROADMAP.md` line about the natives updated; `torb docs skill docs skills` regenerated and committed. - [ ] Tier A and B green in forge CI. ## Seed impact No new native here (it is known to the seed), but a std name is added: the declaration is what the previous commit made safe. Nothing under `seed/`; no seed refresh needed after this merge. ## Size One PR, one Conventional Commit: `feat(text): normalization forms of a String`.
Author
Collaborator

[loop:torbscript] refine: body written by the refinement of #36. next: waiting (depends on #362 merged and a published seed containing it)

[loop:torbscript] refine: body written by the refinement of #36. next: waiting (depends on #362 merged and a published seed containing it)
Author
Collaborator

[loop:torbscript] refine: the dependency is met. #362 landed as e14d7addbf (PR #369) and that commit is listed in seeds.txt on the seeds release (seed e14d7addbf, published 2026-10-15); the issue needs no seed refresh itself. Goal, acceptance criteria, design records, seed impact and size (one PR, one commit) are stated. Setting ready. next: implement

[loop:torbscript] refine: the dependency is met. #362 landed as e14d7addbf2f (PR #369) and that commit is listed in seeds.txt on the seeds release (seed e14d7addbf2f, published 2026-10-15); the issue needs no seed refresh itself. Goal, acceptance criteria, design records, seed impact and size (one PR, one commit) are stated. Setting ready. next: implement
Author
Collaborator

[loop:torbscript] claim implement by loop-torbscript-363 until 2026-11-15T03:07:04Z

[loop:torbscript] claim implement by loop-torbscript-363 until 2026-11-15T03:07:04Z
Author
Collaborator

[loop:torbscript] claim implement by torbscript-363-impl until 2026-11-15T09:20:00Z

[loop:torbscript] claim implement by torbscript-363-impl until 2026-11-15T09:20:00Z
Author
Collaborator

[loop:torbscript] release implement by torbscript-363-impl: PR #812 open, CI queued (all runs of the PR still waiting for a runner after about 23 minutes; local checks green: torb test std/text 81 passed, format and skill checks, conformance in VM and native). next: review (merge gate)

[loop:torbscript] release implement by torbscript-363-impl: PR #812 open, CI queued (all runs of the PR still waiting for a runner after about 23 minutes; local checks green: torb test std/text 81 passed, format and skill checks, conformance in VM and native). next: review (merge gate)
argus closed this issue 2026-11-15 06:28:32 +00:00
Author
Collaborator

Status (post-merge of #812, merged by argus): the code is on main (9b2292c934) and in the nightly channel (nightly-20261115). It is in no stable or rc release yet, so this is not done. Next step, recorded here because it does not finish in this run: the release needs a version bump PR on main first (project.trb, compiler/project.trb, editors/vscode/package.json, languageVersion in compiler/src/package/version.trb, apm.yml, skills/.codex-plugin/plugin.json; currently 0.1.0), reviewed and merged by argus. Then branch release/0.2, tag v0.2.0-rc.1 per docs/contributing/releasing.md, at the calendar date (rc about a week before the first Tuesday of December). Tag push is the approval per standing approval. Verify the release workflow and images afterwards.

Status (post-merge of #812, merged by argus): the code is on main (9b2292c934) and in the nightly channel (nightly-20261115). It is in no stable or rc release yet, so this is not done. Next step, recorded here because it does not finish in this run: the release needs a version bump PR on main first (project.trb, compiler/project.trb, editors/vscode/package.json, languageVersion in compiler/src/package/version.trb, apm.yml, skills/.codex-plugin/plugin.json; currently 0.1.0), reviewed and merged by argus. Then branch release/0.2, tag v0.2.0-rc.1 per docs/contributing/releasing.md, at the calendar date (rc about a week before the first Tuesday of December). Tag push is the approval per standing approval. Verify the release workflow and images afterwards.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#363
No description provided.