Conversation
IO.write and IO.print use print.c and print.js. IO.print_err keeps print_err.c and takes the shared print.js. Behavior is unchanged. Co-authored-by: Jason <jkbennitt@users.noreply.github.com>
|
Thank you for this. The sharing is correct: we emitted every test on main and on this branch and the only lines that differ are the effect sources themselves, and the per-effect Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
Summary
IO.write,IO.print, and (on JS)IO.print_errare the same stdout/stderrwrapper with a file descriptor and optional newline. Today that logic lives in
near-copy files:
effs/write.js/print.js/print_err.js(7 lines each; sameio_outshape)effs/write.c/print.c(nearly the sameio_cstr→io_outrun)This follows the same simplification Bend already merged for audio and file
effects: related effects share one source; Base keeps importing that one path;
eff_srcstill embeds a file only once.print_err.cstays its own file: it correctly routes throughio_errs, whichis not the same as
io_out(stderr, …).No feature removed. No comment stripping. Behavior of
IO.write/IO.print/IO.print_errunchanged.Negative diffstat
Net −7 lines (honest: smaller than a rough pre-patch estimate — the
#ifdefwrappers use most of what the sharedio_stdout_runhelper saves).Test plan
gates/test.tson this branch: PASS: 1427 / 1427 (check / interp / JS / C; ~158s). Official mini-clustergates/test.tswas not run from our side (no bastion/clusterSSH).IO.write/IO.print/IO.print_erralone and together on interpreter, emitted JS, and native C (including empty strings / UTF-8 / newline vs no-newline); matched pre-patch HEAD.gates/repo.ts: PASS: 46 / 46 (withttokon PATH).Notes
Happy to reshape naming (
stdout.cvs keepingprint.cas the shared home) tomatch whatever convention you prefer after #950/#939.