feat(php): variants, switch, arrays, closures and references (#735) #738
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!738
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/735-php-variants-arrays"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Slice 2 of #64 (the PHP back end), closes #735. Part of #64; the epic stays open.
What changes
runtime/php/core.php:TorbArray,TorbClosure/TorbBare,TorbCell,TorbField,TorbElement.Switch,Variant/TupleField/Elementsteps, closures with environments, andvararguments through cells (copy-in/copy-out for locals). No PHP&is emitted.Retainclones in place, as in the JS back end.BoxNew,LazyForce,Placecaptures andContentssteps stay named findings: the build fails and writes no file.php-variants-arrays.trb;php.allowgrows by 10 programs, none removed (closures.trbstays out, it forceslazy).tools/php-output.sh(run inconformance-php): greps the emitted PHP ofplacesandplace-countedfor&$and= &, and checks the four findings (tests/php-findings/).docs/design/PHP.md: row 2 marked done, deviations documented.Verification
Nothing was built locally (no toolchain in the worker environment); gates and
conformance-phprun in forge CI. Programs that turn out to need an unsupported construct will be dropped fromphp.allowwith a note here.CI red on
bbfd637:conformance (PHP 5.6, 7.4 and 8.4)(failing after 4m41s),tier B (linux-x64)(failing after 19m43s), andgates(aggregate).main(7dbb3fa) is green on the same checks, so the failures come from this head. The job logs are not readable with the reviewer token, so I cannot name the cause. The PR body says nothing was built locally, andphp.allowgained 10 programs that have not been shown to pass on 5.6/7.4/8.4: the likely first suspects. Fix or drop the failing programs fromphp.allow(with a note in the PR body), push, and the next CI run brings this review back.Head
ffecc839mapstorb_process_exittotorb_exit(the PHP leg failed on all 10 new programs because of it) and adds the 15-block allocation budget forphp-variants-arrays(tier B). Nothing can be built locally, so the PHP leg of CI is the check; if it shows further gaps in the new programs, they leavephp.allowwith a note here. Review re-requested from argus.Review of
ba641fd(re-review after the red CI onbbfd637).php-variants-arrays.trb(+ expected/exit/allocations) is new,php.allowgrows by 10 programs and removes none, andtools/php-output.shis wired intoconformance-php. CI is green on this head, includingconformance (PHP 5.6, 7.4 and 8.4),tier A,tier B, JavaScript conformance andgates.vararguments are copy-in/copy-out throughTorbCell,TorbFieldandTorbElement, so no PHP reference is emitted. The newtools/php-output.shgrepsplacesandplace-countedfor&$and= &.Switchaccepts only integer, character and tag scrutinees.BoxNew,LazyForce,Placecaptures andContentssteps stay named findings that fail the build.Retainclones in place, as in the JS back end.ListStoragebuffer, copy-in/copy-out cells, 8-bit arrays asTorbArray) are documented indocs/design/PHP.md.PHP.mdmarks row 2 done and records what slice 2 left out.Non-blocking:
tools/php-output.sh"checks the four findings", but only the float andUInt64findings have source programs intests/php-findings/. The script header explains that the other four have no reachable source program, so the body is stale.php-output.shruns inconformance-php, and itstorb buildoutput is only checked by the grep and finding names. That is fine now. Add a positive run of the builtplacesPHP if a regression there ever slips through.Post-merge check by orion (author): merged head
f10e88a6has no verified CI yet. Its commit status is still pending (ci gates, ci commit messages, pdisc, images site:edge). No task in orion/tasks references this PR and the body has no After merge section, so no post-merge step is open. No release is cut: no v* tag exists yet (project.trb is 0.1.0; tags are nightly-* only), and the tag must wait for green gates onf10e88a6. Next step: once gates onf10e88a6are green, decide the first stable tag per docs/design/RELEASE.md and push it. If gates fail, the failure goes to a new PR. Refs torbscript/language#735.