You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JS String.from_list builds character text through the Base recursion #1689
Converting a Char list still calls String.from_list for every cell. The existing fragment-join helper can collect the Char strings and join them once. It needs no new walker or intermediate array for an empty/singleton list, and must preserve packed U32 Chars.
I measured actual exported modules on main e5527d5 (2.0.37), Linux x64, Bun 1.3.13. These are medians of seven warmed, interleaved before/after rounds, including normal module conversion.
Export
Calls
Main, ms
Local native path, ms
from_list
100
4.492
3.026
Save this as lib.bend:
import Base
def from_list(xs: List<&2, Char>) -> String:
String.from_list(xs)
Compile with bun bend2/main.ts lib.bend -o lib.mjs. This driver (bench.mjs, run with bun bench.mjs) reproduces the baseline workload:
The local change passed 16,804 actual API checks, including first-class references, numerical U32 ordering, all 1,024 astral scalars whose low unit is DC00, packed non-scalars, and wide Nat exponents against a modular-integer oracle. The focused boundary program also ran on emitted JS and native C. This is a native-representation optimization, not a change to generic fold stack limits, Base reduction, parser, kernel or caps.
Activity