backend: PHP #64

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

Context

A back end that emits PHP; tasks run on an event loop that uses what the host has.

Source

Steps

Split by docs/design/PHP.md (section 6), as #63 was split. Each step is filed when the one before it is merged.

  • Step 1: design record docs/design/PHP.md (#702)
  • Step 2: first program: target linux-php, driver, functions, integers, records, goto blocks, guards, CI action .forgejo/actions/php (slice 1; not filed)
  • Step 3: the rest of the language, part 1: variants, switch, arrays, closures, cells, lazy (slice 2; not filed)
  • Step 4: the rest of the language, part 2: witnesses, trait values, objects, counts and Close order (slice 3; not filed)
  • Step 5: kernel, part 1: integers, bits, storage, UInt64, manifest walk (slice 4; not filed)
  • Step 6: kernel, part 2: floats, libm, pack/unpack, Float32 (slice 5; not filed)
  • Step 7: tasks on the run queue, timers, stream_select, cancellation (slice 6; not filed)
  • Step 8: errors and limits: out of memory, time limit, internal-error hooks (slice 7; not filed)
  • Step 9: conformance subset, .nophp markers, torb test --target linux-php, docs (slice 8; not filed)

#65 (capability table) and #66 (Composer package) stay separate.

Acceptance criteria

  • The conformance suite passes on the PHP target (or the stated subset)

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 PHP; tasks run on an event loop that uses what the host has. ## Source - [JAVASCRIPT-AND-PHP.md](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/design/JAVASCRIPT-AND-PHP.md#L11) ## Steps Split by `docs/design/PHP.md` (section 6), as #63 was split. Each step is filed when the one before it is merged. - [ ] Step 1: design record `docs/design/PHP.md` (#702) - [ ] Step 2: first program: target `linux-php`, driver, functions, integers, records, `goto` blocks, guards, CI action `.forgejo/actions/php` (slice 1; not filed) - [ ] Step 3: the rest of the language, part 1: variants, switch, arrays, closures, cells, lazy (slice 2; not filed) - [ ] Step 4: the rest of the language, part 2: witnesses, trait values, objects, counts and `Close` order (slice 3; not filed) - [ ] Step 5: kernel, part 1: integers, bits, storage, `UInt64`, manifest walk (slice 4; not filed) - [ ] Step 6: kernel, part 2: floats, `libm`, `pack`/`unpack`, `Float32` (slice 5; not filed) - [ ] Step 7: tasks on the run queue, timers, `stream_select`, cancellation (slice 6; not filed) - [ ] Step 8: errors and limits: out of memory, time limit, internal-error hooks (slice 7; not filed) - [ ] Step 9: conformance subset, `.nophp` markers, `torb test --target linux-php`, docs (slice 8; not filed) #65 (capability table) and #66 (Composer package) stay separate. ## Acceptance criteria - [ ] The conformance suite passes on the PHP target (or the stated subset) ## 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] refine: re-checked 2026-10-29T19:56Z: still blocked on #62 (PHP version floor, owner decision asked in the TorbScript group today) and #52. Splitting waits until both are settled.
next: waiting (dependencies #62 owner decision and #52)

[loop:torbscript] refine: re-checked 2026-10-29T19:56Z: still blocked on #62 (PHP version floor, owner decision asked in the TorbScript group today) and #52. Splitting waits until both are settled. next: waiting (dependencies #62 owner decision and #52)
Author
Collaborator

[loop:torbscript] refine: re-checked 2026-10-30T05:57Z: #62 (PHP version floor) is still an open owner decision (asked 2026-10-29); #52 is closed. The PHP back end is split only once the floor is settled; its design record can follow the JavaScript one (#63, record landed in PR #606).
next: waiting (owner decision #62) until 2026-10-30T08:00:00Z

[loop:torbscript] refine: re-checked 2026-10-30T05:57Z: #62 (PHP version floor) is still an open owner decision (asked 2026-10-29); #52 is closed. The PHP back end is split only once the floor is settled; its design record can follow the JavaScript one (#63, record landed in PR #606). next: waiting (owner decision #62) until 2026-10-30T08:00:00Z
Author
Collaborator

[loop:torbscript] wait: re-checked 2026-10-30T08:30Z: #62 (PHP floor) is still unanswered; second ask went to the TorbScript group today. The split waits for the answer.
next: waiting (owner decision #62) until 2026-10-31T08:00:00Z

[loop:torbscript] wait: re-checked 2026-10-30T08:30Z: #62 (PHP floor) is still unanswered; second ask went to the TorbScript group today. The split waits for the answer. next: waiting (owner decision #62) until 2026-10-31T08:00:00Z
Author
Collaborator

[loop:torbscript] wait: #62 is decided and landed (PR #686 merged: PHP floor 5.6 with a 7.4 fallback). The split of the PHP back end into steps (design record first, as #63 did) is the next refine; no worker slot is free this tick (4 implementers running, 6 open PRs).
next: waiting (worker slot for the refine) until 2026-10-30T13:00:00Z

[loop:torbscript] wait: #62 is decided and landed (PR #686 merged: PHP floor 5.6 with a 7.4 fallback). The split of the PHP back end into steps (design record first, as #63 did) is the next refine; no worker slot is free this tick (4 implementers running, 6 open PRs). next: waiting (worker slot for the refine) until 2026-10-30T13:00:00Z
Author
Collaborator

[loop:torbscript] wait: no worker slot is free this tick (3 slots used: main CI triage #696, refine #72, refine #80). The split of the PHP back end into steps, design record first, is the next refine.
next: waiting (worker slot for the refine) until 2026-10-30T17:38Z

[loop:torbscript] wait: no worker slot is free this tick (3 slots used: main CI triage #696, refine #72, refine #80). The split of the PHP back end into steps, design record first, is the next refine. next: waiting (worker slot for the refine) until 2026-10-30T17:38Z
Author
Collaborator

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

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

[loop:torbscript] refine: split the PHP back end into 9 steps like #63; step 1 (design record docs/design/PHP.md) filed as #702 with loop + ready; the record itself is already written and committed on branch loop/702-php-design-record (one commit docs(design): add the PHP back end design record, not a PR yet, no gates run), so the implementer of #702 only needs to check it and open the PR. #64's body now carries the step list (steps 2 to 9 named, filed just in time). Decided by the loop (full list in #702 and the record): target linux-php; goto per block; is_int overflow check; byte strings compared only with ===/strcmp; pack/unpack with d, f, V; classes for records, witnesses as arrays of function names; no __destruct; tasks as the IR state machines on a run queue with one stream_select wait (no Fibers, no ext-uv/ext-ev), which amends the "Tasks in PHP" bullet of JAVASCRIPT-AND-PHP.md; CI with PHP 5.6.40, 7.4.33 and 8.4.x. No owner decision needed. Caveat: no PHP on the worker machine, so nothing was measured; the record lists each claim taken from the manual and the slice test that pins it. tokens used ~600k

next: waiting (step #702)

[loop:torbscript] refine: split the PHP back end into 9 steps like #63; step 1 (design record `docs/design/PHP.md`) filed as #702 with `loop` + `ready`; the record itself is already written and committed on branch `loop/702-php-design-record` (one commit `docs(design): add the PHP back end design record`, not a PR yet, no gates run), so the implementer of #702 only needs to check it and open the PR. #64's body now carries the step list (steps 2 to 9 named, filed just in time). Decided by the loop (full list in #702 and the record): target `linux-php`; `goto` per block; `is_int` overflow check; byte strings compared only with `===`/`strcmp`; `pack`/`unpack` with `d`, `f`, `V`; classes for records, witnesses as arrays of function names; no `__destruct`; tasks as the IR state machines on a run queue with one `stream_select` wait (no Fibers, no `ext-uv`/`ext-ev`), which amends the "Tasks in PHP" bullet of JAVASCRIPT-AND-PHP.md; CI with PHP 5.6.40, 7.4.33 and 8.4.x. No owner decision needed. Caveat: no PHP on the worker machine, so nothing was measured; the record lists each claim taken from the manual and the slice test that pins it. tokens used ~600k next: waiting (step #702)
Author
Collaborator

[loop:torbscript] wait: step 1 (#702) is in PR #707 (CI pending, argus requested). Step 2 is filed once #707 has merged. next: refine step 2 when #707 has merged.

[loop:torbscript] wait: step 1 (#702) is in PR #707 (CI pending, argus requested). Step 2 is filed once #707 has merged. next: refine step 2 when #707 has merged.
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#64
No description provided.