Skip to content

Commit e6df8b2

Browse files
committed
chore(stdlib): STDLIB-04c — remove dead string_concat extern (Closes #330)
The `extern fn string_concat(s1: String, s2: String) -> String;` declared in `stdlib/effects.affine:35` was dead surface: never wired in any backend (no entry in `lib/interp.ml` builtins or `lib/codegen_deno.ml` deno_builtins) and never called from any stdlib, test, or fixture file. The canonical surface for string concatenation is the `++` operator, lowered in `Value.binop_string` (interp) and `__as_concat` (Deno codegen) — one source of truth. Removing the dead extern eliminates the trap where a caller could `use effects::{string_concat}` and get a program that compiles but throws "string_concat is not defined" at run. Updates `docs/TECH-DEBT.adoc` row 04c to DONE per the audit-split contract. Closes #330. Refs #175.
1 parent f45afa1 commit e6df8b2

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

docs/TECH-DEBT.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,12 @@ round-trips + Deno codegen __cell-shape assertion) |S3 |DONE
183183
(`lib/interp.ml`, `lib/js_codegen.ml`, `lib/codegen_deno.ml`); sibling
184184
`panic` is wired and `error` should mirror it (divergent `T`) |S3 |open
185185
— issue #329
186-
|STDLIB-04c |`string_concat` extern — no direct wiring found; `++`
187-
operator independently lowered. Decide: remove (operator-only) or wire
188-
to mirror `++` |S3 |open — issue #330
186+
|STDLIB-04c |`string_concat` extern — *REMOVED* (Refs #330): the
187+
canonical surface is the `++` operator (lowered in `Value.binop_string`
188+
and `__as_concat`); the extern was declared but never wired in any
189+
backend nor called from any stdlib/test/fixture — dead surface. The
190+
contract is now operator-only and one-source-of-truth. |S3 |DONE
191+
2026-05-24 (Refs #330)
189192
|STDLIB-04d |IO externs (`print`/`println`/`read_line`/`read_file`/
190193
`write_file`) — wired on all backends but no dedicated hermetic e2e
191194
tests; test-debt, not impl-debt |S3 |open — issue #331

stdlib/effects.affine

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ extern fn error<T>(msg: String) -> T / Throws;
3232
extern fn int_to_string(n: Int) -> String;
3333
extern fn string_to_int(s: String) -> Option<Int>;
3434
extern fn string_length(s: String) -> Int;
35-
extern fn string_concat(s1: String, s2: String) -> String;
35+
// `string_concat` removed (STDLIB-04c, Refs #330): the canonical surface
36+
// for string concatenation is the `++` operator, lowered directly in
37+
// `Value.binop_string` (interp) and `__as_concat` (Deno codegen). The
38+
// extern was declared but never wired in any backend nor called from
39+
// any stdlib/test/fixture file — dead surface.

0 commit comments

Comments
 (0)