Repository navigation
comp.ts sheds 1,012 tokens: tighter comments and four small simplifications - #1786
Merged
Merged
Conversation
…ations - f32_text writes a decimal in one loop over its places instead of three memmove cases (identical text for all 2^32 bit patterns) - bend_dev's CUDA early return joins its #else branch - JS io_run requeues through io_push - term_open's type is a named Open; emit_native reads f.h - long comments keep their facts, drop narration and benchmark tales Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
nicolas-abril
added a commit
to nicolas-abril/bend
that referenced
this pull request
Oct 20, 2026
…s print through Bend The 68 commits of bendlang#1601 (ai/1601-prerebase, 053163d) squashed onto 642d8e1; bendlang#1786's comment and code cuts kept where they overlap.
nicolas-abril
added a commit
to nicolas-abril/bend
that referenced
this pull request
Oct 20, 2026
…s print through Bend The 68 commits of bendlang#1601 (ai/1601-prerebase, 053163d) squashed onto 642d8e1; bendlang#1786's comment and code cuts kept where they overlap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
comp.ts goes from 65,931 to 64,919 ttok, out of its 66,000 cap. That frees 1,012 tokens without changing what the compiler emits.
Comments (about −920 ttok)
32 long comment blocks are tightened. Each keeps its facts and drops narration, restatement of the code beneath it, and benchmark anecdotes:
One
term_dropcomment line also comes back under 80 columns.Code (about −94 ttok)
f32_textbuilds the decimal form in one loop over the digit places, with a point before place −1. This replaces threememmove/memsetcases (ex < 0,ex < p, else). The scientific branch now returns directly.pnever reaches 9, sochar d[9]cannot overflow.bend_dev: CUDA's earlyturn_groupsreturn moves into the CUDA#elsebranch. The back-to-back#endif/#ifndef __METAL_VERSION__pair goes. The text after preprocessing is the same on Metal, CUDA and the host.io_runrequeues a step that has run 64 effects throughio_push(op.kont, x, false, io), the helperio_waitalready uses. Before, it mutated and re-pusheds.term_openandopen_ofreturn a namedtype Open, replacing the literal type written three times.emit_nativereadsf.h, which is alwaysfun_of(k).h.Two changes were left out because #1576's review restored them: dropping the trailing
#undef WL_X, andemit_jump'sseg_ref.Same output as main
All 1,773 programs under
tests/,bench/anddemos/were built to.c,.jsand.mjswith main's comp.ts and with this one:.mjsand build messages: byte-identical, including every expected build error..cand.js: they differ only in comment lines and the three runtime edits above. The compiler's own output (tables, spins, segments, JS program text) is byte-identical.Gates (on main 257f896)
🤖 Generated with Claude Code