backend: JavaScript #63

Open
opened 2026-10-05 21:07:15 +00:00 by orion · 12 comments
Collaborator

Context

A back end that emits JavaScript; tasks become promises.

Source

Acceptance criteria

  • The conformance suite passes on the JS target (or a stated subset per the capability table)
  • Fixed integer widths kept

Steps

Steps are filed one at a time as each lands; the slice plan is section 6 of docs/design/JAVASCRIPT-BACKEND.md.

  • #602 design record for the JavaScript back end
  • #678 slice 1: first program under Node
  • #684 slice 2: variants, arrays, closures, references
  • #701 slice 3: witnesses, trait values, shared objects, counts
  • #708 slice 4A: ListStorage, list and text natives (4B, the manifest walk, isSame and the BigInt property tests, is filed when 4A lands)
  • slices 5 to 8 of section 6 (floats and libm, structured control flow, tasks, the conformance subset and torb test)

Dependencies

  • Depends on #62 (js/php: decide the three open questions of JAVASCRIPT-AND-PHP.md)
  • Depends on #52 (natives: audit and reduce the manifest of natives to a kernel)

Moved from the planning lists of the docs; the design record stays the specification.

## Context A back end that emits JavaScript; tasks become promises. ## Source - [JAVASCRIPT-AND-PHP.md](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/design/JAVASCRIPT-AND-PHP.md#L11) ## Acceptance criteria - [ ] The conformance suite passes on the JS target (or a stated subset per the capability table) - [ ] Fixed integer widths kept ## Steps Steps are filed one at a time as each lands; the slice plan is section 6 of `docs/design/JAVASCRIPT-BACKEND.md`. - [x] #602 design record for the JavaScript back end - [x] #678 slice 1: first program under Node - [x] #684 slice 2: variants, arrays, closures, references - [x] #701 slice 3: witnesses, trait values, shared objects, counts - [ ] #708 slice 4A: `ListStorage`, list and text natives (4B, the manifest walk, `isSame` and the `BigInt` property tests, is filed when 4A lands) - [ ] slices 5 to 8 of section 6 (floats and `libm`, structured control flow, tasks, the conformance subset and `torb test`) ## Dependencies - Depends on #62 (js/php: decide the three open questions of JAVASCRIPT-AND-PHP.md) - Depends on #52 (natives: audit and reduce the manifest of natives to a kernel) _Moved from the planning lists of the docs; the design record stays the specification._
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop), source JAVASCRIPT-AND-PHP.md, not a duplicate. Very large (a new back end); depends on #62 and #52, refine splits it only after those. next: waiting (dependencies #62 and #52) until 2026-10-10T04:00:00Z

[loop:torbscript] intake: in scope (author orion, label loop), source JAVASCRIPT-AND-PHP.md, not a duplicate. Very large (a new back end); depends on #62 and #52, refine splits it only after those. next: waiting (dependencies #62 and #52) until 2026-10-10T04:00:00Z
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261029-0858 until 2026-10-29T22:50:00Z

[loop:torbscript] claim refine by session:loop-torbscript-20261029-0858 until 2026-10-29T22:50:00Z
Author
Collaborator

[loop:torbscript] refine: the dependency wait is stale. #52 is closed (kernel of natives: docs/design/NATIVES.md, K1 to K8) and #417 landed the two decisions the back end needs (64-bit Int in JavaScript, browser capability split; JAVASCRIPT-AND-PHP.md sections 2a and 2b). #62 now only holds the oldest supported PHP version, which does not touch the JavaScript back end. #63 is a new back end and far larger than one PR, so it is an epic now and is split just in time; only the next step is filed: #602 "js: design record for the JavaScript back end (step 1 of #63)" (labels loop, ready; docs only, no seed). Its record fixes module layout and driver flag, the IR-to-JavaScript mapping, how K1 to K8 are provided, memory, tasks as promises and the ordered slices of this epic, so the implementation steps follow from it, each filed when it starts. No duplicate found (keyword search over open and closed issues: only #62 to #66 and #417). No owner decision needed: all of it is technical and decided by the loop.

Epic checklist (steps are filed one at a time, never up front):

  • #602 design record for the JavaScript back end
  • implementation slices, as named by the record

next: waiting (step #602; the next step is filed when it lands). Acceptance criteria of #63 stay as written.

Worker usage: refine inline, about 60k tokens.

[loop:torbscript] release refine: done, claim ended.

[loop:torbscript] refine: the dependency wait is stale. #52 is closed (kernel of natives: `docs/design/NATIVES.md`, K1 to K8) and #417 landed the two decisions the back end needs (64-bit `Int` in JavaScript, browser capability split; JAVASCRIPT-AND-PHP.md sections 2a and 2b). #62 now only holds the oldest supported PHP version, which does not touch the JavaScript back end. #63 is a new back end and far larger than one PR, so it is an epic now and is split just in time; only the next step is filed: #602 "js: design record for the JavaScript back end (step 1 of #63)" (labels `loop`, `ready`; docs only, no seed). Its record fixes module layout and driver flag, the IR-to-JavaScript mapping, how K1 to K8 are provided, memory, tasks as promises and the ordered slices of this epic, so the implementation steps follow from it, each filed when it starts. No duplicate found (keyword search over open and closed issues: only #62 to #66 and #417). No owner decision needed: all of it is technical and decided by the loop. Epic checklist (steps are filed one at a time, never up front): - [ ] #602 design record for the JavaScript back end - [ ] implementation slices, as named by the record next: waiting (step #602; the next step is filed when it lands). Acceptance criteria of #63 stay as written. Worker usage: refine inline, about 60k tokens. [loop:torbscript] release refine: done, claim ended.
Author
Collaborator

[loop:torbscript] refine: re-checked 2026-10-29T20:22Z: step 1 (#602) has its implementation PR #606 open, CI pending. The next step is filed when it lands.
next: waiting (epic; step 1 is #602, PR #606)

[loop:torbscript] refine: re-checked 2026-10-29T20:22Z: step 1 (#602) has its implementation PR #606 open, CI pending. The next step is filed when it lands. next: waiting (epic; step 1 is #602, PR #606)
Author
Collaborator

[loop:torbscript] refine: step 1 landed (#602, PR #606 merged: docs/design/JAVASCRIPT-BACKEND.md). Next step filed from its section 6, slice 1: #678 "js: run a first conformance program under Node (step 2 of #63)" (labels loop, ready; touches the seed by name, so two commits). The remaining slices 2 to 8 of the record are filed one at a time as each lands.

Epic checklist:

  • #602 design record for the JavaScript back end
  • #678 slice 1: first program under Node
  • slices 2 to 8 of section 6, as named by the record

next: waiting (step #678).

[loop:torbscript] refine: step 1 landed (#602, PR #606 merged: `docs/design/JAVASCRIPT-BACKEND.md`). Next step filed from its section 6, slice 1: #678 "js: run a first conformance program under Node (step 2 of #63)" (labels `loop`, `ready`; touches the seed by name, so two commits). The remaining slices 2 to 8 of the record are filed one at a time as each lands. Epic checklist: - [x] #602 design record for the JavaScript back end - [ ] #678 slice 1: first program under Node - [ ] slices 2 to 8 of section 6, as named by the record next: waiting (step #678).
Author
Collaborator

[loop:torbscript] refine: re-checked 2026-10-30T06:35Z: step #678 (slice 1) has its implementation PR #679 open, CI pending. Slices 2 to 8 are filed one at a time as each lands.
next: waiting (step #678, PR #679)

[loop:torbscript] refine: re-checked 2026-10-30T06:35Z: step #678 (slice 1) has its implementation PR #679 open, CI pending. Slices 2 to 8 are filed one at a time as each lands. next: waiting (step #678, PR #679)
Author
Collaborator

[loop:torbscript] refine: step #678 (slice 1) landed (PR #679, merged 2026-10-30T07:39Z). Slice 2 is filed as #684 (loop, ready); slices 3 to 8 follow one at a time.
next: waiting (step #684)

[loop:torbscript] refine: step #678 (slice 1) landed (PR #679, merged 2026-10-30T07:39Z). Slice 2 is filed as #684 (loop, ready); slices 3 to 8 follow one at a time. next: waiting (step #684)
Author
Collaborator

[loop:torbscript] wait: slice 2 (#684) is in review as PR #694 (three commits, argus requested, CI pending). Slice 3 is filed when it lands.
next: waiting (PR #694) until 2026-10-30T16:00:00Z

[loop:torbscript] wait: slice 2 (#684) is in review as PR #694 (three commits, argus requested, CI pending). Slice 3 is filed when it lands. next: waiting (PR #694) until 2026-10-30T16:00:00Z
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261030 @anthropic:tkoehn until 2026-10-30T20:20Z

[loop:torbscript] claim refine by session:loop-torbscript-20261030 @anthropic:tkoehn until 2026-10-30T20:20Z
Author
Collaborator

[loop:torbscript] refine: slice 2 (#684) landed (PR #694, d515ae9d). Slice 3 filed as #701 "js: witnesses, trait values, shared objects and the counts under Node" (loop, ready; compiler only, no seed change, one PR, CI only): CallWitness, witness tables, TraitValue/Object, SharedObject, Retain/Release/MakeUnique and the close() order, with a new program js-witnesses-close.trb and the trait and destructor programs added to js.allow. Slices 4 to 8 follow one at a time.

Epic checklist:

  • #602 design record for the JavaScript back end
  • #678 slice 1: first program under Node
  • #684 slice 2: variants, arrays, closures, references
  • #701 slice 3: witnesses, trait values, shared objects, counts
  • slices 4 to 8 of section 6, as named by the record

next: waiting (step #701).

[loop:torbscript] refine: slice 2 (#684) landed (PR #694, d515ae9d). Slice 3 filed as #701 "js: witnesses, trait values, shared objects and the counts under Node" (loop, ready; compiler only, no seed change, one PR, CI only): `CallWitness`, witness tables, `TraitValue`/`Object`, `SharedObject`, `Retain`/`Release`/`MakeUnique` and the `close()` order, with a new program `js-witnesses-close.trb` and the trait and destructor programs added to `js.allow`. Slices 4 to 8 follow one at a time. Epic checklist: - [x] #602 design record for the JavaScript back end - [x] #678 slice 1: first program under Node - [x] #684 slice 2: variants, arrays, closures, references - [ ] #701 slice 3: witnesses, trait values, shared objects, counts - [ ] slices 4 to 8 of section 6, as named by the record next: waiting (step #701).
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261030 @anthropic:tkoehn until 2026-10-31T00:27Z

[loop:torbscript] claim refine by session:loop-torbscript-20261030 @anthropic:tkoehn until 2026-10-31T00:27Z
Author
Collaborator

[loop:torbscript] refine: slice 3 (#701) has landed (PR #703). Slice 4 of the record is too big for one PR (kernel natives, ListStorage, manifest walk, BigInt property tests, isSame), so decided by the loop: it is split into 4A and 4B. 4A is filed as #708 "js: lists, buffers and text natives under Node (slice 4A of #63)" (labels loop, ready; compiler and runtime only, no seed change, one PR, CI only): ContainerNew(ListStorage), the torb_list_* natives in a new runtime/javascript/list.mjs (written in front of the program only when used), sliceBytes/byteAt, the drop order for lists holding Close objects, new programs js-lists and js-lists-panic, and the list-using conformance programs added to js.allow. 4B (manifest walk with the deferred list, isSame, Intrinsic sweep, property tests in tools/) is filed when 4A lands; maps and sets wait for epic #55 as the record says. #63's body now carries the step list. No owner decision needed. Side note: #682 (remainder of slice 1) is open without loop/ready labels and is not picked up.

Epic checklist:

Worker usage: refine, about 120k tokens.

next: implementation (#708)

[loop:torbscript] refine: slice 3 (#701) has landed (PR #703). Slice 4 of the record is too big for one PR (kernel natives, `ListStorage`, manifest walk, `BigInt` property tests, `isSame`), so decided by the loop: it is split into 4A and 4B. 4A is filed as #708 "js: lists, buffers and text natives under Node (slice 4A of #63)" (labels `loop`, `ready`; compiler and runtime only, no seed change, one PR, CI only): `ContainerNew(ListStorage)`, the `torb_list_*` natives in a new `runtime/javascript/list.mjs` (written in front of the program only when used), `sliceBytes`/`byteAt`, the drop order for lists holding `Close` objects, new programs `js-lists` and `js-lists-panic`, and the list-using conformance programs added to `js.allow`. 4B (manifest walk with the deferred list, `isSame`, `Intrinsic` sweep, property tests in `tools/`) is filed when 4A lands; maps and sets wait for epic #55 as the record says. #63's body now carries the step list. No owner decision needed. Side note: #682 (remainder of slice 1) is open without `loop`/`ready` labels and is not picked up. Epic checklist: - [x] #602, #678, #684, #701 (slices 1 to 3 and the record) - [ ] #708 slice 4A - [ ] slice 4B, slices 5 to 8 Worker usage: refine, about 120k tokens. next: implementation (#708)
Sign in to join this conversation.
No labels
loop
ready
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#63
No description provided.